inorder: exe_unit_stats for resolved branches
authorKorey Sewell <ksewell@umich.edu>
Thu, 24 Jun 2010 17:58:27 +0000 (13:58 -0400)
committerKorey Sewell <ksewell@umich.edu>
Thu, 24 Jun 2010 17:58:27 +0000 (13:58 -0400)
src/cpu/inorder/resources/execution_unit.cc
src/cpu/inorder/resources/execution_unit.hh

index 017308585056f6b826eecfa057a84844cce39382..4b725daf546d5c8e5e0250049833f638b754a82c 100644 (file)
@@ -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();
 }
 
index 0a15afdabd38cbd6e95534cb9172ecf5c07935d6..e852e3ed07e4330616bc1ec919e31ce9534b5313 100644 (file)
@@ -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;
 };