gem5  v22.1.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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. 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 gem5::ClockedObject
 ClockedObject (const ClockedObjectParams &p)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- 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. 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 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. 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 gem5::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 gem5::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 gem5::statistics::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 (statistics::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...
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block. More...
 
 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. 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
 

Static Public Member Functions

static void validateFrameRange (const AddrRange &range)
 Validates a Generic Timer register frame address range. More...
 
static bool validateAccessPerm (ArmSystem &sys, bool is_sec)
 Validates an MMIO access permissions. More...
 
- 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. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
static void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

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 gem5::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 gem5::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 counterCtrlRead (Addr addr, size_t size, bool is_sec) const
 CNTControlBase (System counter control frame) More...
 
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) More...
 
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) More...
 
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. More...
 
const AddrRangeList addrRanges
 All MMIO ranges GenericTimerMem responds to. More...
 
SystemCountersystemCounter
 System counter reference. More...
 
std::vector< GenericTimerFrame * > frames
 Timer frame references. More...
 
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. More...
 

Additional Inherited Members

- Public Types inherited from gem5::PioDevice
using Params = PioDeviceParams
 
- Public Types inherited from gem5::ClockedObject
using Params = ClockedObjectParams
 Parameters of ClockedObject. More...
 
- 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. More...
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

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

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

◆ counterCtrlWrite()

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

◆ 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

constexpr 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 Wed Dec 21 2022 10:23:17 for gem5 by doxygen 1.9.1