summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resources
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:40 -0400
committerKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:40 -0400
commit0bfdf342da40842a05351d53a384db4a8ff88bf5 (patch)
tree7167c1198b863ddb2b2e058527eda405fd256b49 /src/cpu/inorder/resources
parent5f608dd2e9a760b4280fb03ce82a11a62c6f3af9 (diff)
downloadgem5-0bfdf342da40842a05351d53a384db4a8ff88bf5.tar.xz
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.
Diffstat (limited to 'src/cpu/inorder/resources')
-rw-r--r--src/cpu/inorder/resources/graduation_unit.cc28
-rw-r--r--src/cpu/inorder/resources/graduation_unit.hh1
2 files changed, 19 insertions, 10 deletions
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
};