summaryrefslogtreecommitdiff
path: root/src/cpu/o3/cpu.cc
diff options
context:
space:
mode:
authorAnthony Gutierrez <atgutier@umich.edu>2012-02-12 16:07:39 -0600
committerAnthony Gutierrez <atgutier@umich.edu>2012-02-12 16:07:39 -0600
commit542d0ceebca1d24bfb433ce9fe916b0586f8d029 (patch)
tree45afbefa2ec6a79de564d2c4505667a4d974e1f5 /src/cpu/o3/cpu.cc
parent230540e655efd09ad057e7fde2ac257f355c06d1 (diff)
downloadgem5-542d0ceebca1d24bfb433ce9fe916b0586f8d029.tar.xz
cpu: add separate stats for insts/ops both globally and per cpu model
Diffstat (limited to 'src/cpu/o3/cpu.cc')
-rw-r--r--src/cpu/o3/cpu.cc36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index d16270943..82f17adc9 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -506,6 +506,11 @@ FullO3CPU<Impl>::regStats()
.name(name() + ".committedInsts")
.desc("Number of Instructions Simulated");
+ committedOps
+ .init(numThreads)
+ .name(name() + ".committedOps")
+ .desc("Number of Ops (including micro ops) Simulated");
+
totalCommittedInsts
.name(name() + ".committedInsts_total")
.desc("Number of Instructions Simulated");
@@ -718,7 +723,7 @@ FullO3CPU<Impl>::deactivateThread(ThreadID tid)
template <class Impl>
Counter
-FullO3CPU<Impl>::totalInstructions() const
+FullO3CPU<Impl>::totalInsts() const
{
Counter total(0);
@@ -730,6 +735,19 @@ FullO3CPU<Impl>::totalInstructions() const
}
template <class Impl>
+Counter
+FullO3CPU<Impl>::totalOps() const
+{
+ Counter total(0);
+
+ ThreadID size = thread.size();
+ for (ThreadID i = 0; i < size; i++)
+ total += thread[i]->numOp;
+
+ return total;
+}
+
+template <class Impl>
void
FullO3CPU<Impl>::activateContext(ThreadID tid, int delay)
{
@@ -1458,13 +1476,19 @@ FullO3CPU<Impl>::addInst(DynInstPtr &inst)
template <class Impl>
void
-FullO3CPU<Impl>::instDone(ThreadID tid)
+FullO3CPU<Impl>::instDone(ThreadID tid, DynInstPtr &inst)
{
// Keep an instruction count.
- thread[tid]->numInst++;
- thread[tid]->numInsts++;
- committedInsts[tid]++;
- totalCommittedInsts++;
+ if (!inst->isMicroop() || inst->isLastMicroop()) {
+ thread[tid]->numInst++;
+ thread[tid]->numInsts++;
+ committedInsts[tid]++;
+ totalCommittedInsts++;
+ }
+ thread[tid]->numOp++;
+ thread[tid]->numOps++;
+ committedOps[tid]++;
+
system->totalNumInsts++;
// Check for instruction-count-based events.
comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);