summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2010-06-24 13:58:27 -0400
committerKorey Sewell <ksewell@umich.edu>2010-06-24 13:58:27 -0400
commitecba3074c2eb9e873655a1e0e49bfd03e2bd2a41 (patch)
tree889dbd1599cc334875a74c5d370907e94ec77ce5 /src
parent1a737644032be8d95a381e3661b740c2b4f78bba (diff)
downloadgem5-ecba3074c2eb9e873655a1e0e49bfd03e2bd2a41.tar.xz
inorder: exe_unit_stats for resolved branches
Diffstat (limited to 'src')
-rw-r--r--src/cpu/inorder/resources/execution_unit.cc16
-rw-r--r--src/cpu/inorder/resources/execution_unit.hh4
2 files changed, 19 insertions, 1 deletions
diff --git a/src/cpu/inorder/resources/execution_unit.cc b/src/cpu/inorder/resources/execution_unit.cc
index 017308585..4b725daf5 100644
--- a/src/cpu/inorder/resources/execution_unit.cc
+++ b/src/cpu/inorder/resources/execution_unit.cc
@@ -60,6 +60,22 @@ ExecutionUnit::regStats()
.name(name() + ".executions")
.desc("Number of Instructions Executed.");
+
+ predictedIncorrect
+ .name(name() + ".mispredicted")
+ .desc("Number of Branches Incorrectly Predicted");
+
+ predictedCorrect
+ .name(name() + ".predicted")
+ .desc("Number of Branches Incorrectly Predicted");
+
+ mispredictPct
+ .name(name() + ".mispredictPct")
+ .desc("Percentage of Incorrect Branches Predicts")
+ .precision(6);
+ mispredictPct = (predictedIncorrect /
+ (predictedCorrect + predictedIncorrect)) * 100;
+
Resource::regStats();
}
diff --git a/src/cpu/inorder/resources/execution_unit.hh b/src/cpu/inorder/resources/execution_unit.hh
index 0a15afdab..e852e3ed0 100644
--- a/src/cpu/inorder/resources/execution_unit.hh
+++ b/src/cpu/inorder/resources/execution_unit.hh
@@ -70,7 +70,9 @@ class ExecutionUnit : public Resource {
/////////////////////////////////////////////////////////////////
Stats::Scalar predictedTakenIncorrect;
Stats::Scalar predictedNotTakenIncorrect;
-
+ Stats::Scalar predictedIncorrect;
+ Stats::Scalar predictedCorrect;
+ Stats::Formula mispredictPct;
Stats::Scalar executions;
Tick lastExecuteCycle;
};