43 #define BREAK_POINT -2 44 #define INVALID_OPCODE -1 126 int DebugRecentJumps[20];
141 AvrDevice(
unsigned int ioSpaceSize,
unsigned int IRamSize,
unsigned int ERamSize,
unsigned int flashSize,
unsigned int pcSize = 2);
154 void RemoveFromCycleList(
Hardware *hw);
156 void Load(
const char* n);
160 void RegisterTerminationSymbol(
const char *symbol);
162 Pin *GetPin(
const char *name);
172 allPins.insert(std::pair<std::string, Pin*>(name, p));
176 void DeleteAllBreakpoints(
void);
179 const std::string &
GetFname(
void) {
return actualFilename; }
185 void SetDeviceNameAndSignature(
const std::string &name,
unsigned int signature);
199 unsigned char GetRWMem(
unsigned addr);
201 bool SetRWMem(
unsigned addr,
unsigned char val);
203 unsigned char GetCoreReg(
unsigned addr);
205 bool SetCoreReg(
unsigned addr,
unsigned char val);
207 unsigned char GetIOReg(
unsigned addr);
209 bool SetIOReg(
unsigned addr,
unsigned char val);
211 bool SetIORegBit(
unsigned addr,
unsigned bitaddr);
213 bool ClearIORegBit(
unsigned addr,
unsigned bitaddr);
216 unsigned GetRegX(
void);
218 unsigned GetRegY(
void);
220 unsigned GetRegZ(
void);
SystemClockOffset clockFreq
Period of a tick (1/F_OSC) in [ns].
DumpManager * dumpManager
Basic AVR device, contains the core functionality.
void ELFLoad(const AvrDevice *core)
unsigned int GetMemERamSize(void)
Get configured external RAM size.
bool flagEIJMPInstructions
EICALL and EIJMP instructions are available (only on some devices with bigger flash) ...
const unsigned int ioSpaceSize
const unsigned int eRamSize
AddressExtensionRegister * rampz
RAMPZ address extension register.
unsigned int GetMemIRamSize(void)
Get configured internal RAM size.
Pin class, handles input and output to external parts.
std::vector< Hardware * > hwResetList
unsigned int dataAddressMask
which bits in address are significant
bool flagJMPInstructions
CALL and JMP instructions are available (only on devices with bigger flash)
Holds AVR flash content and symbol informations.
bool flagTiny10
core is a tiny4/5/9/10, change used clocks on some instructions and disables instructions ...
std::string actualFilename
void RegisterPin(const std::string &name, Pin *p)
bool flagIJMPInstructions
ICALL and IJMP instructions are available (not on attiny1x devices)
bool flagLPMInstructions
LPM and SPM instructions are available (not on some tiny devices)
Implements a stack register with stack logic.
const std::string & GetDeviceName(void)
Return device name.
const unsigned int PC_size
HWSreg * status
the status register itself
int cpuCycles
Count of cycles before next instruction is executed (i.e. countdown)
static void Reset(void)
Reset DumpManager instance (e.g. delete available instance)
unsigned int GetDeviceSignature(void)
Return device signature.
Build a register for TraceValue's.
TraceValueCoreRegister coreTraceGroup
static const unsigned int registerSpaceSize
bool abortOnInvalidAccess
Flag, that simulation abort if an invalid access occured, default is false.
bool flagIWInstructions
ADIW and SBIW instructions are available (not on most tiny's!)
bool flagTiny1x
core is a tiny1x (but not tiny10!), change used clocks on some instructions and disables instructions...
bool flagMULInstructions
(F)MULxx instructions are available
RWMemoryMember ** invalidRW
hold invalid RW memory cells created by device
Member of any memory area in an AVR device.
unsigned int GetMemIOSize(void)
Get configured IO memory space size.
Data * data
a hack for symbol look-up
bool flagXMega
core is a XMEGA device, change used clocks on some instructions
long long SystemClockOffset
std::vector< Hardware * > hwCycleList
const std::string & GetFname(void)
Return filename from loaded program.
std::string devName
hold the device name, which this core simulate
std::map< std::string, Pin * > allPins
unsigned int GetMemTotalSize(void)
Get configured total memory space size.
unsigned int actualIrqVector
RWMemoryMember ** rw
The whole memory: R0-R31, IO, Internal RAM.
Pin v_supply
represents supply voltage level, needed for analog peripherals
bool deferIrq
Almost always false.
const unsigned int iRamSize
unsigned int GetMemRegisterSize(void)
Get configured register space size.
Provides the programming engine for flash self programming.
Pin v_bandgap
represents bandgap (ref) voltage level, needed for analog peripherals
unsigned int devSignature
hold the device signature for this core
RWSreg * statusRegister
the memory interface for status
Hold data memory block and symbol informations.
AddressExtensionRegister * eind
EIND address extension register.
FlashProgramming * spmRegister
bool flagMOVWInstruction
MOVW instruction is available.
static const unsigned int totalIoSpace
int DebugRecentJumpsIndex
Index to address of the most recent jump.
bool flagELPMInstructions
ELPM instructions are available (only on devices with bigger flash)