gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::GenericTimerMem Class Referenceabstract

#include <generic_timer.hh>

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

Public Member Functions

 GenericTimerMem (const GenericTimerMemParams &p)
 
- 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)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- 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
 

Static Public Member Functions

static void validateFrameRange (const AddrRange &range)
 Validates a Generic Timer register frame address range.
 
static bool validateAccessPerm (ArmSystem &sys, bool is_sec)
 Validates an MMIO access permissions.
 
- 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.
 

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 counterCtrlRead (Addr addr, size_t size, bool is_sec) const
 CNTControlBase (System counter control frame)
 
void counterCtrlWrite (Addr addr, size_t size, uint64_t data, bool is_sec)
 
 BitUnion32 (CNTCR) Bitfield< 17
 
 EndBitUnion (CNTCR) BitUnion32(CNTSR) Bitfield< 31
 
 EndBitUnion (CNTSR) static const Addr COUNTER_CTRL_CNTCR=0x00
 
uint64_t counterStatusRead (Addr addr, size_t size) const
 CNTReadBase (System counter status frame)
 
void counterStatusWrite (Addr addr, size_t size, uint64_t data)
 
uint64_t timerCtrlRead (Addr addr, size_t size, bool is_sec) const
 CNTCTLBase (Memory-mapped timer global control frame)
 
void timerCtrlWrite (Addr addr, size_t size, uint64_t data, bool is_sec)
 

Private Attributes

const AddrRange counterCtrlRange
 
 fcreq
 
Bitfield< 2 > scen
 
Bitfield< 1 > hdbg
 
Bitfield< 0 > en
 
 fcack
 
const AddrRange counterStatusRange
 
const AddrRange timerCtrlRange
 
uint32_t cnttidr
 ID register for reporting features of implemented timer frames.
 
const AddrRangeList addrRanges
 All MMIO ranges GenericTimerMem responds to.
 
SystemCountersystemCounter
 System counter reference.
 
std::vector< GenericTimerFrame * > frames
 Timer frame references.
 
ArmSystemsystem
 

Static Private Attributes

static const Addr COUNTER_CTRL_CNTSR = 0x04
 
static const Addr COUNTER_CTRL_CNTCV_LO = 0x08
 
static const Addr COUNTER_CTRL_CNTCV_HI = 0x0c
 
static const Addr COUNTER_CTRL_CNTSCR = 0x10
 
static const Addr COUNTER_CTRL_CNTID = 0x1c
 
static const Addr COUNTER_CTRL_CNTFID = 0x20
 
static const Addr COUNTER_STATUS_CNTCV_LO = 0x00
 
static const Addr COUNTER_STATUS_CNTCV_HI = 0x04
 
static const Addr TIMER_CTRL_CNTFRQ = 0x00
 
static const Addr TIMER_CTRL_CNTNSAR = 0x04
 
static const Addr TIMER_CTRL_CNTTIDR = 0x08
 
static const Addr TIMER_CTRL_CNTACR = 0x40
 
static const Addr TIMER_CTRL_CNTVOFF_LO = 0x80
 
static const Addr TIMER_CTRL_CNTVOFF_HI = 0x84
 
static constexpr size_t MAX_TIMER_FRAMES = 8
 Maximum architectural number of memory-mapped timer frames.
 

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
 
- 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 517 of file generic_timer.hh.

Constructor & Destructor Documentation

◆ GenericTimerMem()

gem5::GenericTimerMem::GenericTimerMem ( const GenericTimerMemParams & p)

Member Function Documentation

◆ BitUnion32()

gem5::GenericTimerMem::BitUnion32 ( CNTCR )
private

◆ counterCtrlRead()

◆ counterCtrlWrite()

◆ counterStatusRead()

uint64_t gem5::GenericTimerMem::counterStatusRead ( Addr addr,
size_t size ) const
private

CNTReadBase (System counter status frame)

Definition at line 1566 of file generic_timer.cc.

References gem5::X86ISA::addr, COUNTER_STATUS_CNTCV_HI, COUNTER_STATUS_CNTCV_LO, systemCounter, gem5::SystemCounter::value(), and warn.

Referenced by read().

◆ counterStatusWrite()

