SimAVR
AVR Simulator
sim_avr.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "avr/avr_mcu_section.h"
#include "avr_uart.h"
#include "sim_avr.h"
#include "sim_core.h"
#include "sim_gdb.h"
#include "sim_time.h"
#include "sim_vcd_file.h"
#include "sim_core_decl.h"
Include dependency graph for sim_avr.c:

Macros

#define AVR_KIND_DECL
 

Functions

static void std_logger (avr_t *avr, const int level, const char *format, va_list ap)
 
void avr_global_logger (struct avr_t *avr, const int level, const char *format,...)
 Logs a message using the current logger. More...
 
void avr_global_logger_set (avr_logger_p logger)
 Sets a global logging function in place of the default. More...
 
avr_logger_p avr_global_logger_get (void)
 Gets the current global logger function. More...
 
int avr_init (avr_t *avr)
 Initializes a new AVR instance. Will call the IO registers init(), and then reset() More...
 
void avr_terminate (avr_t *avr)
 Finish any pending operations. More...
 
void avr_reset (avr_t *avr)
 Resets the AVR, and the IO modules. More...
 
void avr_sadly_crashed (avr_t *avr, uint8_t signal)
 Called when the core has detected a crash somehow. More...
 
static void _avr_io_command_write (struct avr_t *avr, avr_io_addr_t addr, uint8_t v, void *param)
 
void avr_set_command_register (avr_t *avr, avr_io_addr_t addr)
 Set an IO register to receive commands from the AVR firmware it's optional, and uses the ELF tags. More...
 
static void _avr_io_console_write (struct avr_t *avr, avr_io_addr_t addr, uint8_t v, void *param)
 
void avr_set_console_register (avr_t *avr, avr_io_addr_t addr)
 Specify the "console register" – output sent to this register is printed on the simulator console, without using a UART. More...
 
void avr_loadcode (avr_t *avr, uint8_t *code, uint32_t size, avr_flashaddr_t address)
 Load code in the "flash". More...
 
uint32_t avr_pending_sleep_usec (avr_t *avr, avr_cycle_count_t how_long)
 Accumulates sleep requests (and returns a sleep time of 0) until a minimum count of requested sleep microseconds are reached (low amounts cannot be handled accurately). More...
 
void avr_callback_sleep_gdb (avr_t *avr, avr_cycle_count_t how_long)
 These are callbacks for the two 'main' behaviour in simavr. More...
 
void avr_callback_run_gdb (avr_t *avr)
 
void avr_callback_sleep_raw (avr_t *avr, avr_cycle_count_t how_long)
 
void avr_callback_run_raw (avr_t *avr)
 
int avr_run (avr_t *avr)
 Run one cycle of the AVR, sleep if necessary. More...
 
avr_tavr_core_allocate (const avr_t *core, uint32_t coreLen)
 Used by the cores, allocated a mutable avr_t from the const global. More...
 
avr_tavr_make_mcu_by_name (const char *name)
 Locate the maker for mcu "name" and allocates a new avr instance. More...
 

Variables

static avr_logger_p _avr_global_logger = std_logger
 

Macro Definition Documentation

#define AVR_KIND_DECL

Function Documentation

static void _avr_io_command_write ( struct avr_t avr,
avr_io_addr_t  addr,
uint8_t  v,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void _avr_io_console_write ( struct avr_t avr,
avr_io_addr_t  addr,
uint8_t  v,
void *  param 
)
static

Here is the caller graph for this function:

static void std_logger ( avr_t avr,
const int  level,
const char *  format,
va_list  ap 
)
static

Here is the caller graph for this function:

Variable Documentation

avr_logger_p _avr_global_logger = std_logger
static