Emily Brickey has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33936 )

Change subject: cpu: convert statistical_corrector to new style stats
......................................................................

cpu: convert statistical_corrector to new style stats

Change-Id: Id9e075fb45babeeafe65105679c8bf2135823d41
---
M src/cpu/pred/statistical_corrector.cc
M src/cpu/pred/statistical_corrector.hh
2 files changed, 17 insertions(+), 18 deletions(-)



diff --git a/src/cpu/pred/statistical_corrector.cc b/src/cpu/pred/statistical_corrector.cc
index 8ddae9b..8e1066a 100644
--- a/src/cpu/pred/statistical_corrector.cc
+++ b/src/cpu/pred/statistical_corrector.cc
@@ -65,7 +65,8 @@
     extraWeightsWidth(p->extraWeightsWidth),
     scCountersWidth(p->scCountersWidth),
     firstH(0),
-    secondH(0)
+    secondH(0),
+    stats(this)
 {
     wb.resize(1 << logSizeUps, 4);

@@ -376,9 +377,9 @@
 StatisticalCorrector::updateStats(bool taken, BranchInfo *bi)
 {
     if (taken == bi->scPred) {
-        scPredictorCorrect++;
+        stats.correct++;
     } else {
-        scPredictorWrong++;
+        stats.wrong++;
     }
 }

@@ -396,16 +397,12 @@
     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");
 }
diff --git a/src/cpu/pred/statistical_corrector.hh b/src/cpu/pred/statistical_corrector.hh
index 2e8e502..b61f0d8 100644
--- a/src/cpu/pred/statistical_corrector.hh
+++ b/src/cpu/pred/statistical_corrector.hh
@@ -182,9 +182,12 @@
     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
     {
@@ -260,7 +263,6 @@
         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,

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33936
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id9e075fb45babeeafe65105679c8bf2135823d41
Gerrit-Change-Number: 33936
Gerrit-PatchSet: 1
Gerrit-Owner: Emily Brickey <esbric...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to