diff options
author | Pau Cabre <pau.cabre@metempsy.com> | 2018-11-22 14:48:30 +0100 |
---|---|---|
committer | Pau Cabre <pau.cabre@metempsy.com> | 2018-11-28 17:25:50 +0000 |
commit | 86b23a175c9985ecbfae710ba2b0fd6f629650df (patch) | |
tree | ad197ad4f892d6072a22217e4488a9276fdb41b5 /src/cpu/pred/ltage.hh | |
parent | b2078cef37f10ebe1822e3f2a372c780eab91a7e (diff) | |
download | gem5-86b23a175c9985ecbfae710ba2b0fd6f629650df.tar.xz |
cpu: Added new stats to TAGE and LTAGE branch predictors
They are basically used to tell wich component of the predictor is
providing the prediction and whether it is correct or wrong
Change-Id: I7b3db66535f159091f1b37d70c2d942d50b20fb2
Signed-off-by: Pau Cabre <pau.cabre@metempsy.com>
Reviewed-on: https://gem5-review.googlesource.com/c/14535
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/cpu/pred/ltage.hh')
-rw-r--r-- | src/cpu/pred/ltage.hh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cpu/pred/ltage.hh b/src/cpu/pred/ltage.hh index d614026d2..e9e34b75d 100644 --- a/src/cpu/pred/ltage.hh +++ b/src/cpu/pred/ltage.hh @@ -67,6 +67,8 @@ class LTAGE: public TAGE // Base class methods. void squash(ThreadID tid, void *bp_history) override; + void regStats() override; + private: // Prediction Structures // Loop Predictor Entry @@ -84,6 +86,11 @@ class LTAGE: public TAGE confidence(0), tag(0), age(0), dir(0) { } }; + // more provider types + enum { + LOOP = LAST_TAGE_PROVIDER_TYPE + 1 + }; + // Primary branch history entry struct LTageBranchInfo : public TageBranchInfo { @@ -177,6 +184,14 @@ class LTAGE: public TAGE void squash( ThreadID tid, bool taken, void *bp_history) override; + /** + * Update the stats + * @param taken Actual branch outcome + * @param bi Pointer to information on the prediction + * recorded at prediction time. + */ + void updateStats(bool taken, TageBranchInfo* bi) override; + const unsigned logSizeLoopPred; const unsigned loopTableAgeBits; const unsigned loopTableConfidenceBits; @@ -191,6 +206,10 @@ class LTAGE: public TAGE int8_t loopUseCounter; unsigned withLoopBits; + + // stats + Stats::Scalar loopPredictorCorrect; + Stats::Scalar loopPredictorWrong; }; #endif // __CPU_PRED_LTAGE |