diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2014-12-23 09:31:17 -0500 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2014-12-23 09:31:17 -0500 |
commit | 070b4a81dbf9cc040ecb771e128993ae519cf80f (patch) | |
tree | d3f7f059aafb0dff016a0486166d71c34bc8abc2 /src/arch/arm/pmu.hh | |
parent | 809134a2b151f82c29593e64086393b31bc110b7 (diff) | |
download | gem5-070b4a81dbf9cc040ecb771e128993ae519cf80f.tar.xz |
arm: Add support for filtering in the PMU
This patch adds support for filtering events in the PMU. In order to
do so, it updates the ISADevice base class to forward an ISA pointer
to ISA devices. This enables such devices to access the MiscReg file
to determine the current execution level.
Diffstat (limited to 'src/arch/arm/pmu.hh')
-rw-r--r-- | src/arch/arm/pmu.hh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/arch/arm/pmu.hh b/src/arch/arm/pmu.hh index 989ad76c6..94f8c2397 100644 --- a/src/arch/arm/pmu.hh +++ b/src/arch/arm/pmu.hh @@ -323,7 +323,7 @@ class PMU : public SimObject, public ArmISA::BaseISADevice { /** State of a counter within the PMU. */ struct CounterState { CounterState() - : eventId(0), value(0), enabled(false), + : eventId(0), filter(0), value(0), enabled(false), overflow64(false) { listeners.reserve(4); @@ -344,6 +344,9 @@ class PMU : public SimObject, public ArmISA::BaseISADevice { /** Counter event ID */ EventTypeId eventId; + /** Filtering settings (evtCount is unused) */ + PMEVTYPER_t filter; + /** Current value of the counter */ uint64_t value; @@ -422,6 +425,14 @@ class PMU : public SimObject, public ArmISA::BaseISADevice { void updateCounter(CounterId id, CounterState &ctr); /** + * Check if a counter's settings allow it to be counted. + * + * @param ctr Counter state instance representing this counter. + * @return false if the counter is active, true otherwise. + */ + bool isFiltered(const CounterState &ctr) const; + + /** * Call updateCounter() for each counter in the PMU if the * counter's state has changed.. * |