diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2014-10-16 05:49:40 -0400 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2014-10-16 05:49:40 -0400 |
commit | 76b0ff9ecd8bd4818dff8a3cc811bee547b643b4 (patch) | |
tree | d59cdf33b5f0109ef7ead33e81ed5c95aee423f8 /src/cpu/pred/bpred_unit.hh | |
parent | 3697990c27243f0c454f2fab0f12ed06759c97b9 (diff) | |
download | gem5-76b0ff9ecd8bd4818dff8a3cc811bee547b643b4.tar.xz |
cpu: Add branch predictor PMU probe points
This changeset adds probe points that can be used to implement PMU
counters for branch predictor stats. The following probes are
supported:
* BPRedUnit::ppBranches / Branches
* BPRedUnit::ppMisses / Misses
Diffstat (limited to 'src/cpu/pred/bpred_unit.hh')
-rw-r--r-- | src/cpu/pred/bpred_unit.hh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/cpu/pred/bpred_unit.hh b/src/cpu/pred/bpred_unit.hh index bca64cce0..851cdbb78 100644 --- a/src/cpu/pred/bpred_unit.hh +++ b/src/cpu/pred/bpred_unit.hh @@ -56,6 +56,7 @@ #include "cpu/inst_seq.hh" #include "cpu/static_inst.hh" #include "params/BranchPredictor.hh" +#include "sim/probe/pmu.hh" #include "sim/sim_object.hh" /** @@ -76,6 +77,8 @@ class BPredUnit : public SimObject */ void regStats(); + void regProbePoints() M5_ATTR_OVERRIDE; + /** Perform sanity checks after a drain. */ void drainSanityCheck() const; @@ -290,6 +293,34 @@ class BPredUnit : public SimObject Stats::Scalar usedRAS; /** Stat for number of times the RAS is incorrect. */ Stats::Scalar RASIncorrect; + + protected: + /** + * @{ + * @name PMU Probe points. + */ + + /** + * 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); + + + /** + * Branches seen by the branch predictor + * + * @note This counter includes speculative branches. + */ + ProbePoints::PMUUPtr ppBranches; + + /** Miss-predicted branches */ + ProbePoints::PMUUPtr ppMisses; + + /** @} */ }; #endif // __CPU_PRED_BPRED_UNIT_HH__ |