From 86b23a175c9985ecbfae710ba2b0fd6f629650df Mon Sep 17 00:00:00 2001 From: Pau Cabre Date: Thu, 22 Nov 2018 14:48:30 +0100 Subject: 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 Reviewed-on: https://gem5-review.googlesource.com/c/14535 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/cpu/pred/ltage.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/cpu/pred/ltage.hh') 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 -- cgit v1.2.3