From 542d0ceebca1d24bfb433ce9fe916b0586f8d029 Mon Sep 17 00:00:00 2001 From: Anthony Gutierrez Date: Sun, 12 Feb 2012 16:07:39 -0600 Subject: cpu: add separate stats for insts/ops both globally and per cpu model --- src/cpu/o3/commit_impl.hh | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src/cpu/o3/commit_impl.hh') diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index 446c8e6f3..7ca42ae5b 100644 --- a/src/cpu/o3/commit_impl.hh +++ b/src/cpu/o3/commit_impl.hh @@ -169,6 +169,10 @@ DefaultCommit::regStats() .name(name() + ".commitCommittedInsts") .desc("The number of committed instructions") .prereq(commitCommittedInsts); + commitCommittedOps + .name(name() + ".commitCommittedOps") + .desc("The number of committed instructions") + .prereq(commitCommittedInsts); commitSquashedInsts .name(name() + ".commitSquashedInsts") .desc("The number of squashed insts skipped by commit") @@ -193,13 +197,20 @@ DefaultCommit::regStats() .flags(Stats::pdf) ; - statComInst + instsCommitted .init(cpu->numThreads) - .name(name() + ".count") + .name(name() + ".committedInsts") .desc("Number of instructions committed") .flags(total) ; + opsCommitted + .init(cpu->numThreads) + .name(name() + ".committedOps") + .desc("Number of ops (including micro ops) committed") + .flags(total) + ; + statComSwp .init(cpu->numThreads) .name(name() + ".swp_count") @@ -988,12 +999,14 @@ DefaultCommit::commitInsts() // Set the doneSeqNum to the youngest committed instruction. toIEW->commitInfo[tid].doneSeqNum = head_inst->seqNum; - ++commitCommittedInsts; + if (!head_inst->isMicroop() || head_inst->isLastMicroop()) + ++commitCommittedInsts; + ++commitCommittedOps; // To match the old model, don't count nops and instruction // prefetches towards the total commit count. if (!head_inst->isNop() && !head_inst->isInstPrefetch()) { - cpu->instDone(tid); + cpu->instDone(tid, head_inst); } if (tid == 0) { @@ -1175,7 +1188,7 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) if (head_inst->traceData) { if (DTRACE(ExecFaulting)) { head_inst->traceData->setFetchSeq(head_inst->seqNum); - head_inst->traceData->setCPSeq(thread[tid]->numInst); + head_inst->traceData->setCPSeq(thread[tid]->numOp); head_inst->traceData->dump(); } delete head_inst->traceData; @@ -1209,7 +1222,7 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) head_inst->seqNum, head_inst->pcState()); if (head_inst->traceData) { head_inst->traceData->setFetchSeq(head_inst->seqNum); - head_inst->traceData->setCPSeq(thread[tid]->numInst); + head_inst->traceData->setCPSeq(thread[tid]->numOp); head_inst->traceData->dump(); delete head_inst->traceData; head_inst->traceData = NULL; @@ -1360,10 +1373,14 @@ DefaultCommit::updateComInstStats(DynInstPtr &inst) if (inst->isDataPrefetch()) { statComSwp[tid]++; } else { - statComInst[tid]++; + if (!inst->isMicroop() || inst->isLastMicroop()) + instsCommitted[tid]++; + opsCommitted[tid]++; } #else - statComInst[tid]++; + if (!inst->isMicroop() || inst->isLastMicroop()) + instsCommitted[tid]++; + opsCommitted[tid]++; #endif // -- cgit v1.2.3