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

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

#include <pmu.hh>

Inheritance diagram for gem5::ArmISA::PMU::CounterState:

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 (const std::shared_ptr< 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 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 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

std::shared_ptr< 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...

Additional Inherited Members

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

Detailed Description

State of a counter within the PMU.

Definition at line 414 of file pmu.hh.

Constructor & Destructor Documentation

◆ CounterState()

gem5::ArmISA::PMU::CounterState::CounterState ( PMU pmuReference,
uint64_t  counter_id 

Definition at line 416 of file pmu.hh.

Member Function Documentation

◆ add()

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

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

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

Definition at line 761 of file

References gem5::ArmISA::PMU::isFiltered().

◆ attach()

void gem5::ArmISA::PMU::CounterState::attach ( const std::shared_ptr< PMUEvent > &  event)

Attach this counter to an event.

theevent to attach the counter to

Definition at line 528 of file

References gem5::MipsISA::event.

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

◆ debugCounter()

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

Definition at line 499 of file pmu.hh.

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

◆ detach()

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

Detach the counter from its event.

Definition at line 516 of file

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

◆ getCounterId()

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

Obtain the counter id.

the pysical counter id

Definition at line 452 of file pmu.hh.

References counterId.

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

◆ getValue()

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

rReturn the counter value

the counter value

Definition at line 539 of file

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

◆ isFiltered()

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

◆ serialize()

void gem5::ArmISA::PMU::CounterState::serialize ( CheckpointOut cp) const

Serialize an object.

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

cpCheckpoint state

Implements gem5::Serializable.

Definition at line 745 of file


◆ setValue()

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

overwrite the value of the counter

thenew counter value

Definition at line 551 of file

References gem5::X86ISA::val.

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

◆ unserialize()

void gem5::ArmISA::PMU::CounterState::unserialize ( CheckpointIn cp)

Unserialize an object.

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

cpCheckpoint state

Implements gem5::Serializable.

Definition at line 753 of file


Member Data Documentation

◆ counterId

uint64_t gem5::ArmISA::PMU::CounterState::counterId

id of the counter instance

Definition at line 488 of file pmu.hh.

Referenced by debugCounter(), and getCounterId().

◆ enabled

bool gem5::ArmISA::PMU::CounterState::enabled

◆ eventId

EventTypeId gem5::ArmISA::PMU::CounterState::eventId

◆ filter

PMEVTYPER_t gem5::ArmISA::PMU::CounterState::filter

Filtering settings (evtCount is unused)

Definition at line 475 of file pmu.hh.

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

◆ overflow64

bool gem5::ArmISA::PMU::CounterState::overflow64

Is this a 64-bit counter?

Definition at line 481 of file pmu.hh.

◆ pmu

PMU& gem5::ArmISA::PMU::CounterState::pmu

Definition at line 496 of file pmu.hh.

◆ resetValue

bool gem5::ArmISA::PMU::CounterState::resetValue

Flag keeping track if the counter has been reset.

Definition at line 494 of file pmu.hh.

◆ sourceEvent

std::shared_ptr<PMUEvent> gem5::ArmISA::PMU::CounterState::sourceEvent

PmuEvent currently in use (if any)

Definition at line 485 of file pmu.hh.

Referenced by debugCounter().

◆ value

uint64_t gem5::ArmISA::PMU::CounterState::value

Current value of the counter.

Definition at line 491 of file pmu.hh.

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

Generated on Thu Jul 28 2022 13:33:22 for gem5 by doxygen 1.8.17