gem5  v20.1.0.0
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ArmISA::PMU::CounterState Struct Reference

State of a counter within the PMU. More...

#include <pmu.hh>

Inheritance diagram for ArmISA::PMU::CounterState:
Serializable

Public Member Functions

 CounterState (PMU &pmuReference, uint64_t counter_id)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
uint64_t add (uint64_t delta)
 Add an event count to the counter and check for overflow. More...
 
bool isFiltered () const
 
void detach ()
 Detach the counter from its event. More...
 
void attach (PMUEvent *event)
 Attach this counter to an event. More...
 
uint64_t getCounterId () const
 Obtain the counter id. More...
 
uint64_t getValue () const
 rReturn the counter value More...
 
void setValue (uint64_t val)
 overwrite the value of the counter More...
 
- 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 Attributes

EventTypeId eventId
 Counter event ID. More...
 
PMEVTYPER_t filter
 Filtering settings (evtCount is unused) More...
 
bool enabled
 Is the counter enabled? More...
 
bool overflow64
 Is this a 64-bit counter? More...
 

Protected Member Functions

template<typename ... Args>
void debugCounter (const char *mainString, Args &...args) const
 

Protected Attributes

PMUEventsourceEvent
 PmuEvent currently in use (if any) More...
 
uint64_t counterId
 id of the counter instance More...
 
uint64_t value
 Current value of the counter. More...
 
bool resetValue
 Flag keeping track if the counter has been reset. More...
 
PMUpmu
 

Additional Inherited Members

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

Detailed Description

State of a counter within the PMU.

Definition at line 409 of file pmu.hh.

Constructor & Destructor Documentation

◆ CounterState()

ArmISA::PMU::CounterState::CounterState ( PMU pmuReference,
uint64_t  counter_id 
)
inline

Definition at line 410 of file pmu.hh.

Member Function Documentation

◆ add()

uint64_t ArmISA::PMU::CounterState::add ( uint64_t  delta)

Add an event count to the counter and check for overflow.

Parameters
deltaNumber of events to add to the counter.
Returns
the quantity remaining until a counter overflow occurs.

Definition at line 764 of file pmu.cc.

References ArmISA::PMU::isFiltered().

◆ attach()

void ArmISA::PMU::CounterState::attach ( PMUEvent event)

Attach this counter to an event.

Parameters
theevent to attach the counter to

Definition at line 531 of file pmu.cc.

References MipsISA::event.

Referenced by ArmISA::PMU::regProbeListeners(), and ArmISA::PMU::updateCounter().

◆ debugCounter()

template<typename ... Args>
void ArmISA::PMU::CounterState::debugCounter ( const char *  mainString,
Args &...  args 
) const
inlineprotected

Definition at line 493 of file pmu.hh.

References counterId, csprintf(), eventId, sourceEvent, and warn.

◆ detach()

void ArmISA::PMU::CounterState::detach ( )

Detach the counter from its event.

Definition at line 519 of file pmu.cc.

Referenced by ArmISA::PMU::updateCounter().

◆ getCounterId()

uint64_t ArmISA::PMU::CounterState::getCounterId ( ) const
inline

Obtain the counter id.

Returns
the pysical counter id

Definition at line 446 of file pmu.hh.

References counterId.

Referenced by ArmISA::PMU::updateCounter().

◆ getValue()

uint64_t ArmISA::PMU::CounterState::getValue ( ) const

rReturn the counter value

Returns
the counter value

Definition at line 542 of file pmu.cc.

Referenced by ArmISA::PMU::getCounterValue(), and ArmISA::PMU::readMiscRegInt().

◆ isFiltered()

bool ArmISA::PMU::CounterState::isFiltered ( ) const

◆ serialize()

void ArmISA::PMU::CounterState::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 748 of file pmu.cc.

References SERIALIZE_SCALAR.

◆ setValue()

void ArmISA::PMU::CounterState::setValue ( uint64_t  val)

overwrite the value of the counter

Parameters
thenew counter value

Definition at line 554 of file pmu.cc.

References X86ISA::val.

Referenced by ArmISA::PMU::setControlReg(), ArmISA::PMU::setCounterValue(), and ArmISA::PMU::setMiscReg().

◆ unserialize()

void ArmISA::PMU::CounterState::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 756 of file pmu.cc.

References UNSERIALIZE_SCALAR.

Member Data Documentation

◆ counterId

uint64_t ArmISA::PMU::CounterState::counterId
protected

id of the counter instance

Definition at line 482 of file pmu.hh.

Referenced by debugCounter(), and getCounterId().

◆ enabled

bool ArmISA::PMU::CounterState::enabled

Is the counter enabled?

Definition at line 472 of file pmu.hh.

Referenced by ArmISA::PMU::regProbeListeners(), ArmISA::PMU::updateAllCounters(), and ArmISA::PMU::updateCounter().

◆ eventId

EventTypeId ArmISA::PMU::CounterState::eventId

◆ filter

PMEVTYPER_t ArmISA::PMU::CounterState::filter

Filtering settings (evtCount is unused)

Definition at line 469 of file pmu.hh.

Referenced by ArmISA::PMU::getCounterTypeRegister(), and ArmISA::PMU::setCounterTypeRegister().

◆ overflow64

bool ArmISA::PMU::CounterState::overflow64

Is this a 64-bit counter?

Definition at line 475 of file pmu.hh.

◆ pmu

PMU& ArmISA::PMU::CounterState::pmu
protected

Definition at line 490 of file pmu.hh.

◆ resetValue

bool ArmISA::PMU::CounterState::resetValue
protected

Flag keeping track if the counter has been reset.

Definition at line 488 of file pmu.hh.

◆ sourceEvent

PMUEvent* ArmISA::PMU::CounterState::sourceEvent
protected

PmuEvent currently in use (if any)

Definition at line 479 of file pmu.hh.

Referenced by debugCounter().

◆ value

uint64_t ArmISA::PMU::CounterState::value
protected

Current value of the counter.

Definition at line 485 of file pmu.hh.


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

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