|
gem5
v19.0.0.0
|
Per-CPU architected timer. More...
#include <generic_timer.hh>
Public Member Functions | |
| ArchTimer (const std::string &name, SimObject &parent, SystemCounter &sysctr, ArmInterruptPin *interrupt) | |
| std::string | name () const |
| Returns the timer name. More... | |
| uint64_t | compareValue () const |
| Returns the CompareValue view of the timer. More... | |
| void | setCompareValue (uint64_t val) |
| Sets the CompareValue view of the timer. More... | |
| uint32_t | timerValue () const |
| Returns the TimerValue view of the timer. More... | |
| void | setTimerValue (uint32_t val) |
| Sets the TimerValue view of the timer. More... | |
| uint32_t | control () const |
| Sets the control register. More... | |
| void | setControl (uint32_t val) |
| uint64_t | offset () const |
| void | setOffset (uint64_t val) |
| uint64_t | value () const |
| Returns the value of the counter which this timer relies on. More... | |
| void | serialize (CheckpointOut &cp) const override |
| Serialize an object. More... | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. More... | |
| DrainState | drain () override |
| Notify an object that it needs to drain its state. More... | |
| void | drainResume () override |
| Resume execution after a successful drain. 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 Member Functions inherited from Drainable | |
| DrainState | drainState () const |
| Return the current drain state of an object. More... | |
| virtual void | notifyFork () |
| Notify a child process of a fork. More... | |
Protected Member Functions | |
| BitUnion32 (ArchTimerCtrl) Bitfield< 0 > enable | |
| Control register. More... | |
| void | updateCounter () |
| Timer settings or the offset has changed, re-evaluate trigger condition and raise interrupt if necessary. More... | |
| void | counterLimitReached () |
| Called when the upcounter reaches the programmed value. More... | |
| virtual bool | scheduleEvents () |
Protected Member Functions inherited from Drainable | |
| Drainable () | |
| virtual | ~Drainable () |
| void | signalDrainDone () const |
| Signal that an object is drained. More... | |
Protected Attributes | |
| Bitfield< 1 > | imask |
| Bitfield< 2 > | istatus |
| EndBitUnion(ArchTimerCtrl) const std SimObject & | _parent |
| Name of this timer. More... | |
| SystemCounter & | _systemCounter |
| ArmInterruptPin *const | _interrupt |
| ArchTimerCtrl | _control |
| Value of the control register ({CNTP/CNTHP/CNTV}_CTL). More... | |
| uint64_t | _counterLimit |
| Programmed limit value for the upcounter ({CNTP/CNTHP/CNTV}_CVAL). More... | |
| uint64_t | _offset |
| Offset relative to the physical timer (CNTVOFF) More... | |
| EventFunctionWrapper | _counterLimitReachedEvent |
Private Member Functions | |
| ArchTimer (const ArchTimer &t) | |
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 |
Per-CPU architected timer.
Definition at line 118 of file generic_timer.hh.
| ArchTimer::ArchTimer | ( | const std::string & | name, |
| SimObject & | parent, | ||
| SystemCounter & | sysctr, | ||
| ArmInterruptPin * | interrupt | ||
| ) |
Definition at line 106 of file generic_timer.cc.
References counterLimitReached(), and name().
|
private |
|
protected |
Control register.
|
inline |
Returns the CompareValue view of the timer.
Definition at line 167 of file generic_timer.hh.
References X86ISA::val.
Referenced by GenericTimer::readMiscReg(), GenericTimerMem::timerRead(), and GenericTimerMem::timerWrite().
|
inline |
Sets the control register.
Definition at line 177 of file generic_timer.hh.
Referenced by GenericTimer::readMiscReg(), and GenericTimerMem::timerRead().
|
protected |
Called when the upcounter reaches the programmed value.
Definition at line 118 of file generic_timer.cc.
References _control, _interrupt, DPRINTF, ArmInterruptPin::raise(), and scheduleEvents().
Referenced by ArchTimer(), and updateCounter().
|
overridevirtual |
Notify an object that it needs to drain its state.
If the object does not need further simulation to drain internal buffers, it returns DrainState::Drained and automatically switches to the Drained state. If the object needs more simulation, it returns DrainState::Draining and automatically enters the Draining state. Other return values are invalid.
Implements Drainable.
Definition at line 220 of file generic_timer.cc.
References _counterLimitReachedEvent, _parent, EventManager::deschedule(), Drained, and Event::scheduled().
|
overridevirtual |
Resume execution after a successful drain.
Reimplemented from Drainable.
Definition at line 229 of file generic_timer.cc.
References updateCounter().
|
inline |
|
inline |
Definition at line 180 of file generic_timer.hh.
References SystemCounter::serialize(), ArmISA::t, SystemCounter::unserialize(), and SystemCounter::value().
Referenced by GenericTimerMem::ctrlRead(), GenericTimerMem::ctrlWrite(), GenericTimer::readMiscReg(), and GenericTimerMem::timerRead().
|
inlineprotectedvirtual |
Reimplemented in ArchTimerKvm.
Definition at line 155 of file generic_timer.hh.
References name().
Referenced by counterLimitReached(), and updateCounter().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 198 of file generic_timer.cc.
References _control, _counterLimit, _offset, paramOut(), and SERIALIZE_SCALAR.
| void ArchTimer::setCompareValue | ( | uint64_t | val | ) |
Sets the CompareValue view of the timer.
Definition at line 154 of file generic_timer.cc.
References _counterLimit, updateCounter(), and X86ISA::val.
Referenced by GenericTimer::setMiscReg(), setTimerValue(), and GenericTimerMem::timerWrite().
| void ArchTimer::setControl | ( | uint32_t | val | ) |
Definition at line 167 of file generic_timer.cc.
References _control, _counterLimit, DPRINTF, X86ISA::val, and value().
Referenced by GenericTimer::setMiscReg(), and GenericTimerMem::timerWrite().
| void ArchTimer::setOffset | ( | uint64_t | val | ) |
Definition at line 185 of file generic_timer.cc.
References _offset, updateCounter(), and X86ISA::val.
Referenced by GenericTimerMem::ctrlWrite(), and GenericTimer::setMiscReg().
| void ArchTimer::setTimerValue | ( | uint32_t | val | ) |
Sets the TimerValue view of the timer.
Definition at line 161 of file generic_timer.cc.
References setCompareValue(), and value().
Referenced by GenericTimer::setMiscReg(), and GenericTimerMem::timerWrite().
|
inline |
Returns the TimerValue view of the timer.
Definition at line 172 of file generic_timer.hh.
References SystemCounter::value().
Referenced by GenericTimer::readMiscReg(), and GenericTimerMem::timerRead().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 206 of file generic_timer.cc.
References _control, _offset, paramIn(), and UNSERIALIZE_OPT_SCALAR.
|
protected |
Timer settings or the offset has changed, re-evaluate trigger condition and raise interrupt if necessary.
Definition at line 137 of file generic_timer.cc.
References _control, _counterLimit, _counterLimitReachedEvent, _parent, _systemCounter, counterLimitReached(), curTick(), EventManager::deschedule(), SystemCounter::period(), EventManager::schedule(), Event::scheduled(), scheduleEvents(), and value().
Referenced by drainResume(), setCompareValue(), and setOffset().
| uint64_t ArchTimer::value | ( | ) | const |
Returns the value of the counter which this timer relies on.
Definition at line 192 of file generic_timer.cc.
References _offset, _systemCounter, and SystemCounter::value().
Referenced by GenericTimer::readMiscReg(), setControl(), setTimerValue(), GenericTimerMem::timerRead(), and updateCounter().
|
protected |
Value of the control register ({CNTP/CNTHP/CNTV}_CTL).
Definition at line 139 of file generic_timer.hh.
Referenced by counterLimitReached(), serialize(), setControl(), unserialize(), and updateCounter().
|
protected |
Programmed limit value for the upcounter ({CNTP/CNTHP/CNTV}_CVAL).
Definition at line 141 of file generic_timer.hh.
Referenced by serialize(), setCompareValue(), setControl(), and updateCounter().
|
protected |
Definition at line 153 of file generic_timer.hh.
Referenced by drain(), and updateCounter().
|
protected |
Definition at line 136 of file generic_timer.hh.
Referenced by counterLimitReached().
|
protected |
Offset relative to the physical timer (CNTVOFF)
Definition at line 143 of file generic_timer.hh.
Referenced by serialize(), setOffset(), unserialize(), and value().
|
protected |
Name of this timer.
Pointer to parent class.
Definition at line 126 of file generic_timer.hh.
Referenced by drain(), and updateCounter().
|
protected |
Definition at line 134 of file generic_timer.hh.
Referenced by updateCounter(), and value().
|
protected |
Definition at line 124 of file generic_timer.hh.
|
protected |
Definition at line 125 of file generic_timer.hh.