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_impl.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_impl.hh')
-rw-r--r-- | src/cpu/pred/bpred_unit_impl.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cpu/pred/bpred_unit_impl.hh b/src/cpu/pred/bpred_unit_impl.hh index 53ec808b6..4d17bfd33 100644 --- a/src/cpu/pred/bpred_unit_impl.hh +++ b/src/cpu/pred/bpred_unit_impl.hh @@ -119,6 +119,22 @@ BPredUnit::regStats() ; } +ProbePoints::PMUUPtr +BPredUnit::pmuProbePoint(const char *name) +{ + ProbePoints::PMUUPtr ptr; + ptr.reset(new ProbePoints::PMU(getProbeManager(), name)); + + return ptr; +} + +void +BPredUnit::regProbePoints() +{ + ppBranches = pmuProbePoint("Branches"); + ppMisses = pmuProbePoint("Misses"); +} + void BPredUnit::drainSanityCheck() const { @@ -141,6 +157,7 @@ BPredUnit::predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, TheISA::PCState target = pc; ++lookups; + ppBranches->notify(1); void *bp_history = NULL; @@ -259,6 +276,8 @@ BPredUnit::predictInOrder(const StaticInstPtr &inst, const InstSeqNum &seqNum, TheISA::PCState target; ++lookups; + ppBranches->notify(1); + DPRINTF(Branch, "[tid:%i] [sn:%i] %s ... PC %s doing branch " "prediction\n", tid, seqNum, inst->disassemble(instPC.instAddr()), instPC); @@ -438,6 +457,7 @@ BPredUnit::squash(const InstSeqNum &squashed_sn, History &pred_hist = predHist[tid]; ++condIncorrect; + ppMisses->notify(1); DPRINTF(Branch, "[tid:%i]: Squashing from sequence number %i, " "setting target to %s.\n", tid, squashed_sn, corrTarget); |