summaryrefslogtreecommitdiff
path: root/src/cpu/base.hh
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/base.hh
parent230540e655efd09ad057e7fde2ac257f355c06d1 (diff)
downloadgem5-542d0ceebca1d24bfb433ce9fe916b0586f8d029.tar.xz
cpu: add separate stats for insts/ops both globally and per cpu model
Diffstat (limited to 'src/cpu/base.hh')
-rw-r--r--src/cpu/base.hh19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh
index 93e5476ef..74c1a8762 100644
--- a/src/cpu/base.hh
+++ b/src/cpu/base.hh
@@ -331,7 +331,9 @@ class BaseCPU : public MemObject
*/
virtual BranchPred *getBranchPred() { return NULL; };
- virtual Counter totalInstructions() const = 0;
+ virtual Counter totalInsts() const = 0;
+
+ virtual Counter totalOps() const = 0;
// Function tracing
private:
@@ -354,13 +356,24 @@ class BaseCPU : public MemObject
}
static int numSimulatedCPUs() { return cpuList.size(); }
- static Counter numSimulatedInstructions()
+ static Counter numSimulatedInsts()
+ {
+ Counter total = 0;
+
+ int size = cpuList.size();
+ for (int i = 0; i < size; ++i)
+ total += cpuList[i]->totalInsts();
+
+ return total;
+ }
+
+ static Counter numSimulatedOps()
{
Counter total = 0;
int size = cpuList.size();
for (int i = 0; i < size; ++i)
- total += cpuList[i]->totalInstructions();
+ total += cpuList[i]->totalOps();
return total;
}