SimAVR
AVR Simulator
tmp.c File Reference

Macros

#define REG_TOUCH(a, r)   (a)->trace_data->touched[(r) >> 5] |= (1 << ((r) & 0x1f))
 
#define REG_ISTOUCHED(a, r)   ((a)->trace_data->touched[(r) >> 5] & (1 << ((r) & 0x1f)))
 
#define STATE(_f, args...)
 
#define SREG()
 

Functions

static void _avr_set_r (avr_t *avr, uint16_t r, uint8_t v)
 

Macro Definition Documentation

#define REG_ISTOUCHED (   a,
 
)    ((a)->trace_data->touched[(r) >> 5] & (1 << ((r) & 0x1f)))
#define REG_TOUCH (   a,
 
)    (a)->trace_data->touched[(r) >> 5] |= (1 << ((r) & 0x1f))
#define SREG ( )
Value:
if (avr->trace && donttrace == 0) { \
printf("%04x: \t\t\t\t\t\t\t\t\tSREG = ", avr->pc); \
for (int _sbi = 0; _sbi < 8; _sbi++) \
printf("%c", \
avr->sreg[_sbi] ? toupper(_sreg_bit_name[_sbi]) : '.'); \
printf("\n"); \
}
avr_flashaddr_t pc
Current PC Note that the PC is representing /bytes/ while the AVR value is assumed to be "words"...
Definition: sim_avr.h:221
avr_t * avr
Definition: run_avr.c:54
uint8_t trace
DEBUG ONLY – value ignored if CONFIG_SIMAVR_TRACE = 0.
Definition: sim_avr.h:276
uint8_t sreg[8]
Mirror of the SREG register, to facilitate the access to bits in the opcode decoder.
Definition: sim_avr.h:207
const char * _sreg_bit_name
Definition: sim_core.c:40
#define STATE (   _f,
  args... 
)
Value:
{ \
if (avr->trace) { \
struct avr_trace_data_t *trace_data = avr->trace_data; \
if (trace_data->codeline && \
trace_data->codeline[avr->pc >> 1]) { \
const char * symbol = trace_data->codeline[avr->pc >> 1]->symbol; \
int dont = 0 && dont_trace(symbol); \
if (dont != donttrace) { \
donttrace = dont; \
} \
if (donttrace == 0) \
printf("%04x @%" PRI_avr_cycle_count ": %-25s " _f, \
avr->pc, avr->cycle, symbol, ## args); \
} else \
printf("%s: %04x @%" PRI_avr_cycle_count ": " _f, \
__FUNCTION__, avr->pc, avr->cycle, ## args); \
} \
}
#define PRI_avr_cycle_count
printf() conversion specifier for avr_cycle_count_t
Definition: sim_avr_types.h:53
struct avr_symbol_t ** codeline
Definition: sim_avr.h:104
avr_flashaddr_t pc
Current PC Note that the PC is representing /bytes/ while the AVR value is assumed to be "words"...
Definition: sim_avr.h:221
avr_t * avr
Definition: run_avr.c:54
struct avr_trace_data_t * trace_data
Only used if CONFIG_SIMAVR_TRACE is defined.
Definition: sim_avr.h:279
uint8_t trace
DEBUG ONLY – value ignored if CONFIG_SIMAVR_TRACE = 0.
Definition: sim_avr.h:276
avr_cycle_count_t cycle
current cycle
Definition: sim_avr.h:165
#define DUMP_REG()
Definition: sim_core.h:81
This is only ever used if CONFIG_SIMAVR_TRACE is defined.
Definition: sim_avr.h:102
const char symbol[0]
Definition: sim_avr.h:306

Function Documentation

static void _avr_set_r ( avr_t avr,
uint16_t  r,
uint8_t  v 
)
inlinestatic

Mark register as touched

Test if register is touched

This allows a "special case" to skip instruction tracing when in these symbols since printf() is useful to have, but generates a lot of cycles.

Print current instruction

Print Status Register

Here is the call graph for this function: