cpu: Revert CPU stats changes
This reverts this relationchain: https://gem5-review.googlesource.com/c/public/gem5/+/67396/6 This was pre-maturely submitted before all testing and checking was done. To be safe this has been reverted. When all testing and checks are completed, this revert will be undone. Change-Id: I2a88cadfee03c1fc81932e6548938db108786dd2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68717 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Bobby Bruce
parent
18ba4e1278
commit
85342dbb0e
@@ -86,12 +86,60 @@ class SimpleExecContext : public ExecContext
|
||||
: statistics::Group(cpu,
|
||||
csprintf("exec_context.thread_%i",
|
||||
thread->threadId()).c_str()),
|
||||
ADD_STAT(numInsts, statistics::units::Count::get(),
|
||||
"Number of instructions committed"),
|
||||
ADD_STAT(numOps, statistics::units::Count::get(),
|
||||
"Number of ops (including micro ops) committed"),
|
||||
ADD_STAT(numIntAluAccesses, statistics::units::Count::get(),
|
||||
"Number of integer alu accesses"),
|
||||
ADD_STAT(numFpAluAccesses, statistics::units::Count::get(),
|
||||
"Number of float alu accesses"),
|
||||
ADD_STAT(numVecAluAccesses, statistics::units::Count::get(),
|
||||
"Number of vector alu accesses"),
|
||||
ADD_STAT(numMatAluAccesses, statistics::units::Count::get(),
|
||||
"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(),
|
||||
"Number of times the integer registers were read"),
|
||||
ADD_STAT(numIntRegWrites, statistics::units::Count::get(),
|
||||
"Number of times the integer registers were written"),
|
||||
ADD_STAT(numFpRegReads, statistics::units::Count::get(),
|
||||
"Number of times the floating registers were read"),
|
||||
ADD_STAT(numFpRegWrites, statistics::units::Count::get(),
|
||||
"Number of times the floating registers were written"),
|
||||
ADD_STAT(numVecRegReads, statistics::units::Count::get(),
|
||||
"Number of times the vector registers were read"),
|
||||
ADD_STAT(numVecRegWrites, statistics::units::Count::get(),
|
||||
"Number of times the vector registers were written"),
|
||||
ADD_STAT(numVecPredRegReads, statistics::units::Count::get(),
|
||||
"Number of times the predicate registers were read"),
|
||||
ADD_STAT(numVecPredRegWrites, statistics::units::Count::get(),
|
||||
"Number of times the predicate registers were written"),
|
||||
ADD_STAT(numCCRegReads, statistics::units::Count::get(),
|
||||
"Number of times the CC registers were read"),
|
||||
ADD_STAT(numCCRegWrites, statistics::units::Count::get(),
|
||||
"Number of times the CC registers were written"),
|
||||
ADD_STAT(numMiscRegReads, statistics::units::Count::get(),
|
||||
"Number of times the Misc registers were read"),
|
||||
ADD_STAT(numMiscRegWrites, statistics::units::Count::get(),
|
||||
"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(),
|
||||
@@ -100,35 +148,64 @@ class SimpleExecContext : public ExecContext
|
||||
"Percentage of non-idle cycles"),
|
||||
ADD_STAT(idleFraction, statistics::units::Ratio::get(),
|
||||
"Percentage of idle cycles"),
|
||||
ADD_STAT(icacheStallCycles, statistics::units::Cycle::get(),
|
||||
"ICache total stall cycles"),
|
||||
ADD_STAT(dcacheStallCycles, statistics::units::Cycle::get(),
|
||||
"DCache total stall cycles"),
|
||||
ADD_STAT(numBranches, statistics::units::Count::get(),
|
||||
"Number of branches fetched"),
|
||||
ADD_STAT(numPredictedBranches, statistics::units::Count::get(),
|
||||
"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),
|
||||
&(cpu->executeStats[thread->threadId()]->numVecRegReads),
|
||||
&(cpu->executeStats[thread->threadId()]->numVecRegReads),
|
||||
&(cpu->executeStats[thread->threadId()]->numVecPredRegReads),
|
||||
&(cpu->executeStats[thread->threadId()]->numCCRegReads),
|
||||
&numMatRegReads
|
||||
&numIntRegReads,
|
||||
&numFpRegReads,
|
||||
&numVecRegReads,
|
||||
&numVecRegReads,
|
||||
&numVecPredRegReads,
|
||||
&numMatRegReads,
|
||||
&numCCRegReads
|
||||
},
|
||||
numRegWrites{
|
||||
&(cpu->executeStats[thread->threadId()]->numIntRegWrites),
|
||||
&(cpu->executeStats[thread->threadId()]->numFpRegWrites),
|
||||
&(cpu->executeStats[thread->threadId()]->numVecRegWrites),
|
||||
&(cpu->executeStats[thread->threadId()]->numVecRegWrites),
|
||||
&(cpu->executeStats[thread->threadId()]
|
||||
->numVecPredRegWrites),
|
||||
&(cpu->executeStats[thread->threadId()]->numCCRegWrites),
|
||||
&numMatRegWrites
|
||||
&numIntRegWrites,
|
||||
&numFpRegWrites,
|
||||
&numVecRegWrites,
|
||||
&numVecRegWrites,
|
||||
&numVecPredRegWrites,
|
||||
&numMatRegWrites,
|
||||
&numCCRegWrites
|
||||
}
|
||||
{
|
||||
numCCRegReads
|
||||
.flags(statistics::nozero);
|
||||
|
||||
numCCRegWrites
|
||||
.flags(statistics::nozero);
|
||||
|
||||
icacheStallCycles
|
||||
.prereq(icacheStallCycles);
|
||||
|
||||
dcacheStallCycles
|
||||
.prereq(dcacheStallCycles);
|
||||
|
||||
statExecutedInstType
|
||||
.init(enums::Num_OpClass)
|
||||
.flags(statistics::total | statistics::pdf | statistics::dist);
|
||||
|
||||
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;
|
||||
|
||||
numBranches
|
||||
.prereq(numBranches);
|
||||
|
||||
numPredictedBranches
|
||||
.prereq(numPredictedBranches);
|
||||
|
||||
@@ -136,19 +213,73 @@ class SimpleExecContext : public ExecContext
|
||||
.prereq(numBranchMispred);
|
||||
}
|
||||
|
||||
// Number of simulated instructions
|
||||
statistics::Scalar numInsts;
|
||||
statistics::Scalar numOps;
|
||||
|
||||
// Number of integer alu accesses
|
||||
statistics::Scalar numIntAluAccesses;
|
||||
|
||||
// Number of float alu accesses
|
||||
statistics::Scalar numFpAluAccesses;
|
||||
|
||||
// Number of vector alu accesses
|
||||
statistics::Scalar numVecAluAccesses;
|
||||
|
||||
// Number of matrix alu accesses
|
||||
statistics::Scalar numMatAluAccesses;
|
||||
|
||||
// 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;
|
||||
|
||||
// Number of integer register file accesses
|
||||
statistics::Scalar numIntRegReads;
|
||||
statistics::Scalar numIntRegWrites;
|
||||
|
||||
// Number of float register file accesses
|
||||
statistics::Scalar numFpRegReads;
|
||||
statistics::Scalar numFpRegWrites;
|
||||
|
||||
// Number of vector register file accesses
|
||||
mutable statistics::Scalar numVecRegReads;
|
||||
statistics::Scalar numVecRegWrites;
|
||||
|
||||
// Number of predicate register file accesses
|
||||
mutable statistics::Scalar numVecPredRegReads;
|
||||
statistics::Scalar numVecPredRegWrites;
|
||||
|
||||
// Number of matrix register file accesses
|
||||
mutable statistics::Scalar numMatRegReads;
|
||||
statistics::Scalar numMatRegWrites;
|
||||
|
||||
// Number of condition code register file accesses
|
||||
statistics::Scalar numCCRegReads;
|
||||
statistics::Scalar numCCRegWrites;
|
||||
|
||||
// Number of misc register file accesses
|
||||
statistics::Scalar numMiscRegReads;
|
||||
statistics::Scalar numMiscRegWrites;
|
||||
|
||||
// Number of simulated memory references
|
||||
statistics::Scalar numMemRefs;
|
||||
statistics::Scalar numLoadInsts;
|
||||
statistics::Scalar numStoreInsts;
|
||||
|
||||
// Number of idle cycles
|
||||
statistics::Formula numIdleCycles;
|
||||
|
||||
@@ -159,13 +290,24 @@ class SimpleExecContext : public ExecContext
|
||||
statistics::Average notIdleFraction;
|
||||
statistics::Formula idleFraction;
|
||||
|
||||
// Number of cycles stalled for I-cache responses
|
||||
statistics::Scalar icacheStallCycles;
|
||||
|
||||
// Number of cycles stalled for D-cache responses
|
||||
statistics::Scalar dcacheStallCycles;
|
||||
|
||||
/// @{
|
||||
/// Total number of branches fetched
|
||||
statistics::Scalar numBranches;
|
||||
/// Number of branches predicted as taken
|
||||
statistics::Scalar numPredictedBranches;
|
||||
/// Number of misprediced branches
|
||||
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;
|
||||
|
||||
@@ -226,7 +368,7 @@ class SimpleExecContext : public ExecContext
|
||||
RegVal
|
||||
readMiscRegOperand(const StaticInst *si, int idx) override
|
||||
{
|
||||
cpu->executeStats[thread->threadId()]->numMiscRegReads++;
|
||||
execContextStats.numMiscRegReads++;
|
||||
const RegId& reg = si->srcRegIdx(idx);
|
||||
assert(reg.is(MiscRegClass));
|
||||
return thread->readMiscReg(reg.index());
|
||||
@@ -235,7 +377,7 @@ class SimpleExecContext : public ExecContext
|
||||
void
|
||||
setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
|
||||
{
|
||||
cpu->executeStats[thread->threadId()]->numMiscRegWrites++;
|
||||
execContextStats.numMiscRegWrites++;
|
||||
const RegId& reg = si->destRegIdx(idx);
|
||||
assert(reg.is(MiscRegClass));
|
||||
thread->setMiscReg(reg.index(), val);
|
||||
@@ -248,7 +390,7 @@ class SimpleExecContext : public ExecContext
|
||||
RegVal
|
||||
readMiscReg(int misc_reg) override
|
||||
{
|
||||
cpu->executeStats[thread->threadId()]->numMiscRegReads++;
|
||||
execContextStats.numMiscRegReads++;
|
||||
return thread->readMiscReg(misc_reg);
|
||||
}
|
||||
|
||||
@@ -259,7 +401,7 @@ class SimpleExecContext : public ExecContext
|
||||
void
|
||||
setMiscReg(int misc_reg, RegVal val) override
|
||||
{
|
||||
cpu->executeStats[thread->threadId()]->numMiscRegWrites++;
|
||||
execContextStats.numMiscRegWrites++;
|
||||
thread->setMiscReg(misc_reg, val);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user