|
gem5
|
Global system counter. More...
#include <generic_timer.hh>
Public Member Functions | |
| SystemCounter () | |
| uint64_t | value () const |
| Returns the current value of the physical counter. More... | |
| uint64_t | freq () const |
| Returns the counter frequency. More... | |
| void | setFreq (uint32_t freq) |
| Sets the counter frequency. More... | |
| Tick | period () const |
| Returns the counter period. More... | |
| void | setKernelControl (uint32_t val) |
| uint32_t | getKernelControl () |
| 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) |
Protected Attributes | |
| uint64_t | _freq |
| Counter frequency (as specified by CNTFRQ). More... | |
| Tick | _period |
| Cached copy of the counter period (inverse of the frequency). More... | |
| Tick | _resetTick |
| Tick when the counter was reset. More... | |
| uint32_t | _regCntkctl |
Private Member Functions | |
| SystemCounter (const SystemCounter &c) | |
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 |
Global system counter.
It is shared by the architected timers.
Definition at line 61 of file generic_timer.hh.
| SystemCounter::SystemCounter | ( | ) |
Definition at line 50 of file generic_timer.cc.
References setFreq().
|
private |
|
inline |
Returns the counter frequency.
Definition at line 85 of file generic_timer.hh.
References _freq.
Referenced by GenericTimerMem::ctrlRead(), GenericTimer::readMiscReg(), setFreq(), and GenericTimerMem::timerRead().
|
inline |
Definition at line 94 of file generic_timer.hh.
References _regCntkctl.
Referenced by GenericTimer::readMiscReg().
|
inline |
Returns the counter period.
Definition at line 91 of file generic_timer.hh.
References _period.
Referenced by ArchTimer::updateCounter().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 69 of file generic_timer.cc.
References _freq, _period, _regCntkctl, _resetTick, and SERIALIZE_SCALAR.
| void SystemCounter::setFreq | ( | uint32_t | freq | ) |
Sets the counter frequency.
| freq | frequency in Hz. |
Definition at line 57 of file generic_timer.cc.
References _freq, _period, _resetTick, curTick(), freq(), SimClock::Frequency, and warn_once.
Referenced by GenericTimer::setMiscReg(), and SystemCounter().
|
inline |
Definition at line 93 of file generic_timer.hh.
References _regCntkctl, and X86ISA::val.
Referenced by GenericTimer::setMiscReg().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 78 of file generic_timer.cc.
References _freq, _period, _regCntkctl, _resetTick, UNSERIALIZE_OPT_SCALAR, and UNSERIALIZE_SCALAR.
|
inline |
Returns the current value of the physical counter.
Definition at line 77 of file generic_timer.hh.
References _freq, _period, _resetTick, and curTick().
Referenced by ArchTimer::value().
|
protected |
Counter frequency (as specified by CNTFRQ).
Definition at line 65 of file generic_timer.hh.
Referenced by freq(), serialize(), setFreq(), unserialize(), and value().
|
protected |
Cached copy of the counter period (inverse of the frequency).
Definition at line 67 of file generic_timer.hh.
Referenced by period(), serialize(), setFreq(), unserialize(), and value().
|
protected |
Definition at line 71 of file generic_timer.hh.
Referenced by getKernelControl(), serialize(), setKernelControl(), and unserialize().
|
protected |
Tick when the counter was reset.
Definition at line 69 of file generic_timer.hh.
Referenced by serialize(), setFreq(), unserialize(), and value().