gem5
v20.1.0.0
|
#include <generic_timer.hh>
Public Member Functions | |
GenericTimerFrame (GenericTimerFrameParams *const p) | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
bool | hasVirtualTimer () const |
Indicates if this frame implements a virtual timer. More... | |
uint64_t | getVirtOffset () const |
Returns the virtual offset for this frame if a virtual timer is implemented. More... | |
void | setVirtOffset (uint64_t new_offset) |
Sets the virtual offset for this frame's virtual timer after a write to CNTVOFF. More... | |
bool | hasEl0View () const |
Indicates if this frame implements a second EL0 view. More... | |
uint8_t | getAccessBits () const |
Returns the access bits for this frame. More... | |
void | setAccessBits (uint8_t data) |
Updates the access bits after a write to CNTCTLBase.CNTACR. More... | |
bool | hasNonSecureAccess () const |
Indicates if non-secure accesses are allowed to this frame. More... | |
void | setNonSecureAccess () |
Allows non-secure accesses after an enabling write to CNTCTLBase.CNTNSAR. More... | |
bool | hasReadableVoff () const |
Indicates if CNTVOFF is readable for this frame. More... | |
Public Member Functions inherited from PioDevice | |
PioDevice (const Params *p) | |
virtual | ~PioDevice () |
const Params * | params () const |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. More... | |
Public Member Functions inherited from ClockedObject | |
ClockedObject (const ClockedObjectParams *p) | |
const Params * | params () const |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from SimObject | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. 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 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. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
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... | |
Public Member Functions inherited from Stats::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. More... | |
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. More... | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. More... | |
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. More... | |
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. More... | |
Tick | read (PacketPtr pkt) override |
Pure virtual function that the device must implement. More... | |
Tick | write (PacketPtr pkt) override |
Pure virtual function that the device must implement. More... | |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Member Functions inherited from Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. More... | |
void | resetClock () const |
Reset the object's clock using the current global tick value. More... | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More... | |
Private Member Functions | |
uint64_t | timerRead (Addr addr, size_t size, bool is_sec, bool to_el0) const |
CNTBase/CNTEL0Base (Memory-mapped timer frame) More... | |
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. More... | |
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. More... | |
SystemCounter & | systemCounter |
System counter reference. More... | |
ArchTimer | physTimer |
Physical and virtual timers. More... | |
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. More... | |
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 PioDevice | |
typedef PioDeviceParams | Params |
Public Types inherited from ClockedObject | |
typedef ClockedObjectParams | Params |
Parameters of ClockedObject. More... | |
Public Types inherited from SimObject | |
typedef SimObjectParams | Params |
Static Public Member Functions inherited from SimObject | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
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) |
Public Attributes inherited from ClockedObject | |
PowerState * | powerState |
Protected Attributes inherited from PioDevice | |
System * | sys |
PioPort< PioDevice > | pioPort |
The pioPort that handles the requests for us and provides us requests that it sees. More... | |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Definition at line 392 of file generic_timer.hh.
GenericTimerFrame::GenericTimerFrame | ( | GenericTimerFrameParams *const | p | ) |
Definition at line 876 of file generic_timer.cc.
References timerRange.
|
private |
|
private |
Reports access properties of the CNTBase register frame elements.
|
private |
|
private |
uint8_t GenericTimerFrame::getAccessBits | ( | ) | const |
Returns the access bits for this frame.
Definition at line 943 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 PioDevice.
Definition at line 973 of file generic_timer.cc.
References addrRanges.
uint64_t GenericTimerFrame::getVirtOffset | ( | ) | const |
Returns the virtual offset for this frame if a virtual timer is implemented.
Definition at line 925 of file generic_timer.cc.
References ArchTimer::offset(), and virtTimer.
bool GenericTimerFrame::hasEl0View | ( | ) | const |
Indicates if this frame implements a second EL0 view.
Definition at line 937 of file generic_timer.cc.
References timerEl0Range, and AddrRange::valid().
Referenced by read(), serialize(), timerRead(), timerWrite(), unserialize(), and write().
bool GenericTimerFrame::hasNonSecureAccess | ( | ) | const |
Indicates if non-secure accesses are allowed to this frame.
Definition at line 955 of file generic_timer.cc.
References nonSecureAccess.
bool GenericTimerFrame::hasReadableVoff | ( | ) | const |
Indicates if CNTVOFF is readable for this frame.
Definition at line 967 of file generic_timer.cc.
bool 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 PioDevice.
Definition at line 979 of file generic_timer.cc.
References addr, AddrRange::contains(), DPRINTF, Packet::getAddr(), Packet::getSize(), hasEl0View(), Packet::isSecure(), Packet::makeResponse(), ArmISA::offset, panic, panic_if, Packet::setUintX(), AddrRange::start(), timerEl0Range, timerRange, and timerRead().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 901 of file generic_timer.cc.
References hasEl0View(), nonSecureAccess, physTimer, SERIALIZE_SCALAR, Serializable::serializeSection(), and virtTimer.
void GenericTimerFrame::setAccessBits | ( | uint8_t | data | ) |
Updates the access bits after a write to CNTCTLBase.CNTACR.
Definition at line 949 of file generic_timer.cc.
References data.
void GenericTimerFrame::setNonSecureAccess | ( | ) |
Allows non-secure accesses after an enabling write to CNTCTLBase.CNTNSAR.
Definition at line 961 of file generic_timer.cc.
References nonSecureAccess.
void GenericTimerFrame::setVirtOffset | ( | uint64_t | new_offset | ) |
Sets the virtual offset for this frame's virtual timer after a write to CNTVOFF.
Definition at line 931 of file generic_timer.cc.
References ArchTimer::setOffset(), and virtTimer.
|
private |
CNTBase/CNTEL0Base (Memory-mapped timer frame)
Definition at line 1040 of file generic_timer.cc.
References addr, ArchTimer::compareValue(), ArchTimer::control(), SystemCounter::freq(), hasEl0View(), nonSecureAccess, 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, ArchTimer::timerValue(), GenericTimerMem::validateAccessPerm(), ArchTimer::value(), virtTimer, and warn.
Referenced by read().
|
private |
Definition at line 1152 of file generic_timer.cc.
References addr, ArchTimer::compareValue(), data, hasEl0View(), insertBits(), nonSecureAccess, physTimer, ArchTimer::setCompareValue(), ArchTimer::setControl(), 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, 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 |
Implements Serializable.
Definition at line 913 of file generic_timer.cc.
References hasEl0View(), nonSecureAccess, physTimer, UNSERIALIZE_SCALAR, 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 PioDevice.
Definition at line 1010 of file generic_timer.cc.
References addr, AddrRange::contains(), data, DPRINTF, Packet::getAddr(), Packet::getSize(), Packet::getUintX(), hasEl0View(), Packet::isSecure(), Packet::makeResponse(), ArmISA::offset, panic, panic_if, AddrRange::start(), timerEl0Range, timerRange, and timerWrite().
|
private |
All MMIO ranges GenericTimerFrame responds to.
Definition at line 461 of file generic_timer.hh.
Referenced by getAddrRanges().
|
private |
Reports whether non-secure accesses are allowed to this frame.
Definition at line 491 of file generic_timer.hh.
Referenced by hasNonSecureAccess(), serialize(), setNonSecureAccess(), timerRead(), timerWrite(), and unserialize().
|
private |
Definition at line 486 of file generic_timer.hh.
|
private |
Physical and virtual timers.
Definition at line 467 of file generic_timer.hh.
Referenced by serialize(), timerRead(), timerWrite(), and unserialize().
|
private |
Definition at line 475 of file generic_timer.hh.
|
private |
Definition at line 477 of file generic_timer.hh.
|
private |
Definition at line 476 of file generic_timer.hh.
|
private |
Definition at line 474 of file generic_timer.hh.
|
private |
Definition at line 473 of file generic_timer.hh.
|
private |
Definition at line 493 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
private |
System counter reference.
Definition at line 464 of file generic_timer.hh.
Referenced by timerRead().
|
staticprivate |
Definition at line 448 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 447 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 454 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 452 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 451 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 453 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 444 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 443 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 458 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 456 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 455 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 457 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 446 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 445 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 450 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
staticprivate |
Definition at line 449 of file generic_timer.hh.
Referenced by timerRead(), and timerWrite().
|
private |
Definition at line 441 of file generic_timer.hh.
Referenced by hasEl0View(), read(), and write().
|
private |
Definition at line 440 of file generic_timer.hh.
Referenced by GenericTimerFrame(), read(), and write().
|
private |
Definition at line 485 of file generic_timer.hh.
|
private |
Definition at line 468 of file generic_timer.hh.
Referenced by getVirtOffset(), serialize(), setVirtOffset(), timerRead(), timerWrite(), and unserialize().
|
private |
Definition at line 484 of file generic_timer.hh.