diff --git a/src/cpu/base.cc b/src/cpu/base.cc index d7dda13ab1..801a95b087 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -954,6 +954,10 @@ CommitCPUStats::CommitCPUStats(statistics::Group *parent, int thread_id) "Number of instructions committed (thread level)"), ADD_STAT(numOps, statistics::units::Count::get(), "Number of ops (including micro ops) committed (thread level)"), + ADD_STAT(numInstsNotNOP, statistics::units::Count::get(), + "Number of instructions committed excluding NOPs or prefetches"), + ADD_STAT(numOpsNotNOP, statistics::units::Count::get(), + "Number of Ops (including micro ops) Simulated"), ADD_STAT(cpi, statistics::units::Rate< statistics::units::Cycle, statistics::units::Count>::get(), "CPI: cycles per instruction (thread level)"), diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 5e2432f01d..f1739679f6 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -759,6 +759,10 @@ class BaseCPU : public ClockedObject statistics::Scalar numInsts; statistics::Scalar numOps; + /* Number of instructions committed that are not NOP or prefetches */ + statistics::Scalar numInstsNotNOP; + statistics::Scalar numOpsNotNOP; + /* CPI/IPC for total cycle counts and macro insts */ statistics::Formula cpi; statistics::Formula ipc; diff --git a/src/cpu/o3/commit.cc b/src/cpu/o3/commit.cc index b3da2d9570..63bf7aebc4 100644 --- a/src/cpu/o3/commit.cc +++ b/src/cpu/o3/commit.cc @@ -1383,9 +1383,16 @@ Commit::updateComInstStats(const DynInstPtr &inst) { ThreadID tid = inst->threadNumber; - if (!inst->isMicroop() || inst->isLastMicroop()) + if (!inst->isMicroop() || inst->isLastMicroop()) { + // update both old and new stats stats.instsCommitted[tid]++; + cpu->commitStats[tid]->numInsts++; + cpu->baseStats.numInsts++; + } + // update both old and new stats stats.opsCommitted[tid]++; + cpu->commitStats[tid]->numOps++; + cpu->baseStats.numOps++; // To match the old model, don't count nops and instruction // prefetches towards the total commit count. diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 6732c4310e..444692d47f 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -1353,16 +1353,20 @@ CPU::instDone(ThreadID tid, const DynInstPtr &inst) { // Keep an instruction count. if (!inst->isMicroop() || inst->isLastMicroop()) { + // update both old and new stats thread[tid]->numInst++; thread[tid]->threadStats.numInsts++; cpuStats.committedInsts[tid]++; + commitStats[tid]->numInstsNotNOP++; // Check for instruction-count-based events. thread[tid]->comInstEventQueue.serviceEvents(thread[tid]->numInst); } + // update both old and new stats thread[tid]->numOp++; thread[tid]->threadStats.numOps++; cpuStats.committedOps[tid]++; + commitStats[tid]->numOpsNotNOP++; probeInstCommit(inst->staticInst, inst->pcState().instAddr()); }