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/simple/base.cc | 11 +++++++++-- src/cpu/simple/base.hh | 19 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'src/cpu/simple') diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 9035ce973..eee28876d 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -116,6 +116,8 @@ BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p) numInst = 0; startNumInst = 0; + numOp = 0; + startNumOp = 0; numLoad = 0; startNumLoad = 0; lastIcacheStall = 0; @@ -156,8 +158,13 @@ BaseSimpleCPU::regStats() BaseCPU::regStats(); numInsts - .name(name() + ".num_insts") - .desc("Number of instructions executed") + .name(name() + ".committedInsts") + .desc("Number of instructions committed") + ; + + numOps + .name(name() + ".committedOps") + .desc("Number of ops (including micro ops) committed") ; numIntAluAccesses diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh index 55dec5d53..4c02e2eb0 100644 --- a/src/cpu/simple/base.hh +++ b/src/cpu/simple/base.hh @@ -189,20 +189,33 @@ class BaseSimpleCPU : public BaseCPU Counter numInst; Counter startNumInst; Stats::Scalar numInsts; + Counter numOp; + Counter startNumOp; + Stats::Scalar numOps; void countInst() { - numInst++; - numInsts++; + if (!curStaticInst->isMicroop() || curStaticInst->isLastMicroop()) { + numInst++; + numInsts++; + } + numOp++; + numOps++; + system->totalNumInsts++; thread->funcExeInst++; } - virtual Counter totalInstructions() const + virtual Counter totalInsts() const { return numInst - startNumInst; } + virtual Counter totalOps() const + { + return numOp - startNumOp; + } + //number of integer alu accesses Stats::Scalar numIntAluAccesses; -- cgit v1.2.3