From 0bfdf342da40842a05351d53a384db4a8ff88bf5 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Sun, 19 Jun 2011 21:43:40 -0400 Subject: inorder: explicit fault check 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 | 4 +++- src/cpu/inorder/resources/graduation_unit.cc | 28 ++++++++++++++++++---------- src/cpu/inorder/resources/graduation_unit.hh | 1 + 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc index 834e591f8..232bf8279 100644 --- a/src/cpu/inorder/cpu.cc +++ b/src/cpu/inorder/cpu.cc @@ -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); diff --git a/src/cpu/inorder/resources/graduation_unit.cc b/src/cpu/inorder/resources/graduation_unit.cc index 4f796e933..617ef14f6 100644 --- a/src/cpu/inorder/resources/graduation_unit.cc +++ b/src/cpu/inorder/resources/graduation_unit.cc @@ -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())); diff --git a/src/cpu/inorder/resources/graduation_unit.hh b/src/cpu/inorder/resources/graduation_unit.hh index 043e375e7..01abae85b 100644 --- a/src/cpu/inorder/resources/graduation_unit.hh +++ b/src/cpu/inorder/resources/graduation_unit.hh @@ -46,6 +46,7 @@ class GraduationUnit : public Resource { typedef ThePipeline::DynInstPtr DynInstPtr; enum Command { + CheckFault, GraduateInst }; -- cgit v1.2.3