Go to the documentation of this file.
38 #ifndef __ARCH_ARM_PMU_HH__
39 #define __ARCH_ARM_PMU_HH__
50 #include "debug/PMUVerbose.hh"
96 PMU(
const ArmPMUParams *
p);
183 typedef
unsigned int CounterId;
324 virtual void enable() = 0;
349 panic_if(!
object,
"malformed probe-point"
350 " definition with name %s\n",
name);
406 PMUEvent*
getEvent(uint64_t eventId);
425 uint64_t
add(uint64_t delta);
492 template <
typename ...Args>
495 std::string userString =
csprintf(mainString, args...);
497 warn(
"[counterId = %d, eventId = %d, sourceEvent = 0x%x] %s",
558 bool isFiltered(
const CounterState &ctr)
const;
virtual void disable()=0
Disable the current event.
void registerEvent(uint32_t id)
void attach(PMUEvent *event)
Attach this counter to an event.
void regProbeListeners() override
Register probe listeners for this object.
uint64_t maximumCounterCount
The number of regular event counters.
void enable() override
Enable the current event.
uint64_t getValue() const
rReturn the counter value
EndBitUnion(PMCR_t) BitUnion32(PMSELR_t) Bitfield< 4
Base class for devices that use the MiscReg interfaces.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
PMU(const ArmPMUParams *p)
RegularEvent * parentEvent
void addEventProbe(unsigned int id, SimObject *obj, const char *name)
uint64_t getCounterValue(CounterId id) const
Get the value of a performance counter.
CounterState & getCounter(CounterId id)
Return the state of a counter.
Basic support for object serialization.
const CounterState & getCounter(CounterId id) const
Return the state of a counter.
void addSoftwareIncrementEvent(unsigned int id)
void drainResume() override
Resume execution after a successful drain.
void write(uint64_t val)
write on the sw increment register inducing an increment of the counters with this event selected acc...
CounterState(PMU &pmuReference, uint64_t counter_id)
void updateCounter(CounterState &ctr)
Depending on counter configuration, add or remove the probes driving the counter.
PMEVTYPER_t getCounterTypeRegister(CounterId id) const
Get the type and filter settings of a counter (PMEVTYPER)
State of a counter within the PMU.
virtual void updateAttachedCounters()
Method called immediately before a counter access in order for the associated event to update its sta...
RegVal reg_pmcnten
Performance Monitor Count Enable Register.
std::vector< std::unique_ptr< RegularProbe > > attachedProbePointList
Set of probe listeners tapping onto each of the input micro-arch events which compose this pmu event.
std::map< EventTypeId, PMUEvent * > eventMap
List of event types supported by this PMU.
std::set< EventTypeEntry > microArchitectureEventSet
The set of events driving the event value.
void resetEventCounts()
Reset all event counters excluding the cycle counter to zero.
unsigned clock_remainder
Remainder part when the clock counter is divided by 64.
RegularProbe(RegularEvent *parent, SimObject *obj, std::string name)
void notify(const uint64_t &val)
virtual void increment(const uint64_t val)
notify an event increment of val units, all the attached counters' value is incremented by val units.
bool isFiltered(const CounterState &ctr) const
Check if a counter's settings allow it to be counted.
std::set< PMU::CounterState * > userCounters
set of counters using this event
EventTypeId eventId
Counter event ID.
uint64_t reg_pmceid0
Performance counter ID register.
void setMiscReg(int misc_reg, RegVal val) override
Set a register within the PMU.
void clearInterrupt()
Clear a PMU interrupt.
Model of an ARM PMU version 3.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
bool isValidCounter(CounterId id) const
Is this a valid counter ID?
BitUnion32(PMCR_t) Bitfield< 0 > e
Bitfield< 23, 16 > idcode
const uint64_t cycleCounterEventId
The id of the counter hardwired to the cpu cycle counter.
void serialize(CheckpointOut &cp) const override
Serialize an object.
CounterState cycleCounter
State of the cycle counter.
uint64_t add(uint64_t delta)
Add an event count to the counter and check for overflow.
Event definition base class.
void disable() override
Disable the current event.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void updateAllCounters()
Call updateCounter() for each counter in the PMU if the counter's state has changed.
void setControlReg(PMCR_t val)
PMCR write handling.
std::pair< SimObject *, std::string > EventTypeEntry
unsigned int EventTypeId
Event type ID.
uint64_t getCounterId() const
Obtain the counter id.
uint64_t counterId
id of the counter instance
void detach()
Detach the counter from its event.
void enable() override
Enable the current event.
bool overflow64
Is this a 64-bit counter?
RegVal readMiscRegInt(int misc_reg)
bool resetValue
Flag keeping track if the counter has been reset.
ProbeManager * getProbeManager()
Get the probe manager for this object.
std::vector< CounterState > counters
State of all general-purpose counters supported by PMU.
void setCounterValue(CounterId id, uint64_t val)
Set the value of a performance counter.
void setOverflowStatus(RegVal new_val)
Used for writing the Overflow Flag Status Register (SET/CLR)
void attachEvent(PMU::CounterState *user)
attach this event to a given counter
virtual const std::string name() const
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
PMUEvent * getEvent(uint64_t eventId)
Obtain the event of a given id.
void detachEvent(PMU::CounterState *user)
detach this event from a given counter
bool enabled
Is the counter enabled?
SWIncrementEvent * swIncrementEvent
The event that implements the software increment.
void debugCounter(const char *mainString, Args &...args) const
PMSELR_t reg_pmselr
Performance Monitor Selection Register.
void setValue(uint64_t val)
overwrite the value of the counter
PMCR_t reg_pmcr
Performance Monitor Control Register.
RegVal reg_pminten
Performance Monitor Interrupt Enable Register.
PMCR_t reg_pmcr_conf
Constant (configuration-dependent) part of the PMCR.
Generic representation of an Arm interrupt pin.
void disable() override
Disable the current event.
static const CounterId PMCCNTR
Cycle Count Register Number.
uint64_t value
Current value of the counter.
virtual void enable()=0
Enable the current event.
std::ostream CheckpointOut
void setThreadContext(ThreadContext *tc) override
ArmInterruptPin * interrupt
Performance monitor interrupt number.
RegVal readMiscReg(int misc_reg) override
Read a register within the PMU.
void raiseInterrupt()
Deliver a PMU interrupt to the GIC.
PMEVTYPER_t filter
Filtering settings (evtCount is unused)
RegVal reg_pmovsr
Performance Monitor Overflow Status Register.
void addMicroarchitectureProbe(SimObject *object, std::string name)
std::string csprintf(const char *format, const Args &...args)
static const RegVal reg_pmcr_wr_mask
PMCR write mask when accessed from the guest.
void serialize(CheckpointOut &cp) const override
Serialize an object.
PMUEvent * sourceEvent
PmuEvent currently in use (if any)
void setCounterTypeRegister(CounterId id, PMEVTYPER_t type)
Set the type and filter settings of a performance counter (PMEVTYPER)
Abstract superclass for simulation objects.
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17