Basic AVR device, contains the core functionality. More...
#include <avrdevice.h>
Public Member Functions | |
AvrDevice (unsigned int ioSpaceSize, unsigned int IRamSize, unsigned int ERamSize, unsigned int flashSize) | |
virtual | ~AvrDevice () |
void | AddToResetList (Hardware *hw) |
void | AddToCycleList (Hardware *hw) |
void | RemoveFromCycleList (Hardware *hw) |
Removes from the cycle list, if possible. | |
void | Load (const char *n) |
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. | |
const std::string & | GetFname (void) |
Return filename from loaded program. | |
unsigned int | GetMemTotalSize (void) |
Get configured total memory space size. | |
unsigned int | GetMemIOSize (void) |
Get configured IO memory space size. | |
unsigned int | GetMemRegisterSize (void) |
Get configured register space size. | |
unsigned int | GetMemIRamSize (void) |
Get configured internal RAM size. | |
unsigned int | GetMemERamSize (void) |
Get configured external RAM size. | |
unsigned char | GetRWMem (unsigned addr) |
Get a value of RW memory cell. | |
bool | SetRWMem (unsigned addr, unsigned char val) |
Set a value to RW memory cell. | |
unsigned char | GetCoreReg (unsigned addr) |
Get a value from core register. | |
bool | SetCoreReg (unsigned addr, unsigned char val) |
Set a value to core register. | |
unsigned char | GetIOReg (unsigned addr) |
Get a value from IO register (without offset of 0x20!). | |
bool | SetIOReg (unsigned addr, unsigned char val) |
Set a value to IO register (without offset of 0x20!). | |
bool | SetIORegBit (unsigned addr, unsigned bitaddr, bool val) |
Set a bit value to lower IO register (without offset of 0x20!). | |
unsigned | GetRegX (void) |
Get value of X register (16bit). | |
unsigned | GetRegY (void) |
Get value of Y register (16bit). | |
unsigned | GetRegZ (void) |
Get value of Z register (16bit). | |
void | DebugOnJump () |
When a call/jump/cond-jump instruction was executed. For debugging. | |
Public Attributes | |
int | trace_on |
Breakpoints | BP |
Exitpoints | EP |
word | PC |
word | cPC |
When mupti-cycle instruction is "processed" this holds its address, PC holds the next instruction. | |
int | PC_size |
AvrFlash * | Flash |
FlashProgramming * | spmRegister |
HWEeprom * | eeprom |
Data * | data |
a hack for symbol look-up | |
HWIrqSystem * | irqSystem |
AddressExtensionRegister * | rampz |
RAMPZ address extension register. | |
AddressExtensionRegister * | eind |
EIND address extension register. | |
bool | abortOnInvalidAccess |
Flag, that simulation abort if an invalid access occured, default is false. | |
TraceValueCoreRegister | coreTraceGroup |
bool | instructionSEIJustEnabledInterrupts |
Almost always false. | |
bool | flagIWInstructions |
ADIW and SBIW instructions are available (not on most tiny's!). | |
bool | flagJMPInstructions |
CALL and JMP instructions are available (only on devices with bigger flash). | |
bool | flagIJMPInstructions |
ICALL and IJMP instructions are available (not on attiny1x devices). | |
bool | flagEIJMPInstructions |
EICALL and EIJMP instructions are available (only on some devices with bigger flash). | |
bool | flagLPMInstructions |
LPM and SPM instructions are available (not on some tiny devices). | |
bool | flagELPMInstructions |
ELPM instructions are available (only on devices with bigger flash). | |
bool | flagMULInstructions |
(F)MULxx instructions are available | |
bool | flagMOVWInstruction |
MOVW instruction is available. | |
bool | flagTiny10 |
core is a tiny4/5/9/10, change used clocks on some instructions and disables instructions | |
bool | flagTiny1x |
core is a tiny1x (but not tiny10!), change used clocks on some instructions and disables instructions | |
bool | flagXMega |
core is a XMEGA device, change used clocks on some instructions | |
int | DebugRecentJumps [20] |
Addresses of last few 'call' and 'jump' executed. For debugging. | |
int | DebugRecentJumpsIndex |
Index to address of the most recent jump. | |
RWMemoryMember ** | rw |
The whole memory: R0-R31, IO, Internal RAM. | |
HWStack * | stack |
HWSreg * | status |
the status register itself | |
RWSreg * | statusRegister |
the memory interface for status | |
HWWado * | wado |
WDT timer. | |
std::vector< Hardware * > | hwResetList |
std::vector< Hardware * > | hwCycleList |
DumpManager * | dump_manager |
Protected Attributes | |
SystemClockOffset | clockFreq |
Period of a tick (1/F_OSC) in [ns]. | |
std::map< std::string, Pin * > | allPins |
std::string | actualFilename |
int | cpuCycles |
Count of cycles before next instruction is executed (i.e. countdown). | |
Private Attributes | |
RWMemoryMember ** | invalidRW |
hold invalid RW memory cells created by device | |
const unsigned int | ioSpaceSize |
const unsigned int | iRamSize |
const unsigned int | eRamSize |
Static Private Attributes | |
static const unsigned int | totalIoSpace = 0x10000 |
static const unsigned int | registerSpaceSize = 32 |
Basic AVR device, contains the core functionality.
Definition at line 56 of file avrdevice.h.
AvrDevice::AvrDevice | ( | unsigned int | ioSpaceSize, | |
unsigned int | IRamSize, | |||
unsigned int | ERamSize, | |||
unsigned int | flashSize | |||
) |
Definition at line 322 of file avrdevice.cpp.
References avr_error, coreTraceGroup, cPC, data, DebugRecentJumpsIndex, dump_manager, eind, Flash, TraceValueRegister::GetTraceValuePrefix(), DumpManager::Instance(), invalidRW, ioSpaceSize, rampz, DumpManager::registerAvrDevice(), registerSpaceSize, TraceValueRegister::RegisterTraceValue(), rw, spmRegister, status, statusRegister, totalIoSpace, trace_direct(), and trace_on.
AvrDevice::~AvrDevice | ( | ) | [virtual] |
Definition at line 280 of file avrdevice.cpp.
References data, dump_manager, eRamSize, Flash, invalidRW, ioSpaceSize, iRamSize, registerSpaceSize, rw, status, statusRegister, totalIoSpace, and DumpManager::unregisterAvrDevice().
void AvrDevice::AddToCycleList | ( | Hardware * | hw | ) |
Adds to the list of parts to cycle per clock tick. If already in that list, does nothing.
Definition at line 55 of file avrdevice.cpp.
References hwCycleList.
Referenced by FlashProgramming::FlashProgramming(), HWAd::HWAd(), HWPrescaler::HWPrescaler(), HWUart::HWUart(), HWWado::HWWado(), BasicTimerUnit::SetClockMode(), HWEeprom::SetEecr(), and HWSpi::SetSPCR().
void AvrDevice::AddToResetList | ( | Hardware * | hw | ) |
Adds to the list of parts to reset. If already in that list, does nothing.
Definition at line 50 of file avrdevice.cpp.
References hwResetList.
Referenced by Hardware::Hardware().
void AvrDevice::DebugOnJump | ( | ) |
When a call/jump/cond-jump instruction was executed. For debugging.
Definition at line 586 of file avrdevice.cpp.
References DebugRecentJumps, DebugRecentJumpsIndex, and PC.
Referenced by avr_op_SBRS::operator()(), avr_op_SBRC::operator()(), avr_op_SBIS::operator()(), avr_op_SBIC::operator()(), avr_op_RJMP::operator()(), avr_op_RCALL::operator()(), avr_op_JMP::operator()(), avr_op_IJMP::operator()(), avr_op_ICALL::operator()(), avr_op_EIJMP::operator()(), avr_op_EICALL::operator()(), avr_op_CPSE::operator()(), avr_op_CALL::operator()(), avr_op_BRBS::operator()(), and avr_op_BRBC::operator()().
void AvrDevice::DeleteAllBreakpoints | ( | void | ) |
Clear all breakpoints in device.
Definition at line 553 of file avrdevice.cpp.
References BP.
Referenced by GdbServer::InternalStep().
SystemClockOffset AvrDevice::GetClockFreq | ( | ) |
Definition at line 269 of file avrdevice.cpp.
References clockFreq.
Referenced by GdbServer::Step().
unsigned char AvrDevice::GetCoreReg | ( | unsigned | addr | ) |
Get a value from core register.
Definition at line 608 of file avrdevice.cpp.
References registerSpaceSize, and rw.
Referenced by GdbServer::gdb_read_register(), GdbServer::gdb_read_registers(), ThreadList::OnCall(), avr_op_SWAP::operator()(), avr_op_SUBI::operator()(), avr_op_SUB::operator()(), avr_op_ST_Z_incr::operator()(), avr_op_ST_Z_decr::operator()(), avr_op_ST_Y_incr::operator()(), avr_op_ST_Y_decr::operator()(), avr_op_ST_X_incr::operator()(), avr_op_ST_X_decr::operator()(), avr_op_ST_X::operator()(), avr_op_STS::operator()(), avr_op_STD_Z::operator()(), avr_op_STD_Y::operator()(), avr_op_SPM::operator()(), avr_op_SBRS::operator()(), avr_op_SBRC::operator()(), avr_op_SBIW::operator()(), avr_op_SBCI::operator()(), avr_op_SBC::operator()(), avr_op_ROR::operator()(), avr_op_PUSH::operator()(), avr_op_OUT::operator()(), avr_op_ORI::operator()(), avr_op_OR::operator()(), avr_op_NEG::operator()(), avr_op_MULSU::operator()(), avr_op_MULS::operator()(), avr_op_MUL::operator()(), avr_op_MOVW::operator()(), avr_op_MOV::operator()(), avr_op_LSR::operator()(), avr_op_INC::operator()(), avr_op_FMULSU::operator()(), avr_op_FMULS::operator()(), avr_op_FMUL::operator()(), avr_op_ESPM::operator()(), avr_op_EOR::operator()(), avr_op_DEC::operator()(), avr_op_CPSE::operator()(), avr_op_CPI::operator()(), avr_op_CPC::operator()(), avr_op_CP::operator()(), avr_op_COM::operator()(), avr_op_BST::operator()(), avr_op_BLD::operator()(), avr_op_ASR::operator()(), avr_op_ANDI::operator()(), avr_op_AND::operator()(), avr_op_ADIW::operator()(), avr_op_ADD::operator()(), and avr_op_ADC::operator()().
const std::string& AvrDevice::GetFname | ( | void | ) | [inline] |
Return filename from loaded program.
Definition at line 157 of file avrdevice.h.
References actualFilename.
Referenced by HWIrqSystem::ClearIrqFlag(), HWIrqSystem::IrqHandlerFinished(), HWIrqSystem::IrqHandlerStarted(), operator<<(), and HWIrqSystem::SetIrqFlag().
unsigned char AvrDevice::GetIOReg | ( | unsigned | addr | ) |
Get a value from IO register (without offset of 0x20!).
Definition at line 619 of file avrdevice.cpp.
References ioSpaceSize, registerSpaceSize, and rw.
Referenced by avr_op_SBIS::operator()(), avr_op_SBIC::operator()(), and avr_op_IN::operator()().
unsigned int AvrDevice::GetMemERamSize | ( | void | ) | [inline] |
unsigned int AvrDevice::GetMemIOSize | ( | void | ) | [inline] |
Get configured IO memory space size.
Definition at line 162 of file avrdevice.h.
References ioSpaceSize.
Referenced by HWStackSram::Reset().
unsigned int AvrDevice::GetMemIRamSize | ( | void | ) | [inline] |
Get configured internal RAM size.
Definition at line 166 of file avrdevice.h.
References iRamSize.
Referenced by HWStackSram::Reset().
RWMemoryMember * AvrDevice::GetMemRegisterInstance | ( | unsigned int | offset | ) |
Definition at line 571 of file avrdevice.cpp.
References rw, and totalIoSpace.
unsigned int AvrDevice::GetMemRegisterSize | ( | void | ) | [inline] |
Get configured register space size.
Definition at line 164 of file avrdevice.h.
References registerSpaceSize.
Referenced by HWStackSram::Reset().
unsigned int AvrDevice::GetMemTotalSize | ( | void | ) | [inline] |
Get configured total memory space size.
Definition at line 160 of file avrdevice.h.
References totalIoSpace.
Referenced by GetRWMem(), and SetRWMem().
Pin * AvrDevice::GetPin | ( | const char * | name | ) |
Definition at line 273 of file avrdevice.cpp.
References allPins, and avr_error.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), and AvrDevice_attiny2313::AvrDevice_attiny2313().
unsigned AvrDevice::GetRegX | ( | void | ) |
Get value of X register (16bit).
Definition at line 641 of file avrdevice.cpp.
References rw.
Referenced by avr_op_ST_X_incr::operator()(), avr_op_ST_X_decr::operator()(), avr_op_ST_X::operator()(), avr_op_LD_X_incr::operator()(), avr_op_LD_X_decr::operator()(), and avr_op_LD_X::operator()().
unsigned AvrDevice::GetRegY | ( | void | ) |
Get value of Y register (16bit).
Definition at line 646 of file avrdevice.cpp.
References rw.
Referenced by avr_op_ST_Y_incr::operator()(), avr_op_ST_Y_decr::operator()(), avr_op_STD_Y::operator()(), avr_op_LD_Y_incr::operator()(), avr_op_LD_Y_decr::operator()(), and avr_op_LDD_Y::operator()().
unsigned AvrDevice::GetRegZ | ( | void | ) |
Get value of Z register (16bit).
Definition at line 651 of file avrdevice.cpp.
References rw.
Referenced by avr_op_ST_Z_incr::operator()(), avr_op_ST_Z_decr::operator()(), avr_op_STD_Z::operator()(), avr_op_SPM::operator()(), avr_op_LPM_Z_incr::operator()(), avr_op_LPM::operator()(), avr_op_LPM_Z::operator()(), avr_op_LD_Z_decr::operator()(), avr_op_LD_Z_incr::operator()(), avr_op_LDD_Z::operator()(), avr_op_IJMP::operator()(), avr_op_ICALL::operator()(), avr_op_ESPM::operator()(), avr_op_ELPM::operator()(), avr_op_ELPM_Z_incr::operator()(), avr_op_ELPM_Z::operator()(), avr_op_EIJMP::operator()(), avr_op_EICALL::operator()(), avr_op_LPM_Z_incr::Trace(), avr_op_LPM::Trace(), avr_op_LPM_Z::Trace(), avr_op_ELPM::Trace(), avr_op_ELPM_Z_incr::Trace(), and avr_op_ELPM_Z::Trace().
unsigned char AvrDevice::GetRWMem | ( | unsigned | addr | ) |
Get a value of RW memory cell.
Definition at line 595 of file avrdevice.cpp.
References GetMemTotalSize(), and rw.
Referenced by GdbServer::gdb_read_memory(), avr_op_LD_Z_decr::operator()(), avr_op_LD_Z_incr::operator()(), avr_op_LD_Y_incr::operator()(), avr_op_LD_Y_decr::operator()(), avr_op_LD_X_incr::operator()(), avr_op_LD_X_decr::operator()(), avr_op_LD_X::operator()(), avr_op_LDS::operator()(), avr_op_LDD_Z::operator()(), avr_op_LDD_Y::operator()(), and HWStackSram::Pop().
void AvrDevice::Load | ( | const char * | n | ) |
Definition at line 117 of file avrdevice.cpp.
References actualFilename, Memory::AddSymbol(), avr_error, avr_warning, data, eeprom, Flash, HWEeprom::WriteMem(), and AvrFlash::WriteMem().
Referenced by avr_create_tf(), and main().
void AvrDevice::RegisterPin | ( | const std::string & | name, | |
Pin * | p | |||
) | [inline] |
Definition at line 149 of file avrdevice.h.
References allPins.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), and HWPort::HWPort().
void AvrDevice::RegisterTerminationSymbol | ( | const char * | symbol | ) |
Definition at line 577 of file avrdevice.cpp.
References EP, Flash, and Memory::GetAddressAtSymbol().
Referenced by main().
void AvrDevice::RemoveFromCycleList | ( | Hardware * | hw | ) |
Removes from the cycle list, if possible.
Does nothing if the part is not in the cycle list.
Definition at line 60 of file avrdevice.cpp.
References hwCycleList.
Referenced by HWEeprom::CpuCycle(), BasicTimerUnit::SetClockMode(), and HWSpi::SetSPCR().
void AvrDevice::ReplaceIoRegister | ( | unsigned int | offset, | |
RWMemoryMember * | newMember | |||
) |
Definition at line 557 of file avrdevice.cpp.
References avr_error, ioSpaceSize, registerSpaceSize, and rw.
Referenced by main().
bool AvrDevice::ReplaceMemRegister | ( | unsigned int | offset, | |
RWMemoryMember * | newMember | |||
) |
Definition at line 563 of file avrdevice.cpp.
References rw, and totalIoSpace.
void AvrDevice::Reset | ( | ) |
Definition at line 538 of file avrdevice.cpp.
References cPC, cpuCycles, hwResetList, PC, PC_size, and status.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), HWWado::CpuCycle(), GdbServer::gdb_get_signal(), and GdbServer::InternalStep().
void AvrDevice::SetClockFreq | ( | SystemClockOffset | f | ) |
Definition at line 265 of file avrdevice.cpp.
References clockFreq.
Referenced by main().
bool AvrDevice::SetCoreReg | ( | unsigned | addr, | |
unsigned char | val | |||
) |
Set a value to core register.
Definition at line 613 of file avrdevice.cpp.
References registerSpaceSize, and rw.
Referenced by GdbServer::gdb_write_register(), GdbServer::gdb_write_registers(), avr_op_SWAP::operator()(), avr_op_SUBI::operator()(), avr_op_SUB::operator()(), avr_op_ST_Z_incr::operator()(), avr_op_ST_Z_decr::operator()(), avr_op_ST_Y_incr::operator()(), avr_op_ST_Y_decr::operator()(), avr_op_ST_X_incr::operator()(), avr_op_ST_X_decr::operator()(), avr_op_SBIW::operator()(), avr_op_SBCI::operator()(), avr_op_SBC::operator()(), avr_op_ROR::operator()(), avr_op_POP::operator()(), avr_op_ORI::operator()(), avr_op_OR::operator()(), avr_op_NEG::operator()(), avr_op_MULSU::operator()(), avr_op_MULS::operator()(), avr_op_MUL::operator()(), avr_op_MOVW::operator()(), avr_op_MOV::operator()(), avr_op_LSR::operator()(), avr_op_LPM_Z_incr::operator()(), avr_op_LPM::operator()(), avr_op_LPM_Z::operator()(), avr_op_LD_Z_decr::operator()(), avr_op_LD_Z_incr::operator()(), avr_op_LD_Y_incr::operator()(), avr_op_LD_Y_decr::operator()(), avr_op_LD_X_incr::operator()(), avr_op_LD_X_decr::operator()(), avr_op_LD_X::operator()(), avr_op_LDS::operator()(), avr_op_LDI::operator()(), avr_op_LDD_Z::operator()(), avr_op_LDD_Y::operator()(), avr_op_INC::operator()(), avr_op_IN::operator()(), avr_op_FMULSU::operator()(), avr_op_FMULS::operator()(), avr_op_FMUL::operator()(), avr_op_ESPM::operator()(), avr_op_EOR::operator()(), avr_op_ELPM::operator()(), avr_op_ELPM_Z_incr::operator()(), avr_op_ELPM_Z::operator()(), avr_op_DEC::operator()(), avr_op_COM::operator()(), avr_op_BLD::operator()(), avr_op_ASR::operator()(), avr_op_ANDI::operator()(), avr_op_AND::operator()(), avr_op_ADIW::operator()(), avr_op_ADD::operator()(), and avr_op_ADC::operator()().
bool AvrDevice::SetIOReg | ( | unsigned | addr, | |
unsigned char | val | |||
) |
Set a value to IO register (without offset of 0x20!).
Definition at line 624 of file avrdevice.cpp.
References ioSpaceSize, registerSpaceSize, and rw.
Referenced by avr_op_OUT::operator()().
bool AvrDevice::SetIORegBit | ( | unsigned | addr, | |
unsigned | bitaddr, | |||
bool | val | |||
) |
Set a bit value to lower IO register (without offset of 0x20!).
Definition at line 630 of file avrdevice.cpp.
References registerSpaceSize, and rw.
Referenced by avr_op_SBI::operator()(), and avr_op_CBI::operator()().
bool AvrDevice::SetRWMem | ( | unsigned | addr, | |
unsigned char | val | |||
) |
Set a value to RW memory cell.
Definition at line 601 of file avrdevice.cpp.
References GetMemTotalSize(), and rw.
Referenced by GdbServer::gdb_write_memory(), avr_op_ST_Z_incr::operator()(), avr_op_ST_Z_decr::operator()(), avr_op_ST_Y_incr::operator()(), avr_op_ST_Y_decr::operator()(), avr_op_ST_X_incr::operator()(), avr_op_ST_X_decr::operator()(), avr_op_ST_X::operator()(), avr_op_STS::operator()(), avr_op_STD_Z::operator()(), avr_op_STD_Y::operator()(), and HWStackSram::Push().
int AvrDevice::Step | ( | bool & | untilCoreStepFinished, | |
SystemClockOffset * | nextStepIn_ns = 0 | |||
) | [virtual] |
Steps the AVR core.
untilCoreStepFinished | iff true, steps a core step and not a single clock cycle. |
Implements SimulationMember.
Definition at line 433 of file avrdevice.cpp.
References actualFilename, avr_error, BP, BREAK_POINT, clockFreq, cPC, Hardware::CpuCycle(), cpuCycles, DumpManager::cycle(), dump_manager, EP, Flash, AvrFlash::GetInstruction(), HWIrqSystem::GetNewPc(), Memory::GetSize(), HWStack::GetStackPointer(), Memory::GetSymbolAtAddress(), global_verbose_on, hwCycleList, HWSreg_bool::I, SystemClock::Instance(), instructionSEIJustEnabledInterrupts, HWIrqSystem::IrqHandlerFinished(), HWIrqSystem::IrqHandlerStarted(), irqSystem, PC, HWStack::PushAddr(), HWStack::SetReturnPoint(), stack, status, statusRegister, SystemClock::stop(), sysConHandler, DecodedInstruction::Trace(), trace_on, SystemConsoleHandler::TraceNextLine(), traceOut, and RWSreg::trigger_change().
Referenced by GdbServer::InternalStep(), and GdbServer::Step().
Flag, that simulation abort if an invalid access occured, default is false.
Definition at line 89 of file avrdevice.h.
Referenced by InvalidMem::get(), and InvalidMem::set().
std::string AvrDevice::actualFilename [protected] |
Definition at line 69 of file avrdevice.h.
Referenced by GetFname(), Load(), and Step().
std::map< std::string, Pin *> AvrDevice::allPins [protected] |
Definition at line 68 of file avrdevice.h.
Referenced by GetPin(), and RegisterPin().
Definition at line 76 of file avrdevice.h.
Referenced by GdbServer::avr_core_insert_breakpoint(), GdbServer::avr_core_remove_breakpoint(), DeleteAllBreakpoints(), and Step().
SystemClockOffset AvrDevice::clockFreq [protected] |
Period of a tick (1/F_OSC) in [ns].
Definition at line 67 of file avrdevice.h.
Referenced by GetClockFreq(), SetClockFreq(), and Step().
Definition at line 90 of file avrdevice.h.
Referenced by AvrDevice(), AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWPrescaler::HWPrescaler().
When mupti-cycle instruction is "processed" this holds its address, PC holds the next instruction.
Definition at line 80 of file avrdevice.h.
Referenced by AvrDevice(), Reset(), and Step().
int AvrDevice::cpuCycles [protected] |
Count of cycles before next instruction is executed (i.e. countdown).
Definition at line 72 of file avrdevice.h.
a hack for symbol look-up
Definition at line 85 of file avrdevice.h.
Referenced by AvrDevice(), Load(), and ~AvrDevice().
int AvrDevice::DebugRecentJumps[20] |
Addresses of last few 'call' and 'jump' executed. For debugging.
Definition at line 104 of file avrdevice.h.
Referenced by DebugOnJump().
Index to address of the most recent jump.
Definition at line 105 of file avrdevice.h.
Referenced by AvrDevice(), and DebugOnJump().
Definition at line 117 of file avrdevice.h.
Referenced by AvrDevice(), Step(), and ~AvrDevice().
Definition at line 84 of file avrdevice.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), GdbServer::gdb_read_memory(), GdbServer::gdb_write_memory(), Load(), AvrDevice_at90s4433::~AvrDevice_at90s4433(), AvrDevice_at90s8515::~AvrDevice_at90s8515(), AvrDevice_atmega128::~AvrDevice_atmega128(), AvrDevice_atmega1284Abase::~AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::~AvrDevice_atmega16_32(), AvrDevice_atmega668base::~AvrDevice_atmega668base(), AvrDevice_atmega8::~AvrDevice_atmega8(), and AvrDevice_attiny2313::~AvrDevice_attiny2313().
EIND address extension register.
Definition at line 88 of file avrdevice.h.
Referenced by AvrDevice(), avr_op_EIJMP::operator()(), and avr_op_EICALL::operator()().
Definition at line 77 of file avrdevice.h.
Referenced by RegisterTerminationSymbol(), and Step().
const unsigned int AvrDevice::eRamSize [private] |
Definition at line 64 of file avrdevice.h.
Referenced by GetMemERamSize(), and ~AvrDevice().
EICALL and EIJMP instructions are available (only on some devices with bigger flash).
Definition at line 96 of file avrdevice.h.
Referenced by lookup_opcode().
ELPM instructions are available (only on devices with bigger flash).
Definition at line 98 of file avrdevice.h.
Referenced by AvrDevice_atmega128::AvrDevice_atmega128(), and lookup_opcode().
ICALL and IJMP instructions are available (not on attiny1x devices).
Definition at line 95 of file avrdevice.h.
Referenced by lookup_opcode().
ADIW and SBIW instructions are available (not on most tiny's!).
Definition at line 93 of file avrdevice.h.
Referenced by lookup_opcode().
CALL and JMP instructions are available (only on devices with bigger flash).
Definition at line 94 of file avrdevice.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and lookup_opcode().
LPM and SPM instructions are available (not on some tiny devices).
Definition at line 97 of file avrdevice.h.
Referenced by lookup_opcode().
MOVW instruction is available.
Definition at line 100 of file avrdevice.h.
Referenced by AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), and lookup_opcode().
(F)MULxx instructions are available
Definition at line 99 of file avrdevice.h.
Referenced by AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and lookup_opcode().
core is a tiny4/5/9/10, change used clocks on some instructions and disables instructions
Definition at line 101 of file avrdevice.h.
Referenced by lookup_opcode(), avr_op_ST_Z_incr::operator()(), avr_op_ST_Y_incr::operator()(), avr_op_ST_X_incr::operator()(), avr_op_ST_X::operator()(), avr_op_STD_Z::operator()(), avr_op_STD_Y::operator()(), avr_op_SBI::operator()(), avr_op_RCALL::operator()(), avr_op_LD_Z_decr::operator()(), avr_op_LD_Y_decr::operator()(), avr_op_LD_X_decr::operator()(), avr_op_LD_X::operator()(), avr_op_LDD_Z::operator()(), avr_op_LDD_Y::operator()(), and avr_op_CBI::operator()().
core is a tiny1x (but not tiny10!), change used clocks on some instructions and disables instructions
Definition at line 102 of file avrdevice.h.
Referenced by lookup_opcode().
bool AvrDevice::flagXMega |
core is a XMEGA device, change used clocks on some instructions
Definition at line 103 of file avrdevice.h.
Referenced by avr_op_ST_Z_incr::operator()(), avr_op_ST_Y_incr::operator()(), avr_op_ST_X_incr::operator()(), avr_op_ST_X::operator()(), avr_op_STD_Z::operator()(), avr_op_STD_Y::operator()(), avr_op_SBIS::operator()(), avr_op_SBIC::operator()(), avr_op_SBI::operator()(), avr_op_RCALL::operator()(), avr_op_PUSH::operator()(), avr_op_LD_Z_incr::operator()(), avr_op_LD_Y_incr::operator()(), avr_op_LD_X_incr::operator()(), avr_op_LD_X::operator()(), avr_op_LDD_Z::operator()(), avr_op_LDD_Y::operator()(), avr_op_ICALL::operator()(), avr_op_EICALL::operator()(), avr_op_CBI::operator()(), and avr_op_CALL::operator()().
Definition at line 82 of file avrdevice.h.
Referenced by GdbServer::avr_core_flash_read(), GdbServer::avr_core_flash_write(), GdbServer::avr_core_flash_write_hi8(), GdbServer::avr_core_flash_write_lo8(), AvrDevice(), GdbServer::gdb_break_point(), GdbServer::gdb_parse_packet(), Load(), ThreadList::OnSPWrite(), avr_op_ILLEGAL::operator()(), avr_op_STS::operator()(), avr_op_SBRS::operator()(), avr_op_SBRC::operator()(), avr_op_SBIS::operator()(), avr_op_SBIC::operator()(), avr_op_RJMP::operator()(), avr_op_RCALL::operator()(), avr_op_LPM_Z_incr::operator()(), avr_op_LPM::operator()(), avr_op_LPM_Z::operator()(), avr_op_LDS::operator()(), avr_op_JMP::operator()(), avr_op_ELPM::operator()(), avr_op_ELPM_Z_incr::operator()(), avr_op_ELPM_Z::operator()(), avr_op_CPSE::operator()(), avr_op_CALL::operator()(), RegisterTerminationSymbol(), FlashProgramming::SetRWWLock(), HWSpi::SetSPSR(), FlashProgramming::SPM_action(), Step(), avr_op_STS::Trace(), avr_op_LPM_Z_incr::Trace(), avr_op_LPM::Trace(), avr_op_LPM_Z::Trace(), avr_op_LDS::Trace(), avr_op_JMP::Trace(), avr_op_CALL::Trace(), avr_op_BRBS::Trace(), avr_op_BRBC::Trace(), and ~AvrDevice().
std::vector<Hardware *> AvrDevice::hwCycleList |
Definition at line 115 of file avrdevice.h.
Referenced by AddToCycleList(), RemoveFromCycleList(), and Step().
std::vector<Hardware *> AvrDevice::hwResetList |
Definition at line 114 of file avrdevice.h.
Referenced by AddToResetList(), and Reset().
Almost always false.
Definition at line 91 of file avrdevice.h.
Referenced by avr_op_BSET::operator()(), and Step().
RWMemoryMember** AvrDevice::invalidRW [private] |
hold invalid RW memory cells created by device
Definition at line 59 of file avrdevice.h.
Referenced by AvrDevice(), and ~AvrDevice().
const unsigned int AvrDevice::ioSpaceSize [private] |
Definition at line 60 of file avrdevice.h.
Referenced by AvrDevice(), GetIOReg(), GetMemIOSize(), ReplaceIoRegister(), SetIOReg(), and ~AvrDevice().
const unsigned int AvrDevice::iRamSize [private] |
Definition at line 63 of file avrdevice.h.
Referenced by GetMemIRamSize(), and ~AvrDevice().
Definition at line 86 of file avrdevice.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), Step(), AvrDevice_at90s4433::~AvrDevice_at90s4433(), AvrDevice_at90s8515::~AvrDevice_at90s8515(), AvrDevice_atmega128::~AvrDevice_atmega128(), AvrDevice_atmega1284Abase::~AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::~AvrDevice_atmega16_32(), AvrDevice_atmega668base::~AvrDevice_atmega668base(), AvrDevice_atmega8::~AvrDevice_atmega8(), and AvrDevice_attiny2313::~AvrDevice_attiny2313().
Next/current instruction index. Multiply by 2 to get an address. This will not be enough for ATmega2560
Definition at line 78 of file avrdevice.h.
Referenced by DebugOnJump(), GdbServer::gdb_read_register(), GdbServer::gdb_read_registers(), GdbServer::gdb_write_register(), GdbServer::gdb_write_registers(), InvalidMem::get(), WarnUnknown::markReadUnknown(), ThreadList::OnCall(), ThreadList::OnPop(), ThreadList::OnSPWrite(), avr_op_ILLEGAL::operator()(), avr_op_STS::operator()(), avr_op_SBRS::operator()(), avr_op_SBRC::operator()(), avr_op_SBIS::operator()(), avr_op_SBIC::operator()(), avr_op_RJMP::operator()(), avr_op_RETI::operator()(), avr_op_RET::operator()(), avr_op_RCALL::operator()(), avr_op_LDS::operator()(), avr_op_JMP::operator()(), avr_op_IJMP::operator()(), avr_op_ICALL::operator()(), avr_op_EIJMP::operator()(), avr_op_EICALL::operator()(), avr_op_CPSE::operator()(), avr_op_CALL::operator()(), avr_op_BRBS::operator()(), avr_op_BRBC::operator()(), Reset(), GdbServer::SendPosition(), InvalidMem::set(), HWSpi::SetSPSR(), FlashProgramming::SPM_action(), Step(), avr_op_STS::Trace(), avr_op_RJMP::Trace(), avr_op_RCALL::Trace(), avr_op_LDS::Trace(), avr_op_JMP::Trace(), avr_op_CALL::Trace(), avr_op_BRBS::Trace(), and avr_op_BRBC::Trace().
Definition at line 81 of file avrdevice.h.
Referenced by avr_op_RETI::operator()(), avr_op_RET::operator()(), avr_op_RCALL::operator()(), avr_op_ICALL::operator()(), avr_op_CALL::operator()(), HWStackSram::PopAddr(), HWStackSram::PushAddr(), and Reset().
RAMPZ address extension register.
Definition at line 87 of file avrdevice.h.
Referenced by AvrDevice(), AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega128::AvrDevice_atmega128(), avr_op_SPM::operator()(), avr_op_ESPM::operator()(), avr_op_ELPM::operator()(), avr_op_ELPM_Z_incr::operator()(), avr_op_ELPM_Z::operator()(), avr_op_ELPM::Trace(), avr_op_ELPM_Z_incr::Trace(), avr_op_ELPM_Z::Trace(), and AvrDevice_atmega128::~AvrDevice_atmega128().
const unsigned int AvrDevice::registerSpaceSize = 32 [static, private] |
Definition at line 62 of file avrdevice.h.
Referenced by AvrDevice(), GetCoreReg(), GetIOReg(), GetMemRegisterSize(), ReplaceIoRegister(), SetCoreReg(), SetIOReg(), SetIORegBit(), and ~AvrDevice().
The whole memory: R0-R31, IO, Internal RAM.
Definition at line 107 of file avrdevice.h.
Referenced by AvrDevice(), AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), GetCoreReg(), GetIOReg(), GetMemRegisterInstance(), GetRegX(), GetRegY(), GetRegZ(), GetRWMem(), ReplaceIoRegister(), ReplaceMemRegister(), SetCoreReg(), SetIOReg(), SetIORegBit(), SetRWMem(), and ~AvrDevice().
Definition at line 83 of file avrdevice.h.
Referenced by AvrDevice(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), avr_op_SPM::operator()(), avr_op_ESPM::operator()(), AvrDevice_atmega16_32::~AvrDevice_atmega16_32(), AvrDevice_atmega8::~AvrDevice_atmega8(), and AvrDevice_attiny2313::~AvrDevice_attiny2313().
Definition at line 109 of file avrdevice.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), GdbServer::gdb_get_thread_list(), GdbServer::gdb_is_thread_alive(), GdbServer::gdb_parse_packet(), GdbServer::gdb_read_register(), GdbServer::gdb_read_registers(), GdbServer::gdb_write_register(), GdbServer::gdb_write_registers(), ThreadList::OnCall(), avr_op_RETI::operator()(), avr_op_RET::operator()(), avr_op_RCALL::operator()(), avr_op_PUSH::operator()(), avr_op_POP::operator()(), avr_op_ICALL::operator()(), avr_op_EICALL::operator()(), avr_op_CALL::operator()(), GdbServer::SendPosition(), Step(), AvrDevice_at90s4433::~AvrDevice_at90s4433(), AvrDevice_at90s8515::~AvrDevice_at90s8515(), AvrDevice_atmega128::~AvrDevice_atmega128(), AvrDevice_atmega1284Abase::~AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::~AvrDevice_atmega16_32(), AvrDevice_atmega668base::~AvrDevice_atmega668base(), AvrDevice_atmega8::~AvrDevice_atmega8(), and AvrDevice_attiny2313::~AvrDevice_attiny2313().
the status register itself
Definition at line 110 of file avrdevice.h.
Referenced by AvrDevice(), GdbServer::gdb_read_register(), GdbServer::gdb_read_registers(), GdbServer::gdb_write_register(), GdbServer::gdb_write_registers(), Reset(), GdbServer::SendPosition(), Step(), and ~AvrDevice().
the memory interface for status
Definition at line 111 of file avrdevice.h.
Referenced by AvrDevice(), AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), AvrDevice_attiny2313::AvrDevice_attiny2313(), Step(), and ~AvrDevice().
const unsigned int AvrDevice::totalIoSpace = 0x10000 [static, private] |
Definition at line 61 of file avrdevice.h.
Referenced by AvrDevice(), GetMemRegisterInstance(), GetMemTotalSize(), ReplaceMemRegister(), and ~AvrDevice().
Definition at line 75 of file avrdevice.h.
Referenced by AvrDevice(), HWIrqSystem::ClearIrqFlag(), HWSpi::CpuCycle(), HWEeprom::CpuCycle(), HWAd::CpuCycle(), HWIrqSystem::IrqHandlerFinished(), HWIrqSystem::IrqHandlerStarted(), main(), HWStackSram::Pop(), HWStackSram::Push(), HWEeprom::SetEearh(), HWEeprom::SetEearl(), HWEeprom::SetEecr(), HWEeprom::SetEedr(), HWIrqSystem::SetIrqFlag(), HWStackSram::SetSph(), HWStackSram::SetSpl(), HWSpi::SetSPSR(), SystemClock::SetTraceModeForAllMembers(), Step(), and HWSpi::trxend().
WDT timer.
Definition at line 112 of file avrdevice.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), avr_op_WDR::operator()(), AvrDevice_at90s4433::~AvrDevice_at90s4433(), AvrDevice_at90s8515::~AvrDevice_at90s8515(), AvrDevice_atmega128::~AvrDevice_atmega128(), AvrDevice_atmega1284Abase::~AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::~AvrDevice_atmega16_32(), AvrDevice_atmega668base::~AvrDevice_atmega668base(), and AvrDevice_atmega8::~AvrDevice_atmega8().