changeset f44ba2f42b5c in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=f44ba2f42b5c
description:
inorder: add execution unit stats
diffstat:
2 files changed, 22 insertions(+)
src/cpu/inorder/resources/execution_unit.cc | 17 +++++++++++++++++
src/cpu/inorder/resources/execution_unit.hh | 5 +++++
diffs (49 lines):
diff -r df2a5f076618 -r f44ba2f42b5c src/cpu/inorder/resources/execution_unit.cc
--- a/src/cpu/inorder/resources/execution_unit.cc Sun Jan 31 18:29:18
2010 -0500
+++ b/src/cpu/inorder/resources/execution_unit.cc Sun Jan 31 18:29:49
2010 -0500
@@ -54,6 +54,17 @@
.name(name() + ".predictedNotTakenIncorrect")
.desc("Number of Branches Incorrectly Predicted As Not Taken).");
+ lastExecuteCycle = curTick;
+
+ cyclesExecuted
+ .name(name() + ".cyclesExecuted")
+ .desc("Number of Cycles Execution Unit was used.");
+
+ utilization
+ .name(name() + ".utilization")
+ .desc("Utilization of Execution Unit (cycles / totalCycles).");
+ utilization = cyclesExecuted / cpu->numCycles;
+
Resource::regStats();
}
@@ -75,6 +86,12 @@
{
case ExecuteInst:
{
+ if (curTick != lastExecuteCycle) {
+ lastExecuteCycle = curTick;
+ cyclesExecuted++;
+ }
+
+
if (inst->isMemRef()) {
panic("%s not configured to handle memory ops.\n", resName);
} else if (inst->isControl()) {
diff -r df2a5f076618 -r f44ba2f42b5c src/cpu/inorder/resources/execution_unit.hh
--- a/src/cpu/inorder/resources/execution_unit.hh Sun Jan 31 18:29:18
2010 -0500
+++ b/src/cpu/inorder/resources/execution_unit.hh Sun Jan 31 18:29:49
2010 -0500
@@ -71,6 +71,11 @@
/////////////////////////////////////////////////////////////////
Stats::Scalar predictedTakenIncorrect;
Stats::Scalar predictedNotTakenIncorrect;
+
+ Stats::Scalar cyclesExecuted;
+ Tick lastExecuteCycle;
+
+ Stats::Formula utilization;
};
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev