cpu: add separate stats for insts/ops both globally and per cpu model

This commit is contained in:
Anthony Gutierrez
2012-02-12 16:07:39 -06:00
parent 230540e655
commit 542d0ceebc
15 changed files with 172 additions and 38 deletions

View File

@@ -97,11 +97,13 @@ SimTicksReset simTicksReset;
struct Global
{
Stats::Formula hostInstRate;
Stats::Formula hostOpRate;
Stats::Formula hostTickRate;
Stats::Value hostMemory;
Stats::Value hostSeconds;
Stats::Value simInsts;
Stats::Value simOps;
Global();
};
@@ -109,13 +111,21 @@ struct Global
Global::Global()
{
simInsts
.functor(BaseCPU::numSimulatedInstructions)
.functor(BaseCPU::numSimulatedInsts)
.name("sim_insts")
.desc("Number of instructions simulated")
.precision(0)
.prereq(simInsts)
;
simOps
.functor(BaseCPU::numSimulatedOps)
.name("sim_ops")
.desc("Number of ops (including micro ops) simulated")
.precision(0)
.prereq(simOps)
;
simSeconds
.name("sim_seconds")
.desc("Number of seconds simulated")
@@ -147,6 +157,13 @@ Global::Global()
.prereq(simInsts)
;
hostOpRate
.name("host_op_rate")
.desc("Simulator op (including micro ops) rate (op/s)")
.precision(0)
.prereq(simOps)
;
hostMemory
.functor(memUsage)
.name("host_mem_usage")
@@ -169,6 +186,7 @@ Global::Global()
simSeconds = simTicks / simFreq;
hostInstRate = simInsts / hostSeconds;
hostOpRate = simOps / hostSeconds;
hostTickRate = simTicks / hostSeconds;
registerResetCallback(&simTicksReset);