inorder: update graduation unit

make sure instructions are able to commit before writing back to the RF
do not commit more than 1 non-speculative instruction per cycle
This commit is contained in:
Korey Sewell 2011-02-18 14:30:05 -05:00
parent 89335118a5
commit 0fe19836c7
3 changed files with 13 additions and 12 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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];