void gem5::GenericTimerMem::counterStatusWrite ( Addr addr,
size_t size,
uint64_t data )
private

Definition at line 1579 of file generic_timer.cc.

References gem5::X86ISA::addr, COUNTER_STATUS_CNTCV_HI, COUNTER_STATUS_CNTCV_LO, and warn.

Referenced by write().

◆ EndBitUnion() [1/2]

gem5::GenericTimerMem::EndBitUnion ( CNTCR )
private

◆ EndBitUnion() [2/2]

gem5::GenericTimerMem::EndBitUnion ( CNTSR ) const
privatepure virtual

◆ getAddrRanges()

AddrRangeList gem5::GenericTimerMem::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 1395 of file generic_timer.cc.

References addrRanges.

◆ read()

Tick gem5::GenericTimerMem::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 1401 of file generic_timer.cc.

References gem5::X86ISA::addr, gem5::AddrRange::contains(), counterCtrlRange, counterCtrlRead(), counterStatusRange, counterStatusRead(), DPRINTF, gem5::Packet::getAddr(), gem5::Packet::getSize(), gem5::Packet::isSecure(), gem5::Packet::makeResponse(), panic, panic_if, gem5::Packet::setUintX(), gem5::AddrRange::start(), timerCtrlRange, and timerCtrlRead().

◆ timerCtrlRead()

uint64_t gem5::GenericTimerMem::timerCtrlRead ( Addr addr,
size_t size,
bool is_sec ) const
private

◆ timerCtrlWrite()

void gem5::GenericTimerMem::timerCtrlWrite ( Addr addr,
size_t size,
uint64_t data,
bool is_sec )
private

◆ validateAccessPerm()

bool gem5::GenericTimerMem::validateAccessPerm ( ArmSystem & sys,
bool is_sec )
static

Validates an MMIO access permissions.

Parameters
sysSystem reference where the acces is being made
is_secIf the access is to secure memory

Definition at line 1389 of file generic_timer.cc.

References gem5::PioDevice::sys.

Referenced by counterCtrlRead(), counterCtrlWrite(), timerCtrlRead(), timerCtrlWrite(), gem5::GenericTimerFrame::timerRead(), and gem5::GenericTimerFrame::timerWrite().

◆ validateFrameRange()

void gem5::GenericTimerMem::validateFrameRange ( const AddrRange & range)
static

Validates a Generic Timer register frame address range.

Parameters
base_addrRange of the register frame

Definition at line 1380 of file generic_timer.cc.

References fatal_if, gem5::ArmSystem::PageBytes, and gem5::AddrRange::start().

Referenced by GenericTimerMem().

◆ write()

Tick gem5::GenericTimerMem::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 1428 of file generic_timer.cc.

References gem5::X86ISA::addr, gem5::AddrRange::contains(), counterCtrlRange, counterCtrlWrite(), counterStatusRange, counterStatusWrite(), data, DPRINTF, gem5::Packet::getAddr(), gem5::Packet::getSize(), gem5::Packet::getUintX(), gem5::Packet::isSecure(), gem5::Packet::makeResponse(), panic, panic_if, gem5::AddrRange::start(), timerCtrlRange, and timerCtrlWrite().

Member Data Documentation

◆ addrRanges

const AddrRangeList gem5::GenericTimerMem::addrRanges
private

All MMIO ranges GenericTimerMem responds to.

Definition at line 585 of file generic_timer.hh.

Referenced by GenericTimerMem(), and getAddrRanges().

◆ cnttidr

uint32_t gem5::GenericTimerMem::cnttidr
private

ID register for reporting features of implemented timer frames.

Definition at line 575 of file generic_timer.hh.

Referenced by GenericTimerMem(), and timerCtrlRead().

◆ COUNTER_CTRL_CNTCV_HI

const Addr gem5::GenericTimerMem::COUNTER_CTRL_CNTCV_HI = 0x0c
staticprivate

Definition at line 556 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTCV_LO

const Addr gem5::GenericTimerMem::COUNTER_CTRL_CNTCV_LO = 0x08
staticprivate

Definition at line 555 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTFID

const Addr gem5::GenericTimerMem::COUNTER_CTRL_CNTFID = 0x20
staticprivate

Definition at line 559 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTID

