simulavr
1.1.0
|
#include <irqsystem.h>
Public Member Functions | |
HWIrqSystem (AvrDevice *_core, int bytes_per_vector, int number_of_vectors) | |
virtual | ~HWIrqSystem () |
bool | IsIrqPending () |
unsigned int | GetNewPc (unsigned int &vector_index) |
returns a new PC pointer if interrupt occurred, -1 otherwise. More... | |
void | SetIrqFlag (Hardware *, unsigned int vector_index) |
void | ClearIrqFlag (unsigned int vector_index) |
void | IrqHandlerStarted (unsigned int vector_index) |
void | IrqHandlerFinished (unsigned int vector_index) |
void | DebugVerifyInterruptVector (unsigned int vector_index, const Hardware *source) |
In datasheets RESET vector is index 1 but we use 0! And not a byte address. More... | |
void | DebugDumpTable () |
![]() | |
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... | |
Protected Attributes | |
int | bytesPerVector |
unsigned int | vectorTableSize |
number of entries supported by the device, not bytes More... | |
HWSreg * | status |
std::vector< TraceValue * > | irqTrace |
std::vector< Hardware * > | irqStack |
priority queue of pending interrupts (i.e. waiting to be processed) More... | |
unsigned int | irqStackSize |
AvrDevice * | core |
IrqStatistic | irqStatistic |
std::vector< const Hardware * > | debugInterruptTable |
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... | |
Definition at line 118 of file irqsystem.h.
HWIrqSystem::HWIrqSystem | ( | AvrDevice * | _core, |
int | bytes_per_vector, | ||
int | number_of_vectors | ||
) |
Definition at line 186 of file irqsystem.cpp.
References TraceValueRegister::GetTraceValuePrefix(), int2str(), irqTrace, TraceValueRegister::RegisterTraceValue(), TraceValue::set_written(), and vectorTableSize.
|
virtual |
Definition at line 205 of file irqsystem.cpp.
References irqTrace, TraceValueRegister::UnregisterTraceValue(), and vectorTableSize.
void HWIrqSystem::ClearIrqFlag | ( | unsigned int | vector_index | ) |
Definition at line 258 of file irqsystem.cpp.
References core, IrqStatistic::entries, SystemClock::GetCurrentTime(), AvrDevice::GetFname(), SystemClock::Instance(), irqStack, irqStackSize, irqStatistic, AvrDevice::trace_on, and traceOut.
Referenced by HWUart::CheckForNewClearIrq(), ExternalIRQHandler::ClearIrqFlag(), TimerIRQRegister::ClearIrqFlag(), HWEeprom::ClearIrqFlag(), HWAcomp::ClearIrqFlag(), HWSpi::ClearIrqFlag(), HWUart::ClearIrqFlag(), HWAd::ClearIrqFlag(), HWUart::GetUdr(), HWAcomp::SetAcsr(), HWAd::SetAdcsrA(), HWUart::SetUdr(), and HWUSI::SetUSISR().
void HWIrqSystem::DebugDumpTable | ( | ) |
Definition at line 307 of file irqsystem.cpp.
References avr_message, bytesPerVector, and debugInterruptTable.
void HWIrqSystem::DebugVerifyInterruptVector | ( | unsigned int | vector_index, |
const Hardware * | source | ||
) |
In datasheets RESET vector is index 1 but we use 0! And not a byte address.
Definition at line 297 of file irqsystem.cpp.
References debugInterruptTable, and vectorTableSize.
Referenced by HWAcomp::HWAcomp(), HWAd::HWAd(), HWEeprom::HWEeprom(), HWSpi::HWSpi(), HWUart::HWUart(), HWUSI::HWUSI(), ExternalIRQHandler::registerIrq(), and TimerIRQRegister::registerLine().
unsigned int HWIrqSystem::GetNewPc | ( | unsigned int & | vector_index | ) |
returns a new PC pointer if interrupt occurred, -1 otherwise.
Definition at line 216 of file irqsystem.cpp.
References bytesPerVector, Hardware::ClearIrqFlag(), irqStack, Hardware::IsLevelInterrupt(), Hardware::LevelInterruptPending(), and vectorTableSize.
Referenced by AvrDevice::Step().
void HWIrqSystem::IrqHandlerFinished | ( | unsigned int | vector_index | ) |
Definition at line 285 of file irqsystem.cpp.
References core, IrqStatistic::entries, SystemClock::GetCurrentTime(), AvrDevice::GetFname(), SystemClock::Instance(), irqStatistic, irqTrace, AvrDevice::trace_on, and traceOut.
Referenced by AvrDevice::Step().
void HWIrqSystem::IrqHandlerStarted | ( | unsigned int | vector_index | ) |
Definition at line 273 of file irqsystem.cpp.
References core, IrqStatistic::entries, SystemClock::GetCurrentTime(), AvrDevice::GetFname(), SystemClock::Instance(), irqStatistic, irqTrace, AvrDevice::trace_on, and traceOut.
Referenced by AvrDevice::Step().
bool HWIrqSystem::IsIrqPending | ( | ) |
Definition at line 212 of file irqsystem.cpp.
References irqStackSize.
Referenced by AvrDevice::Step().
void HWIrqSystem::SetIrqFlag | ( | Hardware * | hwp, |
unsigned int | vector_index | ||
) |
Definition at line 243 of file irqsystem.cpp.
References core, IrqStatistic::entries, SystemClock::GetCurrentTime(), AvrDevice::GetFname(), SystemClock::Instance(), irqStack, irqStackSize, irqStatistic, AvrDevice::trace_on, traceOut, and vectorTableSize.
Referenced by HWUart::CheckForNewSetIrq(), ExternalIRQHandler::ClearIrqFlag(), HWEeprom::CpuCycle(), HWSpi::CpuCycle(), HWAd::CpuCycle(), HWUSI::doCount(), ExternalIRQHandler::fireInterrupt(), TimerIRQRegister::fireInterrupt(), HWAcomp::PinStateHasChanged(), HWUSI::PinStateHasChanged(), ExternalIRQHandler::set_from_reg(), TimerIRQRegister::set_from_reg(), HWAcomp::SetAcsr(), HWAd::SetAdcsrA(), and HWSpi::trxend().
|
protected |
Definition at line 121 of file irqsystem.h.
Referenced by DebugDumpTable(), and GetNewPc().
|
protected |
Definition at line 129 of file irqsystem.h.
Referenced by ClearIrqFlag(), IrqHandlerFinished(), IrqHandlerStarted(), and SetIrqFlag().
|
protected |
Definition at line 131 of file irqsystem.h.
Referenced by DebugDumpTable(), and DebugVerifyInterruptVector().
|
protected |
priority queue of pending interrupts (i.e. waiting to be processed)
Definition at line 127 of file irqsystem.h.
Referenced by ClearIrqFlag(), GetNewPc(), and SetIrqFlag().
|
protected |
Definition at line 128 of file irqsystem.h.
Referenced by ClearIrqFlag(), IsIrqPending(), and SetIrqFlag().
|
protected |
Definition at line 130 of file irqsystem.h.
Referenced by ClearIrqFlag(), IrqHandlerFinished(), IrqHandlerStarted(), and SetIrqFlag().
|
protected |
Definition at line 124 of file irqsystem.h.
Referenced by HWIrqSystem(), IrqHandlerFinished(), IrqHandlerStarted(), and ~HWIrqSystem().
|
protected |
Definition at line 123 of file irqsystem.h.
|
protected |
number of entries supported by the device, not bytes
Definition at line 122 of file irqsystem.h.
Referenced by DebugVerifyInterruptVector(), GetNewPc(), HWIrqSystem(), SetIrqFlag(), and ~HWIrqSystem().