diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2014-10-16 05:49:41 -0400 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2014-10-16 05:49:41 -0400 |
commit | e0074324bacf500f9d0cc11ebc6e2f29bf3d8ba1 (patch) | |
tree | 0ecfcd3d7e3633251a8f632fe7ee5542a67fb8df /src/cpu/base.hh | |
parent | 9d35d48e848914fd6cf18b016cb9125c50e422c0 (diff) | |
download | gem5-e0074324bacf500f9d0cc11ebc6e2f29bf3d8ba1.tar.xz |
cpu: Probe points for basic PMU stats
This changeset adds probe points that can be used to implement PMU
counters for CPU stats. The following probes are supported:
* BaseCPU::ppCycles / Cycles
* BaseCPU::ppRetiredInsts / RetiredInsts
* BaseCPU::ppRetiredLoads / RetiredLoads
* BaseCPU::ppRetiredStores / RetiredStores
* BaseCPU::ppRetiredBranches RetiredBranches
Diffstat (limited to 'src/cpu/base.hh')
-rw-r--r-- | src/cpu/base.hh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh index a124b4282..75c8f7263 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -62,6 +62,7 @@ #include "sim/eventq.hh" #include "sim/full_system.hh" #include "sim/insttracer.hh" +#include "sim/probe/pmu.hh" #include "sim/system.hh" struct BaseCPUParams; @@ -280,6 +281,8 @@ class BaseCPU : public MemObject virtual void startup(); virtual void regStats(); + void regProbePoints() M5_ATTR_OVERRIDE; + void registerThreadContexts(); /** @@ -437,6 +440,54 @@ class BaseCPU : public MemObject */ void scheduleLoadStop(ThreadID tid, Counter loads, const char *cause); + public: + /** + * @{ + * @name PMU Probe points. + */ + + /** + * Helper method to trigger PMU probes for a committed + * instruction. + * + * @param inst Instruction that just committed + */ + virtual void probeInstCommit(const StaticInstPtr &inst); + + /** + * Helper method to instantiate probe points belonging to this + * object. + * + * @param name Name of the probe point. + * @return A unique_ptr to the new probe point. + */ + ProbePoints::PMUUPtr pmuProbePoint(const char *name); + + /** CPU cycle counter */ + ProbePoints::PMUUPtr ppCycles; + + /** + * Instruction commit probe point. + * + * This probe point is triggered whenever one or more instructions + * are committed. It is normally triggered once for every + * instruction. However, CPU models committing bundles of + * instructions may call notify once for the entire bundle. + */ + ProbePoints::PMUUPtr ppRetiredInsts; + + /** Retired load instructions */ + ProbePoints::PMUUPtr ppRetiredLoads; + /** Retired store instructions */ + ProbePoints::PMUUPtr ppRetiredStores; + + /** Retired branches (any type) */ + ProbePoints::PMUUPtr ppRetiredBranches; + + /** @} */ + + + // Function tracing private: bool functionTracingEnabled; |