gem5 v24.0.0.0
|
#include <generic_timer.hh>
Public Member Functions | |
GenericTimerFrame (const GenericTimerFrameParams &p) | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
bool | hasVirtualTimer () const |
Indicates if this frame implements a virtual timer. | |
uint64_t | getVirtOffset () const |
Returns the virtual offset for this frame if a virtual timer is implemented. | |
void | setVirtOffset (uint64_t new_offset) |
Sets the virtual offset for this frame's virtual timer after a write to CNTVOFF. | |
bool | hasEl0View () const |
Indicates if this frame implements a second EL0 view. | |
uint8_t | getAccessBits () const |
Returns the access bits for this frame. | |
void | setAccessBits (uint8_t data) |
Updates the access bits after a write to CNTCTLBase.CNTACR. | |
bool | hasNonSecureAccess () const |
Indicates if non-secure accesses are allowed to this frame. | |
void | setNonSecureAccess () |
Allows non-secure accesses after an enabling write to CNTCTLBase.CNTNSAR. | |
bool | hasReadableVoff () const |
Indicates if CNTVOFF is readable for this frame. | |
Public Member Functions inherited from gem5::PioDevice | |
PioDevice (const Params &p) | |
virtual | ~PioDevice () |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. | |
Public Member Functions inherited from gem5::ClockedObject | |
ClockedObject (const ClockedObjectParams &p) | |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Member Functions inherited from gem5::Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Protected Member Functions | |
AddrRangeList | getAddrRanges () const override |
Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to. | |
Tick | read (PacketPtr pkt) override |
Pure virtual function that the device must implement. | |
Tick | write (PacketPtr pkt) override |
Pure virtual function that the device must implement. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Protected Member Functions inherited from gem5::Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. | |
void | resetClock () const |
Reset the object's clock using the current global tick value. | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. | |
Private Member Functions | |
uint64_t | timerRead (Addr addr, size_t size, bool is_sec, bool to_el0) const |
CNTBase/CNTEL0Base (Memory-mapped timer frame) | |
void | timerWrite (Addr addr, size_t size, uint64_t data, bool is_sec, bool to_el0) |
BitUnion8 (AccessBits) Bitfield< 5 > rwpt | |
Reports access properties of the CNTBase register frame elements. | |
EndBitUnion (AccessBits) AccessBits accessBits | |
BitUnion16 (AccessBitsEl0) Bitfield< 9 > pten | |
EndBitUnion (AccessBitsEl0) AccessBitsEl0 accessBitsEl0 | |
Private Attributes | |
const AddrRange | timerRange |
AddrRange | timerEl0Range |
AddrRangeList | addrRanges |
All MMIO ranges GenericTimerFrame responds to. | |
SystemCounter & | systemCounter |
System counter reference. | |
ArchTimer | physTimer |
Physical and virtual timers. | |
ArchTimer | virtTimer |
Bitfield< 4 > | rwvt |
Bitfield< 3 > | rvoff |
Bitfield< 2 > | rfrq |
Bitfield< 1 > | rvct |
Bitfield< 0 > | rpct |
Bitfield< 8 > | vten |
Bitfield< 1 > | vcten |
Bitfield< 0 > | pcten |
bool | nonSecureAccess |
Reports whether non-secure accesses are allowed to this frame. | |
ArmSystem & | system |
Static Private Attributes | |
static const Addr | TIMER_CNTPCT_LO = 0x00 |
static const Addr | TIMER_CNTPCT_HI = 0x04 |
static const Addr | TIMER_CNTVCT_LO = 0x08 |
static const Addr | TIMER_CNTVCT_HI = 0x0c |
static const Addr | TIMER_CNTFRQ = 0x10 |
static const Addr | TIMER_CNTEL0ACR = 0x14 |
static const Addr | TIMER_CNTVOFF_LO = 0x18 |
static const Addr | TIMER_CNTVOFF_HI = 0x1c |
static const Addr | TIMER_CNTP_CVAL_LO = 0x20 |
static const Addr | TIMER_CNTP_CVAL_HI = 0x24 |
static const Addr | TIMER_CNTP_TVAL = 0x28 |
static const Addr | TIMER_CNTP_CTL = 0x2c |
static const Addr | TIMER_CNTV_CVAL_LO = 0x30 |
static const Addr | TIMER_CNTV_CVAL_HI = 0x34 |
static const Addr | TIMER_CNTV_TVAL = 0x38 |
static const Addr | TIMER_CNTV_CTL = 0x3c |
Additional Inherited Members | |
Public Types inherited from gem5::PioDevice | |
using | Params = PioDeviceParams |
Public Types inherited from gem5::ClockedObject | |
using | Params = ClockedObjectParams |
Parameters of ClockedObject. | |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Public Attributes inherited from gem5::ClockedObject | |
PowerState * | powerState |
Protected Attributes inherited from gem5::PioDevice | |
System * | sys |
PioPort< PioDevice > | pioPort |
The pioPort that handles the requests for us and provides us requests that it sees. | |
Protected Attributes inherited from gem5::SimObject | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
Protected Attributes inherited from gem5::EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Definition at line 413 of file generic_timer.hh.
gem5::GenericTimerFrame::GenericTimerFrame | ( | const GenericTimerFrameParams & | p | ) |
Definition at line 980 of file generic_timer.cc.
References timerRange.
|
private |
|
private |
Reports access properties of the CNTBase register frame elements.
|
private |
|
private |
uint8_t gem5::GenericTimerFrame::getAccessBits | ( | ) | const |
Returns the access bits for this frame.
Definition at line 1047 of file generic_timer.cc.
|
overrideprotectedvirtual |
Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to.
Implements gem5::PioDevice.
Definition at line 1077 of file generic_timer.cc.
References addrRanges.
uint64_t gem5::GenericTimerFrame::getVirtOffset | ( | ) | const |
Returns the virtual offset for this frame if a virtual timer is implemented.
Definition at line 1029 of file generic_timer.cc.
References gem5::ArchTimer::offset(), and virtTimer.
bool gem5::GenericTimerFrame::hasEl0View | ( | ) | const |
Indicates if this frame implements a second EL0 view.
Definition at line 1041 of file generic_timer.cc.
References timerEl0Range, and gem5::AddrRange::valid().
Referenced by read(), serialize(), timerRead(), timerWrite(), unserialize(), and write().
bool gem5::GenericTimerFrame::hasNonSecureAccess | ( | ) | const |
Indicates if non-secure accesses are allowed to this frame.
Definition at line 1059 of file generic_timer.cc.
References nonSecureAccess.
bool gem5::GenericTimerFrame::hasReadableVoff | ( | ) | const |
Indicates if CNTVOFF is readable for this frame.
Definition at line 1071 of file generic_timer.cc.
bool gem5::GenericTimerFrame::hasVirtualTimer | ( | ) | const |
Indicates if this frame implements a virtual timer.
Pure virtual function that the device must implement.
Called when a read command is recieved by the port.
pkt | Packet describing this request |
Implements gem5::PioDevice.
Definition at line 1083 of file generic_timer.cc.
References gem5::X86ISA::addr, gem5::AddrRange::contains(), DPRINTF, gem5::Packet::getAddr(), gem5::Packet::getSize(), hasEl0View(), gem5::Packet::isSecure(), gem5::Packet::makeResponse(), gem5::ArmISA::offset, panic, panic_if, gem5::Packet::setUintX(), gem5::AddrRange::start(), timerEl0Range, timerRange, and timerRead().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Reimplemented from gem5::ClockedObject.
Definition at line 1005 of file generic_timer.cc.
References hasEl0View(), nonSecureAccess, physTimer, SERIALIZE_SCALAR, gem5::Serializable::serializeSection(), and virtTimer.
void gem5::GenericTimerFrame::setAccessBits | ( | uint8_t | data | ) |
Updates the access bits after a write to CNTCTLBase.CNTACR.
Definition at line 1053 of file generic_timer.cc.
References data.
void gem5::GenericTimerFrame::setNonSecureAccess | ( | ) |
Allows non-secure accesses after an enabling write to CNTCTLBase.CNTNSAR.
Definition at line 1065 of file generic_timer.cc.
References nonSecureAccess.
void gem5::GenericTimerFrame::setVirtOffset | ( | uint64_t | new_offset | ) |
Sets the virtual offset for this frame's virtual timer after a write to CNTVOFF.
Definition at line 1035 of file generic_timer.cc.
References gem5::ArchTimer::setOffset(), and virtTimer.
|
private |
CNTBase/CNTEL0Base (Memory-mapped timer frame)
Definition at line 1144 of file generic_timer.cc.
References gem5::X86ISA::addr, gem5::ArchTimer::compareValue(), gem5::ArchTimer::control(), gem5::SystemCounter::freq(), hasEl0View(), nonSecureAccess, gem5::ArchTimer::offset(), physTimer, system, systemCounter, TIMER_CNTEL0ACR, TIMER_CNTFRQ, TIMER_CNTP_CTL, TIMER_CNTP_CVAL_HI, TIMER_CNTP_CVAL_LO, TIMER_CNTP_TVAL, TIMER_CNTPCT_HI, TIMER_CNTPCT_LO, TIMER_CNTV_CTL, TIMER_CNTV_CVAL_HI, TIMER_CNTV_CVAL_LO, TIMER_CNTV_TVAL, TIMER_CNTVCT_HI, TIMER_CNTVCT_LO, TIMER_CNTVOFF_HI, TIMER_CNTVOFF_LO, gem5::ArchTimer::timerValue(), gem5::GenericTimerMem::validateAccessPerm(), gem5::ArchTimer::value(), virtTimer, and warn.
Referenced by read().
|
private |
Definition at line 1256 of file generic_timer.cc.
References gem5::X86ISA::addr, gem5::ArchTimer::compareValue(), data, hasEl0View(), gem5::insertBits(), nonSecureAccess, physTimer, gem5::ArchTimer::setCompareValue(), gem5::ArchTimer::setControl(), gem5::ArchTimer::setTimerValue(), system, TIMER_CNTEL0ACR, TIMER_CNTFRQ, TIMER_CNTP_CTL, TIMER_CNTP_CVAL_HI, TIMER_CNTP_CVAL_LO, TIMER_CNTP_TVAL, TIMER_CNTPCT_HI, TIMER_CNTPCT_LO, TIMER_CNTV_CTL, TIMER_CNTV_CVAL_HI, TIMER_CNTV_CVAL_LO, TIMER_CNTV_TVAL, TIMER_CNTVCT_HI, TIMER_CNTVCT_LO, TIMER_CNTVOFF_HI, TIMER_CNTVOFF_LO, gem5::GenericTimerMem::validateAccessPerm(), virtTimer, and warn.
Referenced by write().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Reimplemented from gem5::ClockedObject.
Definition at line 1017 of file generic_timer.cc.
References hasEl0View(), nonSecureAccess, physTimer, UNSERIALIZE_SCALAR, gem5::Serializable::unserializeSection(), and virtTimer.
Pure virtual function that the device must implement.
Called when a write command is recieved by the port.
pkt | Packet describing this request |
Implements gem5::PioDevice.
Definition at line 1114 of file generic_timer.cc.
References gem5::X86ISA::addr, gem5::AddrRange::contains(), data, DPRINTF, gem5::Packet::getAddr(), gem5::Packet::getSize(), gem5::Packet::getUintX(), hasEl0View(), gem5::Packet::isSecure(), gem5::Packet::makeResponse(), gem5::ArmISA::offset, panic, panic_if, gem5::AddrRange::start(), timerEl0Range, timerRange, and timerWrite().
|
private |
All MMIO ranges GenericTimerFrame responds to.
Definition at line 482 of file generic_timer.hh.
Referenced by getAddrRanges().
|
private |
Reports whether non-secure accesses are allowed to this frame.
Definition at line 512 of file generic_timer.hh.
Referenced by hasNonSecureAccess(), serialize(), setNonSecureAccess(), timerRead(), timerWrite(), and unserialize().
|
private |
Definition at line 507 of file generic_timer.hh.
|
private |
Physical and virtual timers.
Definition at line 488 of file generic_timer.hh.
Referenced by serialize(), timerRead(), timerWrite(), and unserialize().
|
private |
Definition at line 496 of file generic_timer.hh.
|
private |
Definition at line 498 of file generic_timer.hh.
|
private |
Definition at line 497 of file generic_timer.hh.
|
private |
Definition at line 495 of file generic_timer.hh.
|
private |
Definition at line 494 of file generic_timer.hh.
|
private |
Definition at line 514 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
private |
System counter reference.
Definition at line 485 of file generic_timer.hh.
Referenced by timerRead().
|
staticprivate |
Definition at line 469 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 468 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 475 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 473 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 472 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 474 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 465 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 464 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 479 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 477 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 476 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 478 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 467 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 466 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 471 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 470 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
private |
Definition at line 462 of file generic_timer.hh.
Referenced by hasEl0View(), read(), and write().
|
private |
Definition at line 461 of file generic_timer.hh.
Referenced by GenericTimerFrame(), read(), and write().
|
private |
Definition at line 506 of file generic_timer.hh.
|
private |
Definition at line 489 of file generic_timer.hh.
Referenced by getVirtOffset(), serialize(), setVirtOffset(), timerRead(), timerWrite(), and unserialize().
|
private |
Definition at line 505 of file generic_timer.hh.