changeset 9b559768152b in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=9b559768152b
description:
        inorder: multi-issue branch resolution
        Only execute (resolve) one branch per cycle because handling more than 
one is
        a little more complicated

diffstat:

 src/cpu/inorder/resources/execution_unit.cc |  17 ++++++++++++-----
 src/cpu/inorder/resources/execution_unit.hh |   3 ++-
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (60 lines):

diff -r 87f4fd9a2760 -r 9b559768152b src/cpu/inorder/resources/execution_unit.cc
--- a/src/cpu/inorder/resources/execution_unit.cc       Fri Feb 04 00:08:16 
2011 -0500
+++ b/src/cpu/inorder/resources/execution_unit.cc       Fri Feb 04 00:08:17 
2011 -0500
@@ -41,7 +41,8 @@
 ExecutionUnit::ExecutionUnit(string res_name, int res_id, int res_width,
                              int res_latency, InOrderCPU *_cpu,
                              ThePipeline::Params *params)
-    : Resource(res_name, res_id, res_width, res_latency, _cpu)
+    : Resource(res_name, res_id, res_width, res_latency, _cpu),
+      lastExecuteTick(0), lastControlTick(0)
 { }
 
 void
@@ -55,8 +56,6 @@
         .name(name() + ".predictedNotTakenIncorrect")
         .desc("Number of Branches Incorrectly Predicted As Not Taken).");
 
-    lastExecuteCycle = curTick();
-
     executions
         .name(name() + ".executions")
         .desc("Number of Instructions Executed.");
@@ -98,14 +97,22 @@
     {
       case ExecuteInst:
         {
-            if (curTick() != lastExecuteCycle) {
-                lastExecuteCycle = curTick();
+            if (curTick() != lastExecuteTick) {
+                lastExecuteTick = curTick();
             }
 
 
             if (inst->isMemRef()) {
                 panic("%s not configured to handle memory ops.\n", resName);
             } else if (inst->isControl()) {
+                if (lastControlTick == curTick()) {
+                    DPRINTF(InOrderExecute, "Can not Execute More than One 
Control "
+                            "Inst Per Cycle. Blocking Request.\n");
+                    exec_req->done(false);
+                    return;
+                }
+                lastControlTick = curTick();
+
                 // Evaluate Branch
                 fault = inst->execute();
                 executions++;
diff -r 87f4fd9a2760 -r 9b559768152b src/cpu/inorder/resources/execution_unit.hh
--- a/src/cpu/inorder/resources/execution_unit.hh       Fri Feb 04 00:08:16 
2011 -0500
+++ b/src/cpu/inorder/resources/execution_unit.hh       Fri Feb 04 00:08:17 
2011 -0500
@@ -74,7 +74,8 @@
     Stats::Scalar predictedCorrect;
     Stats::Formula mispredictPct;
     Stats::Scalar executions;
-    Tick lastExecuteCycle;
+    Tick lastExecuteTick;
+    Tick lastControlTick;
 };
 
 
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to