gem5
v20.1.0.0
|
#include <timer_sp804.hh>
Public Types | |
enum | { LoadReg = 0x00, CurrentReg = 0x04, ControlReg = 0x08, IntClear = 0x0C, RawISR = 0x10, MaskedISR = 0x14, BGLoad = 0x18, Size = 0x20 } |
Public Member Functions | |
BitUnion32 (CTRL) Bitfield< 0 > oneShot | |
void | counterAtZero () |
Called when the counter reaches 0. More... | |
void | restartCounter (uint32_t val) |
Restart the counter ticking at val. More... | |
Timer (std::string __name, Sp804 *parent, ArmInterruptPin *_interrupt, Tick clock) | |
std::string | name () const |
void | read (PacketPtr pkt, Addr daddr) |
Handle read for a single timer. More... | |
void | write (PacketPtr pkt, Addr daddr) |
Handle write for a single timer. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
Bitfield< 1 > | timerSize |
Bitfield< 3, 2 > | timerPrescale |
Bitfield< 5 > | intEnable |
Bitfield< 6 > | timerMode |
Bitfield< 7 > | timerEnable |
EndBitUnion(CTRL) protected Sp804 * | parent |
Pointer to parent class. More... | |
ArmInterruptPin *const | interrupt |
Pointer to the interrupt pin. More... | |
const Tick | clock |
Number of ticks in a clock input. More... | |
CTRL | control |
Control register as specified above. More... | |
bool | rawInt |
If timer has caused an interrupt. More... | |
bool | pendingInt |
If an interrupt is currently pending. More... | |
uint32_t | loadValue |
Value to load into counter when periodic mode reaches 0. More... | |
EventFunctionWrapper | zeroEvent |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Definition at line 53 of file timer_sp804.hh.
anonymous enum |
Enumerator | |
---|---|
LoadReg | |
CurrentReg | |
ControlReg | |
IntClear | |
RawISR | |
MaskedISR | |
BGLoad | |
Size |
Definition at line 57 of file timer_sp804.hh.
Sp804::Timer::Timer | ( | std::string | __name, |
Sp804 * | parent, | ||
ArmInterruptPin * | _interrupt, | ||
Tick | clock | ||
) |
Definition at line 55 of file timer_sp804.cc.
References counterAtZero().
Sp804::Timer::BitUnion32 | ( | CTRL | ) |
void Sp804::Timer::counterAtZero | ( | ) |
Called when the counter reaches 0.
Definition at line 197 of file timer_sp804.cc.
References DPRINTF.
Referenced by Timer().
|
inline |
Definition at line 115 of file timer_sp804.hh.
Handle read for a single timer.
Definition at line 85 of file timer_sp804.cc.
References curTick(), DPRINTF, Packet::getLE(), panic, power(), Packet::setLE(), and timerPrescale.
Referenced by Sp804::read().
void Sp804::Timer::restartCounter | ( | uint32_t | val | ) |
Restart the counter ticking at val.
val | the value to start at (pre-16 bit masking if en) |
Definition at line 176 of file timer_sp804.cc.
References bits(), curTick(), DPRINTF, power(), and X86ISA::val.
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 224 of file timer_sp804.cc.
References DPRINTF, and SERIALIZE_SCALAR.
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 246 of file timer_sp804.cc.
References DPRINTF, and UNSERIALIZE_SCALAR.
Handle write for a single timer.
Definition at line 139 of file timer_sp804.cc.
References DPRINTF, Packet::getLE(), and panic.
Referenced by Sp804::write().
const Tick Sp804::Timer::clock |
Number of ticks in a clock input.
Definition at line 87 of file timer_sp804.hh.
CTRL Sp804::Timer::control |
Control register as specified above.
Definition at line 90 of file timer_sp804.hh.
Bitfield<5> Sp804::Timer::intEnable |
Definition at line 72 of file timer_sp804.hh.
ArmInterruptPin* const Sp804::Timer::interrupt |
Pointer to the interrupt pin.
Definition at line 84 of file timer_sp804.hh.
uint32_t Sp804::Timer::loadValue |
Value to load into counter when periodic mode reaches 0.
Definition at line 101 of file timer_sp804.hh.
EndBitUnion (CTRL) protected Sp804* Sp804::Timer::parent |
Pointer to parent class.
Definition at line 75 of file timer_sp804.hh.
bool Sp804::Timer::pendingInt |
If an interrupt is currently pending.
Logical and of CTRL.intEnable and rawInt
Definition at line 98 of file timer_sp804.hh.
bool Sp804::Timer::rawInt |
If timer has caused an interrupt.
This is irrespective of interrupt enable
Definition at line 94 of file timer_sp804.hh.
Bitfield<7> Sp804::Timer::timerEnable |
Definition at line 74 of file timer_sp804.hh.
Bitfield<6> Sp804::Timer::timerMode |
Definition at line 73 of file timer_sp804.hh.
Bitfield<3,2> Sp804::Timer::timerPrescale |
Definition at line 71 of file timer_sp804.hh.
Referenced by read().
Bitfield<1> Sp804::Timer::timerSize |
Definition at line 70 of file timer_sp804.hh.
EventFunctionWrapper Sp804::Timer::zeroEvent |
Definition at line 105 of file timer_sp804.hh.