gem5  v20.1.0.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
GenericTimerFrame Class Reference

#include <generic_timer.hh>

Inheritance diagram for GenericTimerFrame:
PioDevice ClockedObject SimObject Clocked EventManager Serializable Drainable Stats::Group

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 Paramsparams () const
 
void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
PortgetPort (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 Paramsparams () 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 Paramsparams () 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...
 
ProbeManagergetProbeManager ()
 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
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. 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 InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (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
 
Clockedoperator= (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...
 
SystemCountersystemCounter
 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...
 
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 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 SimObjectfind (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
PowerStatepowerState
 
- Protected Attributes inherited from PioDevice
Systemsys
 
PioPort< PioDevicepioPort
 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
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 392 of file generic_timer.hh.

Constructor & Destructor Documentation

◆ GenericTimerFrame()

GenericTimerFrame::GenericTimerFrame ( GenericTimerFrameParams *const  p)

Definition at line 876 of file generic_timer.cc.

References timerRange.

Member Function Documentation

◆ BitUnion16()

GenericTimerFrame::BitUnion16 ( AccessBitsEl0  )
private

◆ BitUnion8()

GenericTimerFrame::BitUnion8 ( AccessBits  )
private

Reports access properties of the CNTBase register frame elements.

◆ EndBitUnion() [1/2]

GenericTimerFrame::EndBitUnion ( AccessBits  )
private

◆ EndBitUnion() [2/2]

GenericTimerFrame::EndBitUnion ( AccessBitsEl0  )
private

◆ getAccessBits()

uint8_t GenericTimerFrame::getAccessBits ( ) const

Returns the access bits for this frame.

Definition at line 943 of file generic_timer.cc.

◆ getAddrRanges()

AddrRangeList 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 PioDevice.

Definition at line 973 of file generic_timer.cc.

References addrRanges.

◆ getVirtOffset()

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.

◆ hasEl0View()

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

◆ hasNonSecureAccess()

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.

◆ hasReadableVoff()

bool GenericTimerFrame::hasReadableVoff ( ) const

Indicates if CNTVOFF is readable for this frame.

Definition at line 967 of file generic_timer.cc.

◆ hasVirtualTimer()

bool GenericTimerFrame::hasVirtualTimer ( ) const

Indicates if this frame implements a virtual timer.

◆ read()

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

◆ serialize()

void GenericTimerFrame::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 901 of file generic_timer.cc.

References hasEl0View(), nonSecureAccess, physTimer, SERIALIZE_SCALAR, Serializable::serializeSection(), and virtTimer.

◆ setAccessBits()

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.

◆ setNonSecureAccess()

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.

◆ setVirtOffset()

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.

◆ timerRead()

uint64_t GenericTimerFrame::timerRead ( Addr  addr,
size_t  size,
bool  is_sec,
bool  to_el0 
) const
private

◆ timerWrite()

void GenericTimerFrame::timerWrite ( Addr  addr,
size_t  size,
uint64_t  data,
bool  is_sec,
bool  to_el0 
)
private

◆ unserialize()

void GenericTimerFrame::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 913 of file generic_timer.cc.

References hasEl0View(), nonSecureAccess, physTimer, UNSERIALIZE_SCALAR, Serializable::unserializeSection(), and virtTimer.

◆ write()

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

Member Data Documentation

◆ addrRanges

AddrRangeList GenericTimerFrame::addrRanges
private

All MMIO ranges GenericTimerFrame responds to.

Definition at line 461 of file generic_timer.hh.

Referenced by getAddrRanges().

◆ nonSecureAccess

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

◆ pcten

Bitfield<0> GenericTimerFrame::pcten
private

Definition at line 486 of file generic_timer.hh.

◆ physTimer

ArchTimer GenericTimerFrame::physTimer
private

Physical and virtual timers.

Definition at line 467 of file generic_timer.hh.

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

◆ rfrq

Bitfield<2> GenericTimerFrame::rfrq
private

Definition at line 475 of file generic_timer.hh.

◆ rpct

Bitfield<0> GenericTimerFrame::rpct
private

Definition at line 477 of file generic_timer.hh.

◆ rvct

Bitfield<1> GenericTimerFrame::rvct
private

Definition at line 476 of file generic_timer.hh.

◆ rvoff

Bitfield<3> GenericTimerFrame::rvoff
private

Definition at line 474 of file generic_timer.hh.

◆ rwvt

Bitfield<4> GenericTimerFrame::rwvt
private

Definition at line 473 of file generic_timer.hh.

◆ system

ArmSystem& GenericTimerFrame::system
private

Definition at line 493 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ systemCounter

SystemCounter& GenericTimerFrame::systemCounter
private

System counter reference.

Definition at line 464 of file generic_timer.hh.

Referenced by timerRead().

◆ TIMER_CNTEL0ACR

const Addr GenericTimerFrame::TIMER_CNTEL0ACR = 0x14
staticprivate

Definition at line 448 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTFRQ

const Addr GenericTimerFrame::TIMER_CNTFRQ = 0x10
staticprivate

Definition at line 447 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_CTL

const Addr GenericTimerFrame::TIMER_CNTP_CTL = 0x2c
staticprivate

Definition at line 454 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_CVAL_HI

const Addr GenericTimerFrame::TIMER_CNTP_CVAL_HI = 0x24
staticprivate

Definition at line 452 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_CVAL_LO

const Addr GenericTimerFrame::TIMER_CNTP_CVAL_LO = 0x20
staticprivate

Definition at line 451 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTP_TVAL

const Addr GenericTimerFrame::TIMER_CNTP_TVAL = 0x28
staticprivate

Definition at line 453 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTPCT_HI

const Addr GenericTimerFrame::TIMER_CNTPCT_HI = 0x04
staticprivate

Definition at line 444 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTPCT_LO

const Addr GenericTimerFrame::TIMER_CNTPCT_LO = 0x00
staticprivate

Definition at line 443 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_CTL

const Addr GenericTimerFrame::TIMER_CNTV_CTL = 0x3c
staticprivate

Definition at line 458 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_CVAL_HI

const Addr GenericTimerFrame::TIMER_CNTV_CVAL_HI = 0x34
staticprivate

Definition at line 456 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_CVAL_LO

const Addr GenericTimerFrame::TIMER_CNTV_CVAL_LO = 0x30
staticprivate

Definition at line 455 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTV_TVAL

const Addr GenericTimerFrame::TIMER_CNTV_TVAL = 0x38
staticprivate

Definition at line 457 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVCT_HI

const Addr GenericTimerFrame::TIMER_CNTVCT_HI = 0x0c
staticprivate

Definition at line 446 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVCT_LO

const Addr GenericTimerFrame::TIMER_CNTVCT_LO = 0x08
staticprivate

Definition at line 445 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVOFF_HI

const Addr GenericTimerFrame::TIMER_CNTVOFF_HI = 0x1c
staticprivate

Definition at line 450 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ TIMER_CNTVOFF_LO

const Addr GenericTimerFrame::TIMER_CNTVOFF_LO = 0x18
staticprivate

Definition at line 449 of file generic_timer.hh.

Referenced by timerRead(), and timerWrite().

◆ timerEl0Range

AddrRange GenericTimerFrame::timerEl0Range
private

Definition at line 441 of file generic_timer.hh.

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

◆ timerRange

const AddrRange GenericTimerFrame::timerRange
private

Definition at line 440 of file generic_timer.hh.

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

◆ vcten

Bitfield<1> GenericTimerFrame::vcten
private

Definition at line 485 of file generic_timer.hh.

◆ virtTimer

ArchTimer GenericTimerFrame::virtTimer
private

◆ vten

Bitfield<8> GenericTimerFrame::vten
private

Definition at line 484 of file generic_timer.hh.


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

Generated on Wed Sep 30 2020 14:02:25 for gem5 by doxygen 1.8.17