gem5  v20.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
GenericTimerMem Class Referenceabstract

#include <generic_timer.hh>

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

Public Member Functions

 GenericTimerMem (GenericTimerMemParams *const p)
 
- 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
 

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

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 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 PioDevice
typedef PioDeviceParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 
- 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 496 of file generic_timer.hh.

Constructor & Destructor Documentation

◆ GenericTimerMem()

GenericTimerMem::GenericTimerMem ( GenericTimerMemParams *const  p)

Definition at line 1247 of file generic_timer.cc.

References counterCtrlRange, counterStatusRange, and timerCtrlRange.

Member Function Documentation

◆ BitUnion32()

GenericTimerMem::BitUnion32 ( CNTCR  )
private

◆ counterCtrlRead()

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

◆ counterCtrlWrite()

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

◆ counterStatusRead()

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

CNTReadBase (System counter status frame)

Definition at line 1462 of file generic_timer.cc.

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

Referenced by read().

◆ counterStatusWrite()

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

Definition at line 1475 of file generic_timer.cc.

References addr, COUNTER_STATUS_CNTCV_HI, COUNTER_STATUS_CNTCV_LO, and warn.

Referenced by write().

◆ EndBitUnion() [1/2]

GenericTimerMem::EndBitUnion ( CNTCR  )
private

◆ EndBitUnion() [2/2]

GenericTimerMem::EndBitUnion ( CNTSR  ) const
privatepure virtual

◆ getAddrRanges()

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

Definition at line 1291 of file generic_timer.cc.

References addrRanges.

◆ read()

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

Definition at line 1297 of file generic_timer.cc.

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

◆ timerCtrlRead()

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

◆ timerCtrlWrite()

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

◆ validateAccessPerm()

bool 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 1285 of file generic_timer.cc.

References PioDevice::sys.

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

◆ validateFrameRange()

void GenericTimerMem::validateFrameRange ( const AddrRange range)
static

Validates a Generic Timer register frame address range.

Parameters
base_addrRange of the register frame

Definition at line 1276 of file generic_timer.cc.

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

◆ write()

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

Definition at line 1324 of file generic_timer.cc.

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

Member Data Documentation

◆ addrRanges

const AddrRangeList GenericTimerMem::addrRanges
private

All MMIO ranges GenericTimerMem responds to.

Definition at line 564 of file generic_timer.hh.

Referenced by getAddrRanges().

◆ cnttidr

uint32_t GenericTimerMem::cnttidr
private

ID register for reporting features of implemented timer frames.

Definition at line 554 of file generic_timer.hh.

Referenced by timerCtrlRead().

◆ COUNTER_CTRL_CNTCV_HI

const Addr GenericTimerMem::COUNTER_CTRL_CNTCV_HI = 0x0c
staticprivate

Definition at line 535 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTCV_LO

const Addr GenericTimerMem::COUNTER_CTRL_CNTCV_LO = 0x08
staticprivate

Definition at line 534 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTFID

const Addr GenericTimerMem::COUNTER_CTRL_CNTFID = 0x20
staticprivate

Definition at line 538 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTID

const Addr GenericTimerMem::COUNTER_CTRL_CNTID = 0x1c
staticprivate

Definition at line 537 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTSCR

const Addr GenericTimerMem::COUNTER_CTRL_CNTSCR = 0x10
staticprivate

Definition at line 536 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_CTRL_CNTSR

const Addr GenericTimerMem::COUNTER_CTRL_CNTSR = 0x04
staticprivate

Definition at line 533 of file generic_timer.hh.

Referenced by counterCtrlRead(), and counterCtrlWrite().

◆ COUNTER_STATUS_CNTCV_HI

const Addr GenericTimerMem::COUNTER_STATUS_CNTCV_HI = 0x04
staticprivate

Definition at line 546 of file generic_timer.hh.

Referenced by counterStatusRead(), and counterStatusWrite().

◆ COUNTER_STATUS_CNTCV_LO

const Addr GenericTimerMem::COUNTER_STATUS_CNTCV_LO = 0x00
staticprivate

Definition at line 545 of file generic_timer.hh.

Referenced by counterStatusRead(), and counterStatusWrite().

◆ counterCtrlRange

const AddrRange GenericTimerMem::counterCtrlRange
private

Definition at line 519 of file generic_timer.hh.

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

◆ counterStatusRange

const AddrRange GenericTimerMem::counterStatusRange
private

Definition at line 543 of file generic_timer.hh.

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

◆ en

Bitfield<0> GenericTimerMem::en
private

Definition at line 525 of file generic_timer.hh.

◆ fcack

GenericTimerMem::fcack
private

Definition at line 529 of file generic_timer.hh.

◆ fcreq

GenericTimerMem::fcreq
private

Definition at line 522 of file generic_timer.hh.

◆ frames

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

Timer frame references.

Definition at line 573 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ hdbg

Bitfield<1> GenericTimerMem::hdbg
private

Definition at line 524 of file generic_timer.hh.

◆ MAX_TIMER_FRAMES

constexpr size_t GenericTimerMem::MAX_TIMER_FRAMES = 8
staticconstexprprivate

Maximum architectural number of memory-mapped timer frames.

Definition at line 570 of file generic_timer.hh.

◆ scen

Bitfield<2> GenericTimerMem::scen
private

Definition at line 523 of file generic_timer.hh.

◆ system

ArmSystem& GenericTimerMem::system
private

Definition at line 575 of file generic_timer.hh.

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

◆ systemCounter

SystemCounter& GenericTimerMem::systemCounter
private

System counter reference.

Definition at line 567 of file generic_timer.hh.

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

◆ TIMER_CTRL_CNTACR

const Addr GenericTimerMem::TIMER_CTRL_CNTACR = 0x40
staticprivate

Definition at line 559 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTFRQ

const Addr GenericTimerMem::TIMER_CTRL_CNTFRQ = 0x00
staticprivate

Definition at line 556 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTNSAR

const Addr GenericTimerMem::TIMER_CTRL_CNTNSAR = 0x04
staticprivate

Definition at line 557 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTTIDR

const Addr GenericTimerMem::TIMER_CTRL_CNTTIDR = 0x08
staticprivate

Definition at line 558 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTVOFF_HI

const Addr GenericTimerMem::TIMER_CTRL_CNTVOFF_HI = 0x84
staticprivate

Definition at line 561 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ TIMER_CTRL_CNTVOFF_LO

const Addr GenericTimerMem::TIMER_CTRL_CNTVOFF_LO = 0x80
staticprivate

Definition at line 560 of file generic_timer.hh.

Referenced by timerCtrlRead(), and timerCtrlWrite().

◆ timerCtrlRange

const AddrRange GenericTimerMem::timerCtrlRange
private

Definition at line 551 of file generic_timer.hh.

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


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