extraWeightsWidth(p->extraWeightsWidth),
scCountersWidth(p->scCountersWidth),
firstH(0),
- secondH(0)
+ secondH(0),
+ stats(this)
{
wb.resize(1 << logSizeUps, 4);
StatisticalCorrector::updateStats(bool taken, BranchInfo *bi)
{
if (taken == bi->scPred) {
- scPredictorCorrect++;
+ stats.correct++;
} else {
- scPredictorWrong++;
+ stats.wrong++;
}
}
return 0;
}
-void
-StatisticalCorrector::regStats()
+StatisticalCorrector::StatisticalCorrectorStats::StatisticalCorrectorStats(
+ Stats::Group *parent)
+ : Stats::Group(parent),
+ ADD_STAT(correct, "Number of time the SC predictor is the"
+ " provider and the prediction is correct"),
+ ADD_STAT(wrong, "Number of time the SC predictor is the"
+ " provider and the prediction is wrong")
{
- scPredictorCorrect
- .name(name() + ".scPredictorCorrect")
- .desc("Number of time the SC predictor is the provider and "
- "the prediction is correct");
-
- scPredictorWrong
- .name(name() + ".scPredictorWrong")
- .desc("Number of time the SC predictor is the provider and "
- "the prediction is wrong");
}
int8_t firstH;
int8_t secondH;
- // stats
- Stats::Scalar scPredictorCorrect;
- Stats::Scalar scPredictorWrong;
+ struct StatisticalCorrectorStats : public Stats::Group {
+ StatisticalCorrectorStats(Stats::Group *parent);
+ Stats::Scalar correct;
+ Stats::Scalar wrong;
+ } stats;
+
public:
struct BranchInfo
{
int64_t phist) = 0;
void init() override;
- void regStats() override;
void updateStats(bool taken, BranchInfo *bi);
virtual void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken,