changeset 5485da0578d1 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=5485da0578d1
description:
        inorder: recognize isSerializeAfter flag
        keep track of when an instruction needs the execution
        behind it to be serialized. Without this, in SE Mode
        instructions can execute behind a system call exit().

diffstat:

 src/cpu/inorder/resources/execution_unit.cc |  34 +++++++++++++++++++++-------
 src/cpu/inorder/resources/execution_unit.hh |   1 +
 2 files changed, 26 insertions(+), 9 deletions(-)

diffs (71 lines):

diff -r a03f0e3b41c5 -r 5485da0578d1 src/cpu/inorder/resources/execution_unit.cc
--- a/src/cpu/inorder/resources/execution_unit.cc       Fri Feb 18 14:29:44 
2011 -0500
+++ b/src/cpu/inorder/resources/execution_unit.cc       Fri Feb 18 14:29:48 
2011 -0500
@@ -42,7 +42,7 @@
                              int res_latency, InOrderCPU *_cpu,
                              ThePipeline::Params *params)
     : Resource(res_name, res_id, res_width, res_latency, _cpu),
-      lastExecuteTick(0), lastControlTick(0)
+      lastExecuteTick(0), lastControlTick(0), serializeTick(0)
 { }
 
 void
@@ -86,23 +86,39 @@
     DynInstPtr inst = reqs[slot_num]->inst;
     Fault fault = NoFault;
     int seq_num = inst->seqNum;
+    Tick cur_tick = curTick();
 
-    DPRINTF(InOrderExecute, "[tid:%i] Executing [sn:%i] [PC:%s] %s.\n",
-            inst->readTid(), seq_num, inst->pcState(), inst->instName());
+    if (cur_tick == serializeTick) {
+        DPRINTF(InOrderExecute, "Can not execute [tid:%i][sn:%i][PC:%s] %s. "
+                "All instructions are being serialized this cycle\n",
+                inst->readTid(), seq_num, inst->pcState(), inst->instName());
+        exec_req->done(false);
+        return;
+    }
+
 
     switch (exec_req->cmd)
     {
       case ExecuteInst:
         {
-            if (curTick() != lastExecuteTick) {
-                lastExecuteTick = curTick();
+            DPRINTF(InOrderExecute, "[tid:%i] Executing [sn:%i] [PC:%s] %s.\n",
+                    inst->readTid(), seq_num, inst->pcState(), 
inst->instName());
+
+            if (cur_tick != lastExecuteTick) {
+                lastExecuteTick = cur_tick;
             }
 
+            assert(!inst->isMemRef());
 
-            if (inst->isMemRef()) {
-                panic("%s not configured to handle memory ops.\n", resName);
-            } else if (inst->isControl()) {
-                if (lastControlTick == curTick()) {
+            if (inst->isSerializeAfter()) {
+                serializeTick = cur_tick;
+                DPRINTF(InOrderExecute, "Serializing execution after [tid:%i] "
+                        "[sn:%i] [PC:%s] %s.\n", inst->readTid(), seq_num,
+                        inst->pcState(), inst->instName());
+            }
+
+            if (inst->isControl()) {
+                if (lastControlTick == cur_tick) {
                     DPRINTF(InOrderExecute, "Can not Execute More than One 
Control "
                             "Inst Per Cycle. Blocking Request.\n");
                     exec_req->done(false);
diff -r a03f0e3b41c5 -r 5485da0578d1 src/cpu/inorder/resources/execution_unit.hh
--- a/src/cpu/inorder/resources/execution_unit.hh       Fri Feb 18 14:29:44 
2011 -0500
+++ b/src/cpu/inorder/resources/execution_unit.hh       Fri Feb 18 14:29:48 
2011 -0500
@@ -76,6 +76,7 @@
     Stats::Scalar executions;
     Tick lastExecuteTick;
     Tick lastControlTick;
+    Tick serializeTick;
 };
 
 
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to