diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 67f8e7bfc0..fa30e4b5e6 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 06fc2a391d..a9af865da0 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -758,6 +758,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 7419b2a2f9..e1f01680ca 100644 --- a/src/cpu/o3/commit.cc +++ b/src/cpu/o3/commit.cc @@ -156,10 +156,6 @@ Commit::CommitStats::CommitStats(CPU *cpu, Commit *commit) "The number of times a branch was mispredicted"), ADD_STAT(numCommittedDist, statistics::units::Count::get(), "Number of insts commited each cycle"), - ADD_STAT(instsCommitted, statistics::units::Count::get(), - "Number of instructions committed"), - ADD_STAT(opsCommitted, statistics::units::Count::get(), - "Number of ops (including micro ops) committed"), ADD_STAT(amos, statistics::units::Count::get(), "Number of atomic instructions committed"), ADD_STAT(membars, statistics::units::Count::get(), @@ -181,14 +177,6 @@ Commit::CommitStats::CommitStats(CPU *cpu, Commit *commit) .init(0,commit->commitWidth,1) .flags(statistics::pdf); - instsCommitted - .init(cpu->numThreads) - .flags(total); - - opsCommitted - .init(cpu->numThreads) - .flags(total); - amos .init(cpu->numThreads) .flags(total); @@ -1348,9 +1336,12 @@ Commit::updateComInstStats(const DynInstPtr &inst) { ThreadID tid = inst->threadNumber; - if (!inst->isMicroop() || inst->isLastMicroop()) - stats.instsCommitted[tid]++; - stats.opsCommitted[tid]++; + if (!inst->isMicroop() || inst->isLastMicroop()) { + cpu->commitStats[tid]->numInsts++; + cpu->baseStats.numInsts++; + } + 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/commit.hh b/src/cpu/o3/commit.hh index 6591360197..eccd023d45 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -479,10 +479,6 @@ class Commit /** Distribution of the number of committed instructions each cycle. */ statistics::Distribution numCommittedDist; - /** Total number of instructions committed. */ - statistics::Vector instsCommitted; - /** Total number of ops (including micro ops) committed. */ - statistics::Vector opsCommitted; /** Stat for the total number of committed atomics. */ statistics::Vector amos; /** Total number of committed memory barriers. */ diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 90df3b349e..93c58fef63 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -328,23 +328,7 @@ CPU::CPUStats::CPUStats(CPU *cpu) "to idling"), ADD_STAT(quiesceCycles, statistics::units::Cycle::get(), "Total number of cycles that CPU has spent quiesced or waiting " - "for an interrupt"), - ADD_STAT(committedInsts, statistics::units::Count::get(), - "Number of Instructions Simulated"), - ADD_STAT(committedOps, 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"), - ADD_STAT(totalCpi, statistics::units::Rate< - statistics::units::Cycle, statistics::units::Count>::get(), - "CPI: Total CPI of All Threads"), - ADD_STAT(ipc, statistics::units::Rate< - statistics::units::Count, statistics::units::Cycle>::get(), - "IPC: Instructions Per Cycle"), - ADD_STAT(totalIpc, statistics::units::Rate< - statistics::units::Count, statistics::units::Cycle>::get(), - "IPC: Total IPC of All Threads") + "for an interrupt") { // Register any of the O3CPU's stats here. timesIdled @@ -356,33 +340,6 @@ CPU::CPUStats::CPUStats(CPU *cpu) quiesceCycles .prereq(quiesceCycles); - // Number of Instructions simulated - // -------------------------------- - // Should probably be in Base CPU but need templated - // MaxThreads so put in here instead - committedInsts - .init(cpu->numThreads) - .flags(statistics::total); - - committedOps - .init(cpu->numThreads) - .flags(statistics::total); - - cpi - .precision(6); - cpi = cpu->baseStats.numCycles / committedInsts; - - totalCpi - .precision(6); - totalCpi = cpu->baseStats.numCycles / sum(committedInsts); - - ipc - .precision(6); - ipc = committedInsts / cpu->baseStats.numCycles; - - totalIpc - .precision(6); - totalIpc = sum(committedInsts) / cpu->baseStats.numCycles; } void @@ -1170,14 +1127,14 @@ CPU::instDone(ThreadID tid, const DynInstPtr &inst) if (!inst->isMicroop() || inst->isLastMicroop()) { 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); } thread[tid]->numOp++; thread[tid]->threadStats.numOps++; - cpuStats.committedOps[tid]++; + commitStats[tid]->numOpsNotNOP++; probeInstCommit(inst->staticInst, inst->pcState().instAddr()); } diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 07775298af..7dc378428b 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -581,19 +581,6 @@ class CPU : public BaseCPU /** Stat for total number of cycles the CPU spends descheduled due to a * quiesce operation or waiting for an interrupt. */ statistics::Scalar quiesceCycles; - /** Stat for the number of committed instructions per thread. */ - statistics::Vector committedInsts; - /** Stat for the number of committed ops (including micro ops) per - * thread. */ - statistics::Vector committedOps; - /** Stat for the CPI per thread. */ - statistics::Formula cpi; - /** Stat for the total CPI. */ - statistics::Formula totalCpi; - /** Stat for the IPC per thread. */ - statistics::Formula ipc; - /** Stat for the total IPC. */ - statistics::Formula totalIpc; } cpuStats;