Bobby Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/69106?usp=email )
Change subject: cpu: Remove duplicated commit stats
......................................................................
cpu: Remove duplicated commit stats
This removes committedInstType and comittedControl from minor CPU,
stat branches from O3 commit stage, and O3 commit stats floating,
integer, loads, memRefs, and vectorInstructions.
M src/cpu/minor/execute.cc
M src/cpu/minor/stats.cc
M src/cpu/minor/stats.hh
M src/cpu/o3/commit.cc
M src/cpu/o3/commit.hh
M src/cpu/simple/base.cc
M src/cpu/simple/exec_context.hh
7 files changed, 1 insertion(+), 177 deletions(-)
Approvals:
Bobby Bruce: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc
index 0d704c7..a2f9268 100644
--- a/src/cpu/minor/execute.cc
+++ b/src/cpu/minor/execute.cc
@@ -882,46 +882,10 @@
thread->numOp++;
thread->threadStats.numOps++;
cpu.stats.numOps++;
[inst->staticInst->opClass()]++;
if (inst->staticInst->isReturn()) {
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsReturn]++;
}
if (inst->staticInst->isCall()) {
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsCall]++;
}
if (inst->staticInst->isDirectCtrl()) {
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsDirectControl]++;
}
if (inst->staticInst->isIndirectCtrl()) {
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsIndirectControl]++;
}
if (inst->staticInst->isCondCtrl()) {
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsCondControl]++;
}
if (inst->staticInst->isUncondCtrl()) {
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsUncondControl]++;
}
cpu.stats.committedControl[inst->id.threadId]
[gem5::StaticInstFlags::Flags::IsControl]++;
/* Set the CP SeqNum to the numOps commit number */
if (inst->traceData)
diff --git a/src/cpu/minor/stats.cc b/src/cpu/minor/stats.cc
index e9ca562..512a67b 100644
--- a/src/cpu/minor/stats.cc
+++ b/src/cpu/minor/stats.cc
@@ -60,11 +60,7 @@
"CPI: cycles per instruction"),
ADD_STAT(ipc, statistics::units::Rate<
statistics::units::Count, statistics::units::Cycle>::get(),
"IPC: instructions per cycle"),
"Class of committed instruction"),
"Class of control type instructions committed")
"IPC: instructions per cycle")
{
quiesceCycles.prereq(quiesceCycles);
@@ -74,16 +70,6 @@
ipc.precision(6);
ipc = numInsts / base_cpu->baseStats.numCycles;
.init(base_cpu->numThreads, enums::Num_OpClass)
.flags(statistics::total | statistics::pdf | statistics::dist);
.init(base_cpu->numThreads, StaticInstFlags::Flags::Num_Flags)
.flags(statistics::nozero);
} // namespace minor
diff --git a/src/cpu/minor/stats.hh b/src/cpu/minor/stats.hh
index 524d20f..4ab8743 100644
--- a/src/cpu/minor/stats.hh
+++ b/src/cpu/minor/stats.hh
@@ -75,12 +75,6 @@
statistics::Formula cpi;
statistics::Formula ipc;
/** Number of instructions by type (OpClass) */
statistics::Vector2d committedInstType;
/** Number of branches commited */
statistics::Vector2d committedControl;
};
} // namespace minor
diff --git a/src/cpu/o3/commit.cc b/src/cpu/o3/commit.cc
index 82ecc01..5a0a6b2 100644
--- a/src/cpu/o3/commit.cc
+++ b/src/cpu/o3/commit.cc
@@ -160,21 +160,10 @@
"Number of instructions committed"),
ADD_STAT(opsCommitted, statistics::units::Count::get(),
"Number of ops (including micro ops) committed"),
ADD_STAT(memRefs, statistics::units::Count::get(),
"Number of memory references committed"),
ADD_STAT(loads, statistics::units::Count::get(), "Number of loads
committed"),
ADD_STAT(amos, statistics::units::Count::get(),
"Number of atomic instructions committed"),
ADD_STAT(membars, statistics::units::Count::get(),
"Number of memory barriers committed"),
ADD_STAT(branches, statistics::units::Count::get(),
"Number of branches committed"),
ADD_STAT(vectorInstructions, statistics::units::Count::get(),
"Number of committed Vector instructions."),
ADD_STAT(floating, statistics::units::Count::get(),
"Number of committed floating point instructions."),
ADD_STAT(integer, statistics::units::Count::get(),
"Number of committed integer instructions."),
ADD_STAT(functionCalls, statistics::units::Count::get(),
"Number of function calls committed."),
ADD_STAT(committedInstType, statistics::units::Count::get(),
@@ -200,14 +189,6 @@
.init(cpu->numThreads)
.flags(total);
.init(cpu->numThreads)
.flags(total);
.init(cpu->numThreads)
.flags(total);
amos
.init(cpu->numThreads)
.flags(total);
@@ -216,22 +197,6 @@
.init(cpu->numThreads)
.flags(total);
.init(cpu->numThreads)
.flags(total);
.init(cpu->numThreads)
.flags(total);
.init(cpu->numThreads)
.flags(total);
.init(cpu->numThreads)
.flags(total);
functionCalls
.init(commit->numThreads)
.flags(total);
@@ -1405,29 +1370,18 @@
//
// Control Instructions
//
// update both old and new stats
cpu->commitStats[tid]->updateComCtrlStats(inst->staticInst);
if (inst->isControl())
stats.branches[tid]++;
//
// Memory references
//
if (inst->isMemRef()) {
// update both old and new stats
stats.memRefs[tid]++;
cpu->commitStats[tid]->numMemRefs++;
if (inst->isLoad()) {
// update both old and new stats
stats.loads[tid]++;
cpu->commitStats[tid]->numLoadInsts++;
}
if (inst->isAtomic()) {
stats.amos[tid]++;
}
if (inst->isStore()) {
cpu->commitStats[tid]->numStoreInsts++;
}
@@ -1439,22 +1393,16 @@
// Integer Instruction
if (inst->isInteger()) {
// update both old and new stats
cpu->commitStats[tid]->numIntInsts++;
stats.integer[tid]++;
}
// Floating Point Instruction
if (inst->isFloating()) {
// update both old and new stats
cpu->commitStats[tid]->numFpInsts++;
stats.floating[tid]++;
}
// Vector Instruction
if (inst->isVector()) {
// update both old and new stats
cpu->commitStats[tid]->numVecInsts++;
stats.vectorInstructions[tid]++;
}
// Function Calls
diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh
index cf4eaf5..6591360 100644
--- a/src/cpu/o3/commit.hh
+++ b/src/cpu/o3/commit.hh
@@ -483,22 +483,10 @@
statistics::Vector instsCommitted;
/** Total number of ops (including micro ops) committed. */
statistics::Vector opsCommitted;
/** Stat for the total number of committed memory references. */
statistics::Vector memRefs;
/** Stat for the total number of committed loads. */
statistics::Vector loads;
/** Stat for the total number of committed atomics. */
statistics::Vector amos;
/** Total number of committed memory barriers. */
statistics::Vector membars;
/** Total number of committed branches. */
statistics::Vector branches;
/** Total number of vector instructions */
statistics::Vector vectorInstructions;
/** Total number of floating point instructions */
statistics::Vector floating;
/** Total number of integer instructions */
statistics::Vector integer;
/** Total number of function calls */
statistics::Vector functionCalls;
/** Committed instructions by instruction type (OpClass) */
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 4f26654..eeb927f 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -437,29 +437,23 @@
/* Power model statistics */
//integer alu accesses
if (curStaticInst->isInteger()){
// update both old and new stats
executeStats[t_info.thread->threadId()]->numIntAluAccesses++;
commitStats[t_info.thread->threadId()]->numIntInsts++;
t_info.execContextStats.numIntAluAccesses++;
t_info.execContextStats.numIntInsts++;
}
//float alu accesses
if (curStaticInst->isFloating()){
// update both old and new stats
executeStats[t_info.thread->threadId()]->numFpAluAccesses++;
commitStats[t_info.thread->threadId()]->numFpInsts++;
t_info.execContextStats.numFpAluAccesses++;
t_info.execContextStats.numFpInsts++;
}
//vector alu accesses
if (curStaticInst->isVector()){
// update both old and new stats
executeStats[t_info.thread->threadId()]->numVecAluAccesses++;
commitStats[t_info.thread->threadId()]->numVecInsts++;
t_info.execContextStats.numVecAluAccesses++;
t_info.execContextStats.numVecInsts++;
}
//Matrix alu accesses
@@ -473,30 +467,19 @@
t_info.execContextStats.numCallsReturns++;
}
//the number of branch predictions that will be made
if (curStaticInst->isCondCtrl()){
t_info.execContextStats.numCondCtrlInsts++;
}
//result bus acceses
if (curStaticInst->isLoad()){
// update both old and new stats
commitStats[t_info.thread->threadId()]->numLoadInsts++;
t_info.execContextStats.numLoadInsts++;
}
if (curStaticInst->isStore() || curStaticInst->isAtomic()){
// update both old and new stats
commitStats[t_info.thread->threadId()]->numStoreInsts++;
t_info.execContextStats.numStoreInsts++;
}
/* End power model statistics */
// update both old and new stats
commitStats[t_info.thread->threadId()]
->committedInstType[curStaticInst->opClass()]++;
t_info.execContextStats.statExecutedInstType[curStaticInst->opClass()]++;
/* increment the committed numInsts and numOps stats */
countCommitInst();
diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh
index 3b6593d..78952cb 100644
--- a/src/cpu/simple/exec_context.hh
+++ b/src/cpu/simple/exec_context.hh
@@ -100,14 +100,6 @@
"Number of matrix alu accesses"),
ADD_STAT(numCallsReturns, statistics::units::Count::get(),
"Number of times a function call or return
occured"),
ADD_STAT(numCondCtrlInsts, statistics::units::Count::get(),
"Number of instructions that are conditional
controls"),
ADD_STAT(numIntInsts, statistics::units::Count::get(),
"Number of integer instructions"),
ADD_STAT(numFpInsts, statistics::units::Count::get(),
"Number of float instructions"),
ADD_STAT(numVecInsts, statistics::units::Count::get(),
"Number of vector instructions"),
ADD_STAT(numMatInsts, statistics::units::Count::get(),
"Number of matrix instructions"),
ADD_STAT(numIntRegReads, statistics::units::Count::get(),
@@ -136,10 +128,6 @@
"Number of times the Misc registers were written"),
ADD_STAT(numMemRefs, statistics::units::Count::get(),
"Number of memory refs"),
ADD_STAT(numLoadInsts, statistics::units::Count::get(),
"Number of load instructions"),
ADD_STAT(numStoreInsts, statistics::units::Count::get(),
"Number of store instructions"),
ADD_STAT(numIdleCycles, statistics::units::Cycle::get(),
"Number of idle cycles"),
ADD_STAT(numBusyCycles, statistics::units::Cycle::get(),
@@ -156,8 +144,6 @@
"Number of branches predicted as taken"),
ADD_STAT(numBranchMispred, statistics::units::Count::get(),
"Number of branch mispredictions"),
ADD_STAT(statExecutedInstType,
statistics::units::Count::get(),
"Class of executed instruction."),
numRegReads{
&(cpu->executeStats[thread->threadId()]->numIntRegReads),
&(cpu->executeStats[thread->threadId()]->numFpRegReads),
@@ -190,14 +176,6 @@
dcacheStallCycles
.prereq(dcacheStallCycles);
statExecutedInstType
.init(enums::Num_OpClass)
.flags(statistics::total | statistics::pdf |
for (unsigned i = 0; i < Num_OpClasses; ++i) {
statExecutedInstType.subname(i, enums::OpClassStrings[i]);
}
idleFraction = statistics::constant(1.0) - notIdleFraction;
numIdleCycles = idleFraction * cpu->baseStats.numCycles;
numBusyCycles = notIdleFraction * cpu->baseStats.numCycles;
@@ -228,18 +206,6 @@
// Number of function calls/returns
statistics::Scalar numCallsReturns;
// Conditional control instructions;
statistics::Scalar numCondCtrlInsts;
// Number of int instructions
statistics::Scalar numIntInsts;
// Number of float instructions
statistics::Scalar numFpInsts;
// Number of vector instructions
statistics::Scalar numVecInsts;
// Number of matrix instructions
statistics::Scalar numMatInsts;
@@ -273,8 +239,6 @@
// Number of simulated memory references
statistics::Scalar numMemRefs;
statistics::Scalar numLoadInsts;
statistics::Scalar numStoreInsts;
// Number of idle cycles
statistics::Formula numIdleCycles;
@@ -299,9 +263,6 @@
statistics::Scalar numBranchMispred;
/// @}
// Instruction mix histogram by OpClass
statistics::Vector statExecutedInstType;
std::array<statistics::Scalar *, CCRegClass + 1> numRegReads;
std::array<statistics::Scalar *, CCRegClass + 1> numRegWrites;
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69106?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I57abea0881eaaea52da3f365078d6b0e2ea1bfeb
Gerrit-Change-Number: 69106
Gerrit-PatchSet: 11
Gerrit-Owner: Melissa Jost melissakjost@gmail.com
Gerrit-Reviewer: Bobby Bruce bbruce@ucdavis.edu
Gerrit-Reviewer: Gabe Black gabe.black@gmail.com
Gerrit-Reviewer: Jason Lowe-Power jason@lowepower.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com