Jason Lowe-Power has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/33398 )
Change subject: cpu-o3: convert rob to new style stats
..
cpu-o3: convert rob to new style stats
Change-Id: I84430d50c49742cd536dd75ce25184c2316dce51
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33398
Reviewed-by: Andreas Sandberg
Maintainer: Andreas Sandberg
Tested-by: kokoro
---
M src/cpu/o3/cpu.cc
M src/cpu/o3/rob.hh
M src/cpu/o3/rob_impl.hh
3 files changed, 19 insertions(+), 23 deletions(-)
Approvals:
Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index c5b4a82..bbc6b82 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -443,7 +443,6 @@
this->rename.regStats();
this->iew.regStats();
-this->rob.regStats();
intRegfileReads
.name(name() + ".int_regfile_reads")
diff --git a/src/cpu/o3/rob.hh b/src/cpu/o3/rob.hh
index eb8d1d6..4b87dc4 100644
--- a/src/cpu/o3/rob.hh
+++ b/src/cpu/o3/rob.hh
@@ -257,9 +257,6 @@
*/
size_t countInsts(ThreadID tid);
-/** Registers statistics. */
-void regStats();
-
private:
/** Reset the ROB state */
void resetState();
@@ -323,10 +320,15 @@
/** Number of active threads. */
ThreadID numThreads;
-// The number of rob_reads
-Stats::Scalar robReads;
-// The number of rob_writes
-Stats::Scalar robWrites;
+
+struct ROBStats : public Stats::Group {
+ROBStats(Stats::Group *parent);
+
+// The number of rob_reads
+Stats::Scalar reads;
+// The number of rob_writes
+Stats::Scalar writes;
+} stats;
};
#endif //__CPU_O3_ROB_HH__
diff --git a/src/cpu/o3/rob_impl.hh b/src/cpu/o3/rob_impl.hh
index 80ea1e6..bfc368b 100644
--- a/src/cpu/o3/rob_impl.hh
+++ b/src/cpu/o3/rob_impl.hh
@@ -58,7 +58,8 @@
numEntries(params->numROBEntries),
squashWidth(params->squashWidth),
numInstsInROB(0),
- numThreads(params->numThreads)
+ numThreads(params->numThreads),
+ stats(_cpu)
{
//Figure out rob policy
if (robPolicy == SMTQueuePolicy::Dynamic) {
@@ -204,7 +205,7 @@
{
assert(inst);
-robWrites++;
+stats.writes++;
DPRINTF(ROB, "Adding inst PC %s to the ROB.\n", inst->pcState());
@@ -239,7 +240,7 @@
void
ROB::retireHead(ThreadID tid)
{
-robWrites++;
+stats.writes++;
assert(numInstsInROB > 0);
@@ -274,7 +275,7 @@
bool
ROB::isHeadReady(ThreadID tid)
{
-robReads++;
+stats.reads++;
if (threadEntries[tid] != 0) {
return instList[tid].front()->readyToCommit();
}
@@ -319,7 +320,7 @@
void
ROB::doSquash(ThreadID tid)
{
-robWrites++;
+stats.writes++;
DPRINTF(ROB, "[tid:%i] Squashing instructions until [sn:%llu].\n",
tid, squashedSeqNum[tid]);
@@ -528,17 +529,11 @@
}
template
-void
-ROB::regStats()
+ROB::ROBStats::ROBStats(Stats::Group *parent)
+: Stats::Group(parent, "rob"),
+ ADD_STAT(reads, "The number of ROB reads"),
+ ADD_STAT(writes, "The number of ROB writes")
{
-using namespace Stats;
-robReads
-.name(name() + ".rob_reads")
-.desc("The number of ROB reads");
-
-robWrites
-.name(name() + ".rob_writes")
-.desc("The number of ROB writes");
}
template
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33398
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: I84430d50c49742cd536dd75ce25184c2316dce51
Gerrit-Change-Number: 33398
Gerrit-PatchSet: 4
Gerrit-Owner: Emily Brickey
Gerrit-Reviewer: Andreas Sandberg
Gerrit-Reviewer: Bobby R. Bruce
Gerrit-Reviewer: Jason Lowe-Power
Gerrit-Reviewer: kokoro
Gerrit-MessageType: merged
___
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