summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cpu/inorder/cpu.cc4
-rw-r--r--src/cpu/inorder/resources/graduation_unit.cc17
-rw-r--r--src/cpu/inorder/resources/graduation_unit.hh4
3 files changed, 13 insertions, 12 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
index 4130b9e14..0ec4c9861 100644
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -465,12 +465,12 @@ InOrderCPU::createBackEndSked(DynInstPtr inst)
W.needs(ExecUnit, ExecutionUnit::ExecuteInst);
}
+ W.needs(Grad, GraduationUnit::GraduateInst);
+
for (int idx=0; idx < inst->numDestRegs(); idx++) {
W.needs(RegManager, UseDefUnit::WriteDestReg, idx);
}
- 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 68adcbd1d..edc2fb3ff 100644
--- a/src/cpu/inorder/resources/graduation_unit.cc
+++ b/src/cpu/inorder/resources/graduation_unit.cc
@@ -37,8 +37,7 @@ GraduationUnit::GraduationUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu,
ThePipeline::Params *params)
: Resource(res_name, res_id, res_width, res_latency, _cpu),
- lastCycleGrad(0), numCycleGrad(0)
-
+ lastNonSpecTick(0)
{
for (ThreadID tid = 0; tid < ThePipeline::MaxThreads; tid++) {
nonSpecInstActive[tid] = &cpu->nonSpecInstActive[tid];
@@ -58,15 +57,18 @@ GraduationUnit::execute(int slot_num)
{
case GraduateInst:
{
- // Make sure this is the last thing on the resource schedule
- // @todo: replace this check
- // assert(inst->resSched.size() == 1);
+ 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
+ // Handle Any Faults Before Graduating Instruction
if (inst->fault != NoFault) {
cpu->trap(inst->fault, tid, inst);
grad_req->setCompleted(false);
- return;
+ return;
}
DPRINTF(InOrderGraduation,
@@ -81,6 +83,7 @@ GraduationUnit::execute(int slot_num)
DPRINTF(InOrderGraduation,
"[tid:%i] Non-speculative inst [sn:%i] graduated\n",
tid, inst->seqNum);
+ lastNonSpecTick = curTick();
}
if (inst->traceData) {
diff --git a/src/cpu/inorder/resources/graduation_unit.hh b/src/cpu/inorder/resources/graduation_unit.hh
index aae41993f..59631bfcb 100644
--- a/src/cpu/inorder/resources/graduation_unit.hh
+++ b/src/cpu/inorder/resources/graduation_unit.hh
@@ -57,9 +57,7 @@ class GraduationUnit : public Resource {
void execute(int slot_num);
protected:
- Tick lastCycleGrad;
- int numCycleGrad;
-
+ Tick lastNonSpecTick;
bool *nonSpecInstActive[ThePipeline::MaxThreads];
InstSeqNum *nonSpecSeqNum[ThePipeline::MaxThreads];