#include <irqsystem.h>
Public Member Functions | |
HWIrqSystem (AvrDevice *_core, int bytes_per_vector, int number_of_vectors) | |
unsigned int | GetNewPc (unsigned int &vector_index) |
returns a new PC pointer if interrupt occurred, -1 otherwise. | |
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. | |
void | DebugDumpTable () |
Protected Attributes | |
int | bytesPerVector |
int | vectorTableSize |
number of entries supported by the device, not bytes | |
HWSreg * | status |
std::vector< TraceValue * > | irqTrace |
std::map< unsigned int, Hardware * > | irqPartnerList |
priority queue of pending interrupts (i.e. waiting to be processed) | |
AvrDevice * | core |
IrqStatistic | irqStatistic |
std::vector< const Hardware * > | debugInterruptTable |
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.
void HWIrqSystem::ClearIrqFlag | ( | unsigned int | vector_index | ) |
Definition at line 246 of file irqsystem.cpp.
References core, IrqStatistic::entries, SystemClock::GetCurrentTime(), AvrDevice::GetFname(), SystemClock::Instance(), irqPartnerList, irqStatistic, AvrDevice::trace_on, and traceOut.
Referenced by HWUart::CheckForNewClearIrq(), HWUart::ClearIrqFlag(), TimerIRQRegister::ClearIrqFlag(), HWSpi::ClearIrqFlag(), HWPcir::ClearIrqFlag(), HWEeprom::ClearIrqFlag(), HWAd::ClearIrqFlag(), HWAcomp::ClearIrqFlag(), ExternalIRQHandler::ClearIrqFlag(), HWUart::GetUdr(), HWAcomp::SetAcsr(), HWAd::SetAdcsr(), and HWUart::SetUdr().
void HWIrqSystem::DebugDumpTable | ( | ) |
Definition at line 293 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 283 of file irqsystem.cpp.
References debugInterruptTable, and vectorTableSize.
Referenced by HWAcomp::HWAcomp(), HWAd::HWAd(), HWEeprom::HWEeprom(), HWSpi::HWSpi(), HWUart::HWUart(), 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 203 of file irqsystem.cpp.
References bytesPerVector, Hardware::ClearIrqFlag(), irqPartnerList, Hardware::IsLevelInterrupt(), Hardware::LevelInterruptPending(), and vectorTableSize.
Referenced by AvrDevice::Step().
void HWIrqSystem::IrqHandlerFinished | ( | unsigned int | vector_index | ) |
Definition at line 271 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 259 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::SetIrqFlag | ( | Hardware * | hwp, | |
unsigned int | vector_index | |||
) |
Definition at line 234 of file irqsystem.cpp.
References core, IrqStatistic::entries, SystemClock::GetCurrentTime(), AvrDevice::GetFname(), SystemClock::Instance(), irqPartnerList, irqStatistic, AvrDevice::trace_on, traceOut, and vectorTableSize.
Referenced by HWUart::CheckForNewSetIrq(), ExternalIRQHandler::ClearIrqFlag(), HWSpi::CpuCycle(), HWEeprom::CpuCycle(), HWAd::CpuCycle(), TimerIRQRegister::fireInterrupt(), ExternalIRQHandler::fireInterrupt(), HWAcomp::PinStateHasChanged(), TimerIRQRegister::set_from_reg(), ExternalIRQHandler::set_from_reg(), HWAcomp::SetAcsr(), HWAd::SetAdcsr(), and HWSpi::trxend().
int HWIrqSystem::bytesPerVector [protected] |
Definition at line 121 of file irqsystem.h.
Referenced by DebugDumpTable(), and GetNewPc().
AvrDevice* HWIrqSystem::core [protected] |
Definition at line 128 of file irqsystem.h.
Referenced by ClearIrqFlag(), IrqHandlerFinished(), IrqHandlerStarted(), and SetIrqFlag().
std::vector<const Hardware*> HWIrqSystem::debugInterruptTable [protected] |
Definition at line 130 of file irqsystem.h.
Referenced by DebugDumpTable(), and DebugVerifyInterruptVector().
std::map<unsigned int, Hardware *> HWIrqSystem::irqPartnerList [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().
IrqStatistic HWIrqSystem::irqStatistic [protected] |
Definition at line 129 of file irqsystem.h.
Referenced by ClearIrqFlag(), IrqHandlerFinished(), IrqHandlerStarted(), and SetIrqFlag().
std::vector<TraceValue*> HWIrqSystem::irqTrace [protected] |
Definition at line 124 of file irqsystem.h.
Referenced by HWIrqSystem(), IrqHandlerFinished(), and IrqHandlerStarted().
HWSreg* HWIrqSystem::status [protected] |
Definition at line 123 of file irqsystem.h.
int HWIrqSystem::vectorTableSize [protected] |
number of entries supported by the device, not bytes
Definition at line 122 of file irqsystem.h.
Referenced by DebugVerifyInterruptVector(), GetNewPc(), HWIrqSystem(), and SetIrqFlag().