|
gem5
v19.0.0.0
|
#include <timer_a9global.hh>
Public Types | |
| enum | { CounterRegLow32 = 0x00, CounterRegHigh32 = 0x04, ControlReg = 0x08, IntStatusReg = 0x0C, CmpValRegLow32 = 0x10, CmpValRegHigh32 = 0x14, AutoIncrementReg = 0x18, Size = 0x1C } |
Public Member Functions | |
| BitUnion32 (CTRL) Bitfield< 0 > enable | |
| void | counterAtCmpVal () |
| Called when the counter reaches the comparator. More... | |
| void | restartCounter () |
| Restart the counter ticking. More... | |
| uint64_t | getTimeCounterFromTicks (Tick ticks) |
| Convert a number of ticks into the time counter format. More... | |
| Timer (std::string __name, A9GlobalTimer *parent, int int_num) | |
| 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 > | cmpEnable |
| Bitfield< 2 > | intEnable |
| Bitfield< 3 > | autoIncrement |
| Bitfield< 7, 4 > | reserved |
| Bitfield< 15, 8 > | prescalar |
| EndBitUnion(CTRL) protected A9GlobalTimer * | parent |
| Pointer to parent class. More... | |
| const uint32_t | intNum |
| Number of interrupt to cause/clear. 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... | |
| uint64_t | cmpVal |
| Value of the comparator. More... | |
| uint32_t | autoIncValue |
| Value to add to comparator when counter reaches comparator. More... | |
| EventWrapper< Timer, &Timer::counterAtCmpVal > | cmpValEvent |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
| static const std::string & | currentSection () |
| Get the fully-qualified name of the active section. More... | |
| static void | serializeAll (const std::string &cpt_dir) |
| static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
| static int | ckptCount = 0 |
| static int | ckptMaxCount = 0 |
| static int | ckptPrevCount = -1 |
Definition at line 58 of file timer_a9global.hh.
| anonymous enum |
| Enumerator | |
|---|---|
| CounterRegLow32 | |
| CounterRegHigh32 | |
| ControlReg | |
| IntStatusReg | |
| CmpValRegLow32 | |
| CmpValRegHigh32 | |
| AutoIncrementReg | |
| Size | |
Definition at line 65 of file timer_a9global.hh.
| A9GlobalTimer::Timer::Timer | ( | std::string | __name, |
| A9GlobalTimer * | parent, | ||
| int | int_num | ||
| ) |
Definition at line 58 of file timer_a9global.cc.
| A9GlobalTimer::Timer::BitUnion32 | ( | CTRL | ) |
| void A9GlobalTimer::Timer::counterAtCmpVal | ( | ) |
Called when the counter reaches the comparator.
Definition at line 233 of file timer_a9global.cc.
References autoIncValue, cmpVal, control, DPRINTF, A9GlobalTimer::gic, intNum, parent, pendingInt, rawInt, restartCounter(), and BaseGic::sendPPInt().
| uint64_t A9GlobalTimer::Timer::getTimeCounterFromTicks | ( | Tick | ticks | ) |
Convert a number of ticks into the time counter format.
| ticks | number of ticks |
Definition at line 82 of file timer_a9global.cc.
References Clocked::clockPeriod(), control, and parent.
Referenced by read().
|
inline |
Definition at line 129 of file timer_a9global.hh.
References read(), serialize(), unserialize(), and write().
Handle read for a single timer.
Definition at line 88 of file timer_a9global.cc.
References AutoIncrementReg, autoIncValue, Clocked::clockPeriod(), cmpValEvent, CmpValRegHigh32, CmpValRegLow32, control, ControlReg, CounterRegHigh32, CounterRegLow32, curTick(), DPRINTF, Packet::getLE(), getTimeCounterFromTicks(), IntStatusReg, panic, parent, rawInt, and Packet::setLE().
Referenced by name(), A9GlobalTimer::params(), and A9GlobalTimer::read().
| void A9GlobalTimer::Timer::restartCounter | ( | ) |
Restart the counter ticking.
Definition at line 212 of file timer_a9global.cc.
References Clocked::clockPeriod(), cmpVal, cmpValEvent, control, curTick(), EventManager::deschedule(), DPRINTF, parent, and EventManager::schedule().
Referenced by counterAtCmpVal(), and write().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 257 of file timer_a9global.cc.
References autoIncValue, cmpVal, cmpValEvent, control, DPRINTF, pendingInt, rawInt, and SERIALIZE_SCALAR.
Referenced by name(), A9GlobalTimer::params(), and A9GlobalTimer::serialize().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 280 of file timer_a9global.cc.
References autoIncValue, cmpVal, cmpValEvent, control, DPRINTF, parent, pendingInt, rawInt, EventManager::schedule(), and UNSERIALIZE_SCALAR.
Referenced by name(), A9GlobalTimer::params(), and A9GlobalTimer::unserialize().
Handle write for a single timer.
Definition at line 165 of file timer_a9global.cc.
References AutoIncrementReg, autoIncValue, BaseGic::clearInt(), cmpVal, CmpValRegHigh32, CmpValRegLow32, control, ControlReg, CounterRegHigh32, CounterRegLow32, DPRINTF, Packet::getLE(), A9GlobalTimer::gic, intNum, IntStatusReg, panic, parent, pendingInt, rawInt, restartCounter(), and ULL.
Referenced by name(), A9GlobalTimer::params(), and A9GlobalTimer::write().
| Bitfield<3> A9GlobalTimer::Timer::autoIncrement |
Definition at line 81 of file timer_a9global.hh.
| uint32_t A9GlobalTimer::Timer::autoIncValue |
Value to add to comparator when counter reaches comparator.
Definition at line 113 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), read(), serialize(), unserialize(), and write().
| Bitfield<1> A9GlobalTimer::Timer::cmpEnable |
Definition at line 79 of file timer_a9global.hh.
| uint64_t A9GlobalTimer::Timer::cmpVal |
Value of the comparator.
Definition at line 109 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), restartCounter(), serialize(), unserialize(), and write().
| EventWrapper<Timer, &Timer::counterAtCmpVal> A9GlobalTimer::Timer::cmpValEvent |
Definition at line 117 of file timer_a9global.hh.
Referenced by read(), restartCounter(), serialize(), and unserialize().
| CTRL A9GlobalTimer::Timer::control |
Control register as specified above.
Definition at line 97 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), getTimeCounterFromTicks(), read(), restartCounter(), serialize(), unserialize(), and write().
| Bitfield<2> A9GlobalTimer::Timer::intEnable |
Definition at line 80 of file timer_a9global.hh.
| const uint32_t A9GlobalTimer::Timer::intNum |
Number of interrupt to cause/clear.
Definition at line 93 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), and write().
| EndBitUnion (CTRL) protected A9GlobalTimer* A9GlobalTimer::Timer::parent |
Pointer to parent class.
Definition at line 84 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), getTimeCounterFromTicks(), read(), restartCounter(), unserialize(), and write().
| bool A9GlobalTimer::Timer::pendingInt |
If an interrupt is currently pending.
Logical and of CTRL.intEnable and rawInt
Definition at line 106 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), serialize(), unserialize(), and write().
| Bitfield<15,8> A9GlobalTimer::Timer::prescalar |
Definition at line 83 of file timer_a9global.hh.
| bool A9GlobalTimer::Timer::rawInt |
If timer has caused an interrupt.
This is irrespective of interrupt enable
Definition at line 102 of file timer_a9global.hh.
Referenced by counterAtCmpVal(), read(), serialize(), unserialize(), and write().
| Bitfield<7,4> A9GlobalTimer::Timer::reserved |
Definition at line 82 of file timer_a9global.hh.