gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::GenericTimerFrame Class Reference

#include <generic_timer.hh>

Inheritance diagram for gem5::GenericTimerFrame:
gem5::PioDevice gem5::ClockedObject gem5::SimObject gem5::Clocked gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

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.
 
PortgetPort (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 Paramsparams () 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.
 
ProbeManagergetProbeManager ()
 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
EventQueueeventQueue () 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 InforesolveStat (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
 
Groupoperator= (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
 
Clockedoperator= (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.
 
SystemCountersystemCounter
 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.
 
ArmSystemsystem
 

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 SimObjectfind (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 SimObjectResolvergetSimObjectResolver ()
 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
PowerStatepowerState
 
- Protected Attributes inherited from gem5::PioDevice
Systemsys
 
PioPort< PioDevicepioPort
 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
EventQueueeventq
 A pointer to this object's event queue.
 

Detailed Description

Definition at line 413 of file generic_timer.hh.

Constructor & Destructor Documentation

◆ GenericTimerFrame()

gem5::GenericTimerFrame::GenericTimerFrame ( const GenericTimerFrameParams & p)

Definition at line 980 of file generic_timer.cc.

References timerRange.

Member Function Documentation

◆ BitUnion16()

gem5::GenericTimerFrame::BitUnion16 ( AccessBitsEl0 )
private

◆ BitUnion8()

gem5::GenericTimerFrame::BitUnion8 ( AccessBits )
private

Reports access properties of the CNTBase register frame elements.

◆ EndBitUnion() [1/2]

gem5::GenericTimerFrame::EndBitUnion ( AccessBits )
private

◆ EndBitUnion() [2/2]

gem5::GenericTimerFrame::EndBitUnion ( AccessBitsEl0 )
private

◆ getAccessBits()

uint8_t gem5::GenericTimerFrame::getAccessBits ( ) const

Returns the access bits for this frame.

Definition at line 1047 of file generic_timer.cc.

◆ getAddrRanges()

AddrRangeList gem5::GenericTimerFrame::getAddrRanges ( ) const
overrideprotectedvirtual

Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to.

Returns
a list of non-overlapping address ranges

Implements gem5::PioDevice.

Definition at line 1077 of file generic_timer.cc.

References addrRanges.

◆ getVirtOffset()

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.

◆ hasEl0View()

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().

◆ hasNonSecureAccess()

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.

◆ hasReadableVoff()

bool gem5::GenericTimerFrame::hasReadableVoff ( ) const

Indicates if CNTVOFF is readable for this frame.

Definition at line 1071 of file generic_timer.cc.

◆ hasVirtualTimer()

bool gem5::GenericTimerFrame::hasVirtualTimer ( ) const

Indicates if this frame implements a virtual timer.

◆ read()

Tick gem5::GenericTimerFrame::read ( PacketPtr pkt)
overrideprotectedvirtual

Pure virtual function that the device must implement.

Called when a read command is recieved by the port.

Parameters
pktPacket describing this request
Returns
number of ticks it took to complete

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().

◆ serialize()

void gem5::GenericTimerFrame::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint 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.

◆ setAccessBits()

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.

◆ setNonSecureAccess()

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.

◆ setVirtOffset()

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.

◆ timerRead()

◆ timerWrite()

◆ unserialize()

void gem5::GenericTimerFrame::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint 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.

◆ write()

Tick gem5::GenericTimerFrame::write ( PacketPtr pkt)
overrideprotectedvirtual

Pure virtual function that the device must implement.

Called when a write command is recieved by the port.

Parameters
pktPacket describing this request
Returns
number of ticks it took to complete

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().

Member Data Documentation

◆ addrRanges

AddrRangeList gem5::GenericTimerFrame::addrRanges
private

All MMIO ranges GenericTimerFrame responds to.

Definition at line 482 of file generic_timer.hh.

Referenced by getAddrRanges().

◆ nonSecureAccess

bool gem5::GenericTimerFrame::nonSecureAccess
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().

◆ pcten

Bitfield<0> gem5::GenericTimerFrame::pcten
private

Definition at line 507 of file generic_timer.hh.

◆ physTimer

ArchTimer gem5::GenericTimerFrame::physTimer
private

Physical and virtual timers.

Definition at line 488 of file generic_timer.hh.

Referenced by serialize(), timerRead(), timerWrite(), and unserialize().

◆ rfrq

Bitfield<2> gem5::GenericTimerFrame::rfrq
private

Definition at line 496 of file generic_timer.hh.

◆ rpct

Bitfield<0> gem5::GenericTimerFrame::rpct
private

Definition at line 498 of file generic_timer.hh.

◆ rvct

Bitfield<1> gem5::GenericTimerFrame::rvct
private

Definition at line 497 of file generic_timer.hh.

◆ rvoff

Bitfield<3> gem5::GenericTimerFrame::rvoff
private

Definition at line 495 of file generic_timer.hh.

◆ rwvt

Bitfield<4> gem5::GenericTimerFrame::rwvt
private

Definition at line 494 of file generic_timer.hh.

◆ system

ArmSystem& gem5::GenericTimerFrame::system
private

Definition at line 514 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ systemCounter

SystemCounter& gem5::GenericTimerFrame::systemCounter
private

System counter reference.

Definition at line 485 of file generic_timer.hh.

Referenced by timerRead().

◆ TIMER_CNTEL0ACR

const Addr gem5::GenericTimerFrame::TIMER_CNTEL0ACR = 0x14
staticprivate

Definition at line 469 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTFRQ

const Addr gem5::GenericTimerFrame::TIMER_CNTFRQ = 0x10
staticprivate

Definition at line 468 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_CTL

const Addr gem5::GenericTimerFrame::TIMER_CNTP_CTL = 0x2c
staticprivate

Definition at line 475 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_CVAL_HI

const Addr gem5::GenericTimerFrame::TIMER_CNTP_CVAL_HI = 0x24
staticprivate

Definition at line 473 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_CVAL_LO

const Addr gem5::GenericTimerFrame::TIMER_CNTP_CVAL_LO = 0x20
staticprivate

Definition at line 472 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_TVAL

const Addr gem5::GenericTimerFrame::TIMER_CNTP_TVAL = 0x28
staticprivate

Definition at line 474 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTPCT_HI

const Addr gem5::GenericTimerFrame::TIMER_CNTPCT_HI = 0x04
staticprivate

Definition at line 465 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTPCT_LO

const Addr gem5::GenericTimerFrame::TIMER_CNTPCT_LO = 0x00
staticprivate

Definition at line 464 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_CTL

const Addr gem5::GenericTimerFrame::TIMER_CNTV_CTL = 0x3c
staticprivate

Definition at line 479 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_CVAL_HI

const Addr gem5::GenericTimerFrame::TIMER_CNTV_CVAL_HI = 0x34
staticprivate

Definition at line 477 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_CVAL_LO

const Addr gem5::GenericTimerFrame::TIMER_CNTV_CVAL_LO = 0x30
staticprivate

Definition at line 476 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_TVAL

const Addr gem5::GenericTimerFrame::TIMER_CNTV_TVAL = 0x38
staticprivate

Definition at line 478 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVCT_HI

const Addr gem5::GenericTimerFrame::TIMER_CNTVCT_HI = 0x0c
staticprivate

Definition at line 467 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVCT_LO

const Addr gem5::GenericTimerFrame::TIMER_CNTVCT_LO = 0x08
staticprivate

Definition at line 466 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVOFF_HI

const Addr gem5::GenericTimerFrame::TIMER_CNTVOFF_HI = 0x1c
staticprivate

Definition at line 471 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVOFF_LO

const Addr gem5::GenericTimerFrame::TIMER_CNTVOFF_LO = 0x18
staticprivate

Definition at line 470 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ timerEl0Range

AddrRange gem5::GenericTimerFrame::timerEl0Range
private

Definition at line 462 of file generic_timer.hh.

Referenced by hasEl0View(), read(), and write().

◆ timerRange

const AddrRange gem5::GenericTimerFrame::timerRange
private

Definition at line 461 of file generic_timer.hh.

Referenced by GenericTimerFrame(), read(), and write().

◆ vcten

Bitfield<1> gem5::GenericTimerFrame::vcten
private

Definition at line 506 of file generic_timer.hh.

◆ virtTimer

ArchTimer gem5::GenericTimerFrame::virtTimer
private

◆ vten

Bitfield<8> gem5::GenericTimerFrame::vten
private

Definition at line 505 of file generic_timer.hh.


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:11 for gem5 by doxygen 1.11.0