simulavr  1.1.0
HWIrqSystem Class Reference

#include <irqsystem.h>

Inheritance diagram for HWIrqSystem:

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 ()
 
- Public Member Functions inherited from TraceValueRegister
 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...
 
TraceValueRegisterGetScopeGroupByName (const std::string &name)
 Get a here registered TraceValueRegister by it's name. More...
 
virtual TraceValueGetTraceValueByName (const std::string &name)
 Get a here registered TraceValue by it's name. More...
 
TraceValueRegisterFindScopeGroupByName (const std::string &name)
 Seek for a TraceValueRegister by it's name. More...
 
TraceValueFindTraceValueByName (const std::string &name)
 Seek for a TraceValue by it's name. More...
 
TraceSetGetAllTraceValues (void)
 Get all here registered TraceValue's only (not with descending values) More...
 
TraceSetGetAllTraceValuesRecursive (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...
 
HWSregstatus
 
std::vector< TraceValue * > irqTrace
 
std::vector< Hardware * > irqStack
 priority queue of pending interrupts (i.e. waiting to be processed) More...
 
unsigned int irqStackSize
 
AvrDevicecore
 
IrqStatistic irqStatistic
 
std::vector< const Hardware * > debugInterruptTable
 

Additional Inherited Members

- Protected Member Functions inherited from TraceValueRegister
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...
 

Detailed Description

Definition at line 118 of file irqsystem.h.

Constructor & Destructor Documentation

◆ HWIrqSystem()

HWIrqSystem::HWIrqSystem ( AvrDevice _core,
int  bytes_per_vector,
int  number_of_vectors 
)

◆ ~HWIrqSystem()

HWIrqSystem::~HWIrqSystem ( )
virtual

Member Function Documentation

◆ ClearIrqFlag()

◆ DebugDumpTable()

void HWIrqSystem::DebugDumpTable ( )

Definition at line 307 of file irqsystem.cpp.

References avr_message, bytesPerVector, and debugInterruptTable.

◆ DebugVerifyInterruptVector()

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().

◆ GetNewPc()

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().

◆ IrqHandlerFinished()

void HWIrqSystem::IrqHandlerFinished ( unsigned int  vector_index)

◆ IrqHandlerStarted()

void HWIrqSystem::IrqHandlerStarted ( unsigned int  vector_index)

◆ IsIrqPending()

bool HWIrqSystem::IsIrqPending ( )

Definition at line 212 of file irqsystem.cpp.

References irqStackSize.

Referenced by AvrDevice::Step().

◆ SetIrqFlag()

Member Data Documentation

◆ bytesPerVector

int HWIrqSystem::bytesPerVector
protected

Definition at line 121 of file irqsystem.h.

Referenced by DebugDumpTable(), and GetNewPc().

◆ core

AvrDevice* HWIrqSystem::core
protected

Definition at line 129 of file irqsystem.h.

Referenced by ClearIrqFlag(), IrqHandlerFinished(), IrqHandlerStarted(), and SetIrqFlag().

◆ debugInterruptTable

std::vector<const Hardware*> HWIrqSystem::debugInterruptTable
protected

Definition at line 131 of file irqsystem.h.

Referenced by DebugDumpTable(), and DebugVerifyInterruptVector().

◆ irqStack

std::vector<Hardware*> HWIrqSystem::irqStack
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().

◆ irqStackSize

unsigned int HWIrqSystem::irqStackSize
protected

Definition at line 128 of file irqsystem.h.

Referenced by ClearIrqFlag(), IsIrqPending(), and SetIrqFlag().

◆ irqStatistic

IrqStatistic HWIrqSystem::irqStatistic
protected

Definition at line 130 of file irqsystem.h.

Referenced by ClearIrqFlag(), IrqHandlerFinished(), IrqHandlerStarted(), and SetIrqFlag().

◆ irqTrace

std::vector<TraceValue*> HWIrqSystem::irqTrace
protected

Definition at line 124 of file irqsystem.h.

Referenced by HWIrqSystem(), IrqHandlerFinished(), IrqHandlerStarted(), and ~HWIrqSystem().

◆ status

HWSreg* HWIrqSystem::status
protected

Definition at line 123 of file irqsystem.h.

◆ vectorTableSize

unsigned 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(), SetIrqFlag(), and ~HWIrqSystem().


The documentation for this class was generated from the following files: