inorder: explicit fault check
authorKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:40 +0000 (21:43 -0400)
committerKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:40 +0000 (21:43 -0400)
Before graduating an instruction, explicitly check fault
by making the fault check it's own separate command
that can be put on an instruction schedule.

src/cpu/inorder/cpu.cc
src/cpu/inorder/resources/graduation_unit.cc
src/cpu/inorder/resources/graduation_unit.hh

index 834e591f8a0d19b9196502dee2555e4c6ecf157e..232bf8279f90895871e5981b689fb72f72c71f0a 100644 (file)
@@ -517,7 +517,7 @@ InOrderCPU::createBackEndSked(DynInstPtr inst)
         }
     }
 
-    W.needs(Grad, GraduationUnit::GraduateInst);
+    W.needs(Grad, GraduationUnit::CheckFault);
 
     for (int idx=0; idx < inst->numDestRegs(); idx++) {
         W.needs(RegManager, UseDefUnit::WriteDestReg, idx);
@@ -526,6 +526,8 @@ InOrderCPU::createBackEndSked(DynInstPtr inst)
     if (inst->isControl())
         W.needs(BPred, BranchPredictor::UpdatePredictor);
 
+    W.needs(Grad, GraduationUnit::GraduateInst);
+
     // Insert Back Schedule into our cache of
     // resource schedules
     addToSkedCache(inst, res_sked);
index 4f796e9331b680c2284fd4312aa97e78f1a13fad..617ef14f67d2a17f89ece41b2a98ebc1996ed911 100644 (file)
@@ -56,25 +56,33 @@ GraduationUnit::execute(int slot_num)
 
     switch (grad_req->cmd)
     {
-      case GraduateInst:
+      case CheckFault:
         {
-            if (lastNonSpecTick == curTick()) {
-                DPRINTF(InOrderGraduation, "Unable to graduate [sn:%i]. "
-                        "Only 1 nonspec inst. per cycle can graduate.\n");
-                grad_req->done(false);
-                return;
-            }
-
             // Handle Any Faults Before Graduating Instruction
             if (inst->fault != NoFault) {
-                DPRINTF(Fault, "[sn:%i]: fault %s found for %s\n",
-                        inst->seqNum, inst->fault->name(),
+                DPRINTF(InOrderGraduation, "[tid:%i]: [sn:%i]: fault %s found for %s\n",
+                        tid, inst->seqNum, inst->fault->name(),
                         inst->instName());
                 squashThenTrap(stage_num, inst);
                 grad_req->done(false);
                 return;
             }
 
+            DPRINTF(InOrderGraduation, "[tid:%i] [sn:%i]: No fault found for %s\n",
+                    tid, inst->seqNum, inst->instName());
+            grad_req->done();
+        }
+        break;
+
+      case GraduateInst:
+        {
+            if (lastNonSpecTick == curTick()) {
+                DPRINTF(InOrderGraduation, "Unable to graduate [sn:%i]. "
+                        "Only 1 nonspec inst. per cycle can graduate.\n");
+                grad_req->done(false);
+                return;
+            }
+
             DPRINTF(InOrderGraduation,
                     "[tid:%i]:[sn:%i]: Graduating instruction %s.\n",
                     tid, inst->seqNum, inst->staticInst->disassemble(inst->instAddr()));
index 043e375e76260731094b6e521e074dc4eef56b37..01abae85bc37c482bf0b0854fbd968afa2dbf01c 100644 (file)
@@ -46,6 +46,7 @@ class GraduationUnit : public Resource {
     typedef ThePipeline::DynInstPtr DynInstPtr;
 
     enum Command {
+        CheckFault,
         GraduateInst
     };