simulavr
1.1.0
|
AVRDevice class for ATTiny25/45/85. More...
#include <attiny25_45_85.h>
Public Member Functions | |
AvrDevice_attinyX5 (unsigned ram_bytes, unsigned flash_bytes, unsigned ee_bytes) | |
~AvrDevice_attinyX5 () | |
![]() | |
AvrDevice (unsigned int ioSpaceSize, unsigned int IRamSize, unsigned int ERamSize, unsigned int flashSize, unsigned int pcSize=2) | |
virtual | ~AvrDevice () |
void | AddToResetList (Hardware *hw) |
void | AddToCycleList (Hardware *hw) |
void | RemoveFromCycleList (Hardware *hw) |
Removes from the cycle list, if possible. More... | |
void | Load (const char *n) |
Load flash, eeprom, signature, fuses from elf file, wrapper for LoadBFD or LoadSimpleELF. More... | |
void | ReplaceIoRegister (unsigned int offset, RWMemoryMember *) |
bool | ReplaceMemRegister (unsigned int offset, RWMemoryMember *) |
RWMemoryMember * | GetMemRegisterInstance (unsigned int offset) |
void | RegisterTerminationSymbol (const char *symbol) |
Pin * | GetPin (const char *name) |
int | Step (bool &untilCoreStepFinished, SystemClockOffset *nextStepIn_ns=0) |
void | Reset () |
void | SetClockFreq (SystemClockOffset f) |
SystemClockOffset | GetClockFreq () |
void | RegisterPin (const std::string &name, Pin *p) |
void | DeleteAllBreakpoints (void) |
Clear all breakpoints in device. More... | |
const std::string & | GetFname (void) |
Return filename from loaded program. More... | |
const std::string & | GetDeviceName (void) |
Return device name. More... | |
unsigned int | GetDeviceSignature (void) |
Return device signature. More... | |
void | SetDeviceNameAndSignature (const std::string &name, unsigned int signature) |
Set device signature and name. More... | |
unsigned int | GetMemTotalSize (void) |
Get configured total memory space size. More... | |
unsigned int | GetMemIOSize (void) |
Get configured IO memory space size. More... | |
unsigned int | GetMemRegisterSize (void) |
Get configured register space size. More... | |
unsigned int | GetMemIRamSize (void) |
Get configured internal RAM size. More... | |
unsigned int | GetMemERamSize (void) |
Get configured external RAM size. More... | |
unsigned char | GetRWMem (unsigned addr) |
Get a value of RW memory cell. More... | |
bool | SetRWMem (unsigned addr, unsigned char val) |
Set a value to RW memory cell. More... | |
unsigned char | GetCoreReg (unsigned addr) |
Get a value from core register. More... | |
bool | SetCoreReg (unsigned addr, unsigned char val) |
Set a value to core register. More... | |
unsigned char | GetIOReg (unsigned addr) |
Get a value from IO register (without offset of 0x20!) More... | |
bool | SetIOReg (unsigned addr, unsigned char val) |
Set a value to IO register (without offset of 0x20!) More... | |
bool | SetIORegBit (unsigned addr, unsigned bitaddr) |
Set a bit value to lower IO register (without offset of 0x20!) More... | |
bool | ClearIORegBit (unsigned addr, unsigned bitaddr) |
Clear a bit value to lower IO register (without offset of 0x20!) More... | |
unsigned | GetRegX (void) |
Get value of X register (16bit) More... | |
unsigned | GetRegY (void) |
Get value of Y register (16bit) More... | |
unsigned | GetRegZ (void) |
Get value of Z register (16bit) More... | |
void | DebugOnJump () |
When a call/jump/cond-jump instruction was executed. For debugging. More... | |
![]() | |
virtual | ~SimulationMember () |
![]() | |
TraceValueRegister (TraceValueRegister *parent, const std::string &name) | |
Create a TraceValueRegister, with a scope prefix built on parent scope + name. More... | |
TraceValueRegister () | |
Create a TraceValueRegister, with a empty scope name, single device application. More... | |
virtual | ~TraceValueRegister () |
const std::string | GetTraceValuePrefix (void) |
Returns the scope prefix. More... | |
const std::string | GetScopeName (void) |
Returns the scope name. More... | |
void | RegisterTraceValue (TraceValue *t) |
Registers a TraceValue for this register. More... | |
void | UnregisterTraceValue (TraceValue *t) |
Unregisters a TraceValue, remove it from register. More... | |
TraceValueRegister * | GetScopeGroupByName (const std::string &name) |
Get a here registered TraceValueRegister by it's name. More... | |
virtual TraceValue * | GetTraceValueByName (const std::string &name) |
Get a here registered TraceValue by it's name. More... | |
TraceValueRegister * | FindScopeGroupByName (const std::string &name) |
Seek for a TraceValueRegister by it's name. More... | |
TraceValue * | FindTraceValueByName (const std::string &name) |
Seek for a TraceValue by it's name. More... | |
TraceSet * | GetAllTraceValues (void) |
Get all here registered TraceValue's only (not with descending values) More... | |
TraceSet * | GetAllTraceValuesRecursive (void) |
Get all here registered TraceValue's with descending values. More... | |
Public Attributes | |
HWPort | portb |
port B (only 6 bit) More... | |
GPIORegister * | gpior0_reg |
GPIOR0 Register. More... | |
GPIORegister * | gpior1_reg |
GPIOR1 Register. More... | |
GPIORegister * | gpior2_reg |
GPIOR2 Register. More... | |
ExternalIRQHandler * | extirq |
external interrupt support More... | |
IOSpecialReg * | gimsk_reg |
GIMSK IO register. More... | |
IOSpecialReg * | gifr_reg |
GIFR IO register. More... | |
IOSpecialReg * | mcucr_reg |
MCUCR IO register. More... | |
IOSpecialReg * | pcmsk_reg |
PCMSK IO register. More... | |
CLKPRRegister * | clkpr_reg |
CLKPR IO register. More... | |
OSCCALRegister * | osccal_reg |
OSCCAL IO register. More... | |
IOSpecialReg | gtccr_reg |
GTCCR IO register. More... | |
HWPrescaler | prescaler0 |
prescaler unit for timer 0 (10 bit w. reset/sync and only sys clock) More... | |
PrescalerMultiplexerExt | premux0 |
prescaler multiplexer for timer 0 More... | |
HWTimer8_2C * | timer0 |
timer 0 unit More... | |
TimerIRQRegister * | timer01irq |
timer interrupt unit for timer 0 and 1 More... | |
IOSpecialReg * | pllcsr_reg |
PLLCSR IO register. More... | |
HWTimerTinyX5 * | timer1 |
timer 1 unit More... | |
HWAdmux * | admux |
adc multiplexer unit More... | |
HWARef * | aref |
adc reference unit More... | |
HWAd * | ad |
adc unit More... | |
HWAcomp * | acomp |
analog compare unit More... | |
HWUSI_BR * | usi |
usi unit More... | |
![]() | |
int | trace_on |
Breakpoints | BP |
Exitpoints | EP |
unsigned int | PC |
unsigned int | cPC |
When mupti-cycle instruction is "processed" this holds its address, PC holds the next instruction. More... | |
const unsigned int | PC_size |
unsigned int | dataAddressMask |
which bits in address are significant More... | |
AvrFlash * | Flash |
FlashProgramming * | spmRegister |
AvrFuses * | fuses |
AvrLockBits * | lockbits |
HWEeprom * | eeprom |
Data * | data |
a hack for symbol look-up More... | |
HWIrqSystem * | irqSystem |
AddressExtensionRegister * | rampz |
RAMPZ address extension register. More... | |
AddressExtensionRegister * | eind |
EIND address extension register. More... | |
bool | abortOnInvalidAccess |
Flag, that simulation abort if an invalid access occured, default is false. More... | |
TraceValueCoreRegister | coreTraceGroup |
bool | deferIrq |
Almost always false. More... | |
unsigned int | newIrqPc |
unsigned int | actualIrqVector |
Pin | v_supply |
represents supply voltage level, needed for analog peripherals More... | |
Pin | v_bandgap |
represents bandgap (ref) voltage level, needed for analog peripherals More... | |
bool | flagIWInstructions |
ADIW and SBIW instructions are available (not on most tiny's!) More... | |
bool | flagJMPInstructions |
CALL and JMP instructions are available (only on devices with bigger flash) More... | |
bool | flagIJMPInstructions |
ICALL and IJMP instructions are available (not on attiny1x devices) More... | |
bool | flagEIJMPInstructions |
EICALL and EIJMP instructions are available (only on some devices with bigger flash) More... | |
bool | flagLPMInstructions |
LPM and SPM instructions are available (not on some tiny devices) More... | |
bool | flagELPMInstructions |
ELPM instructions are available (only on devices with bigger flash) More... | |
bool | flagMULInstructions |
(F)MULxx instructions are available More... | |
bool | flagMOVWInstruction |
MOVW instruction is available. More... | |
bool | flagTiny10 |
core is a tiny4/5/9/10, change used clocks on some instructions and disables instructions More... | |
bool | flagTiny1x |
core is a tiny1x (but not tiny10!), change used clocks on some instructions and disables instructions More... | |
bool | flagXMega |
core is a XMEGA device, change used clocks on some instructions More... | |
int | DebugRecentJumps [20] |
Addresses of last few 'call' and 'jump' executed. For debugging. More... | |
int | DebugRecentJumpsIndex |
Index to address of the most recent jump. More... | |
RWMemoryMember ** | rw |
The whole memory: R0-R31, IO, Internal RAM. More... | |
HWStack * | stack |
HWSreg * | status |
the status register itself More... | |
RWSreg * | statusRegister |
the memory interface for status More... | |
HWWado * | wado |
WDT timer. More... | |
std::vector< Hardware * > | hwResetList |
std::vector< Hardware * > | hwCycleList |
DumpManager * | dumpManager |
Additional Inherited Members | |
![]() | |
virtual size_t | _tvr_getValuesCount (void) |
Get the count of all TraceValues, that are registered here and descending. More... | |
virtual void | _tvr_insertTraceValuesToSet (TraceSet &t) |
Insert all TraceValues into TraceSet, that registered here and descending. More... | |
![]() | |
SystemClockOffset | clockFreq |
Period of a tick (1/F_OSC) in [ns]. More... | |
std::map< std::string, Pin * > | allPins |
std::string | actualFilename |
int | cpuCycles |
Count of cycles before next instruction is executed (i.e. countdown) More... | |
AVRDevice class for ATTiny25/45/85.
Definition at line 42 of file attiny25_45_85.h.
AvrDevice_attinyX5::AvrDevice_attinyX5 | ( | unsigned | ram_bytes, |
unsigned | flash_bytes, | ||
unsigned | ee_bytes | ||
) |
Creates the device for ATMega48/88/168/328
ram_bytes | how much SRAM does the device own |
flash_bytes | how much flash memory does the device own |
ee_bytes | how much EEPROM space does the device own |
Definition at line 70 of file attiny25_45_85.cpp.
References acomp, HWAcomp::acsr_reg, ad, HWAd::AD_T25, admux, aref, clkpr_reg, AvrDevice::coreTraceGroup, HWPort::ddr_reg, HWEeprom::DEVMODE_EXTENDED, HWTimerTinyX5::dt1a_reg, HWTimerTinyX5::dt1b_reg, HWTimerTinyX5::dtps1_reg, HWEeprom::eearh_reg, HWEeprom::eearl_reg, HWEeprom::eecr_reg, HWEeprom::eedr_reg, AvrDevice::eeprom, extirq, AvrDevice::flagJMPInstructions, AvrDevice::flagMULInstructions, AvrDevice::fuses, TimerIRQRegister::getLine(), HWPort::GetPin(), AvrDevice::GetPin(), gifr_reg, gimsk_reg, gpior0_reg, gpior1_reg, gpior2_reg, gtccr_reg, AvrDevice::irqSystem, mcucr_reg, HWTimer8::ocra_reg, HWTimer8::ocrb_reg, osccal_reg, OSCCALRegister::OSCCAL_V5, pcmsk_reg, HWPort::pin_reg, pllcsr_reg, HWPort::port_reg, portb, premux0, ExternalIRQHandler::registerIrq(), TimerIRQRegister::registerLine(), AvrDevice::Reset(), AvrDevice::rw, AvrFuses::SetFuseConfiguration(), BasicTimerUnit::SetTimerEventListener(), FlashProgramming::SPM_TINY_MODE, FlashProgramming::spmcr_reg, AvrDevice::spmRegister, AvrDevice::stack, AvrDevice::statusRegister, HWTimerTinyX5::tccr_reg, HWTimer8_2C::tccra_reg, HWTimer8_2C::tccrb_reg, HWTimer8::tcnt_reg, HWTimerTinyX5::tcnt_reg, TimerIRQRegister::tifr_reg, timer0, timer01irq, timer1, TimerIRQRegister::timsk_reg, HWTimerTinyX5::tocra_reg, HWTimerTinyX5::tocrb_reg, HWTimerTinyX5::tocrc_reg, usi, HWUSI_BR::usibr_reg, HWUSI::usicr_reg, HWUSI::usidr_reg, and HWUSI::usisr_reg.
AvrDevice_attinyX5::~AvrDevice_attinyX5 | ( | ) |
Definition at line 43 of file attiny25_45_85.cpp.
HWAcomp* AvrDevice_attinyX5::acomp |
analog compare unit
Definition at line 70 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
HWAd* AvrDevice_attinyX5::ad |
HWAdmux* AvrDevice_attinyX5::admux |
adc multiplexer unit
Definition at line 67 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
HWARef* AvrDevice_attinyX5::aref |
adc reference unit
Definition at line 68 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
CLKPRRegister* AvrDevice_attinyX5::clkpr_reg |
CLKPR IO register.
Definition at line 55 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
ExternalIRQHandler* AvrDevice_attinyX5::extirq |
external interrupt support
Definition at line 50 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
IOSpecialReg* AvrDevice_attinyX5::gifr_reg |
GIFR IO register.
Definition at line 52 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
IOSpecialReg* AvrDevice_attinyX5::gimsk_reg |
GIMSK IO register.
Definition at line 51 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
GPIORegister* AvrDevice_attinyX5::gpior0_reg |
GPIOR0 Register.
Definition at line 47 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
GPIORegister* AvrDevice_attinyX5::gpior1_reg |
GPIOR1 Register.
Definition at line 48 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
GPIORegister* AvrDevice_attinyX5::gpior2_reg |
GPIOR2 Register.
Definition at line 49 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
IOSpecialReg AvrDevice_attinyX5::gtccr_reg |
GTCCR IO register.
Definition at line 58 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
IOSpecialReg* AvrDevice_attinyX5::mcucr_reg |
MCUCR IO register.
Definition at line 53 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
OSCCALRegister* AvrDevice_attinyX5::osccal_reg |
OSCCAL IO register.
Definition at line 56 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
IOSpecialReg* AvrDevice_attinyX5::pcmsk_reg |
PCMSK IO register.
Definition at line 54 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
IOSpecialReg* AvrDevice_attinyX5::pllcsr_reg |
PLLCSR IO register.
Definition at line 64 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
HWPort AvrDevice_attinyX5::portb |
port B (only 6 bit)
Definition at line 45 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
PrescalerMultiplexerExt AvrDevice_attinyX5::premux0 |
prescaler multiplexer for timer 0
Definition at line 60 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
HWPrescaler AvrDevice_attinyX5::prescaler0 |
prescaler unit for timer 0 (10 bit w. reset/sync and only sys clock)
Definition at line 59 of file attiny25_45_85.h.
HWTimer8_2C* AvrDevice_attinyX5::timer0 |
TimerIRQRegister* AvrDevice_attinyX5::timer01irq |
timer interrupt unit for timer 0 and 1
Definition at line 62 of file attiny25_45_85.h.
Referenced by AvrDevice_attinyX5().
HWTimerTinyX5* AvrDevice_attinyX5::timer1 |
HWUSI_BR* AvrDevice_attinyX5::usi |