const Addr gem5::GenericTimerMem::COUNTER_CTRL_CNTID = 0x1c
staticprivate

Definition at line 558 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTSCR

const Addr gem5::GenericTimerMem::COUNTER_CTRL_CNTSCR = 0x10
staticprivate

Definition at line 557 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTSR

const Addr gem5::GenericTimerMem::COUNTER_CTRL_CNTSR = 0x04
staticprivate

Definition at line 554 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_STATUS_CNTCV_HI

const Addr gem5::GenericTimerMem::COUNTER_STATUS_CNTCV_HI = 0x04
staticprivate

Definition at line 567 of file generic_timer.hh.

Referenced by counterStatusRead(), and counterStatusWrite().

◆ COUNTER_STATUS_CNTCV_LO

const Addr gem5::GenericTimerMem::COUNTER_STATUS_CNTCV_LO = 0x00
staticprivate

Definition at line 566 of file generic_timer.hh.

Referenced by counterStatusRead(), and counterStatusWrite().

◆ counterCtrlRange

const AddrRange gem5::GenericTimerMem::counterCtrlRange
private

Definition at line 540 of file generic_timer.hh.

Referenced by read(), and write().

◆ counterStatusRange

const AddrRange gem5::GenericTimerMem::counterStatusRange
private

Definition at line 564 of file generic_timer.hh.

Referenced by read(), and write().

◆ en

Bitfield<0> gem5::GenericTimerMem::en
private

Definition at line 546 of file generic_timer.hh.

◆ fcack

gem5::GenericTimerMem::fcack
private

Definition at line 550 of file generic_timer.hh.

◆ fcreq

gem5::GenericTimerMem::fcreq
private

Definition at line 543 of file generic_timer.hh.

◆ frames

std::vector<GenericTimerFrame *> gem5::GenericTimerMem::frames
private

Timer frame references.

Definition at line 594 of file generic_timer.hh.

Referenced by GenericTimerMem(), timerCtrlRead(), and timerCtrlWrite().

◆ hdbg

Bitfield<1> gem5::GenericTimerMem::hdbg
private

Definition at line 545 of file generic_timer.hh.

◆ MAX_TIMER_FRAMES

size_t gem5::GenericTimerMem::MAX_TIMER_FRAMES = 8
staticconstexprprivate

Maximum architectural number of memory-mapped timer frames.

Definition at line 591 of file generic_timer.hh.

Referenced by GenericTimerMem().

◆ scen

Bitfield<2> gem5::GenericTimerMem::scen
private

Definition at line 544 of file generic_timer.hh.

◆ system

ArmSystem& gem5::GenericTimerMem::system
private

Definition at line 596 of file generic_timer.hh.

Referenced by counterCtrlRead(), counterCtrlWrite(), timerCtrlRead(), and timerCtrlWrite().

◆ systemCounter

SystemCounter& gem5::GenericTimerMem::systemCounter
private

System counter reference.

Definition at line 588 of file generic_timer.hh.

Referenced by counterCtrlRead(), counterCtrlWrite(), counterStatusRead(), timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTACR

const Addr gem5::GenericTimerMem::TIMER_CTRL_CNTACR = 0x40
staticprivate

Definition at line 580 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTFRQ

const Addr gem5::GenericTimerMem::TIMER_CTRL_CNTFRQ = 0x00
staticprivate

Definition at line 577 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTNSAR

const Addr gem5::GenericTimerMem::TIMER_CTRL_CNTNSAR = 0x04
staticprivate

Definition at line 578 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTTIDR

const Addr gem5::GenericTimerMem::TIMER_CTRL_CNTTIDR = 0x08
staticprivate

Definition at line 579 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTVOFF_HI

const Addr gem5::GenericTimerMem::TIMER_CTRL_CNTVOFF_HI = 0x84
staticprivate

Definition at line 582 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTVOFF_LO

const Addr gem5::GenericTimerMem::TIMER_CTRL_CNTVOFF_LO = 0x80
staticprivate

Definition at line 581 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ timerCtrlRange

const AddrRange gem5::GenericTimerMem::timerCtrlRange
private

Definition at line 572 of file generic_timer.hh.

Referenced by read(), and write().


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