inorder: handle faults at writeback stage
authorKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:34 +0000 (21:43 -0400)
committerKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:34 +0000 (21:43 -0400)
call trap function when a fault is received

src/cpu/inorder/cpu.cc
src/cpu/inorder/resources/decode_unit.cc
src/cpu/inorder/resources/execution_unit.cc
src/cpu/inorder/resources/graduation_unit.cc
src/cpu/inorder/resources/use_def.cc

index f1c531c534f7b3cb1ef39a056ddc5f9f834437a5..f9f7d6145cbd36c98aebbaca4a8c5e644488d147 100644 (file)
@@ -141,6 +141,7 @@ InOrderCPU::CPUEvent::process()
         break;
 
       case Trap:
+        DPRINTF(InOrderCPU, "Trapping CPU\n");
         cpu->trapCPU(fault, tid, inst);
         break;
 
index 559becaaf22989b3743a51c0f062b3c2db737412..ccebddfafcc48f620c1b876327e4926692de8507 100644 (file)
@@ -64,8 +64,8 @@ DecodeUnit::execute(int slot_num)
 
             if (inst->backSked != NULL) {
                 DPRINTF(InOrderDecode,
-                    "[tid:%i]: Setting Destination Register(s) for [sn:%i].\n",
-                    tid, inst->seqNum);
+                    "[tid:%i]: %s Setting Destination Register(s) for [sn:%i].\n",
+                        tid, inst->instName(), inst->seqNum);
                 regDepMap[tid]->insert(inst);
 
                 //inst->printSked();
index 6c9b6322fcf8755994109f2bda797be9d8313fbd..2e52c5ac5621ebd7100a0153b3f78513685bef9d 100644 (file)
@@ -249,8 +249,9 @@ ExecutionUnit::execute(int slot_num)
 
                     exec_req->done();
                 } else {
-                    warn("inst [sn:%i] had a %s fault",
-                         seq_num, fault->name());
+                    warn("inst [sn:%i] had a %s fault", seq_num, fault->name());
+
+                    exec_req->done();
                 }
             } else {
                 // Regular ALU instruction
index a7530345e60d9985cd777d928594e78d9c2d1913..826ed8e03505e2dc8dd2cf41457b0c9b65ae2e87 100644 (file)
@@ -68,13 +68,11 @@ GraduationUnit::execute(int slot_num)
             // Handle Any Faults Before Graduating Instruction
             if (inst->fault != NoFault) {
                 cpu->trap(inst->fault, tid, inst);
-                grad_req->setCompleted(false);
-                return;
             }
 
             DPRINTF(InOrderGraduation,
-                    "[tid:%i] Graduating instruction [sn:%i].\n",
-                    tid, inst->seqNum);
+                    "[tid:%i] Graduating instruction %s [sn:%i].\n",
+                    tid, inst->instName(), inst->seqNum);
 
             // Release Non-Speculative "Block" on instructions that could not
             // execute because there was a non-speculative inst. active.
index d05f42413ae54c35803cd6d566d7d4f9b4fbfd61..5bc78d6ba59dc3bf088de01afb676a2bbfc26965 100644 (file)
@@ -148,11 +148,11 @@ UseDefUnit::execute(int slot_idx)
 
     // If there is a non-speculative instruction
     // in the pipeline then stall instructions here
-    if (*nonSpecInstActive[tid] == true &&
-        seq_num > *nonSpecSeqNum[tid]) {
+    if (*nonSpecInstActive[tid] == true && seq_num > *nonSpecSeqNum[tid]) {
         DPRINTF(InOrderUseDef, "[tid:%i]: [sn:%i] cannot execute because"
                 "there is non-speculative instruction [sn:%i] has not "
                 "graduated.\n", tid, seq_num, *nonSpecSeqNum[tid]);
+        ud_req->done(false);
         return;
     } else if (inst->isNonSpeculative()) {
         *nonSpecInstActive[tid] = true;