inorder: use trapPending flag to manage traps

This commit is contained in:
Korey Sewell 2011-06-19 21:43:41 -04:00
parent 5ef0b7a9db
commit 8c0def8d03
3 changed files with 10 additions and 4 deletions

View file

@ -149,6 +149,7 @@ InOrderCPU::CPUEvent::process()
DPRINTF(InOrderCPU, "Trapping CPU\n");
cpu->trap(fault, tid, inst);
cpu->resPool->trap(fault, tid, inst);
cpu->trapPending[tid] = false;
break;
#if !FULL_SYSTEM
@ -359,6 +360,8 @@ InOrderCPU::InOrderCPU(Params *params)
dummyTrapInst[tid]->setTid(tid);
#endif
trapPending[tid] = false;
}
dummyReqInst = new InOrderDynInst(this, NULL, 0, 0, 0);
@ -698,8 +701,8 @@ InOrderCPU::tick()
++numCycles;
checkForInterrupts();
bool pipes_idle = true;
//Tick each of the stages
for (int stNum=NumStages - 1; stNum >= 0 ; stNum--) {
pipelineStage[stNum]->tick();
@ -707,8 +710,6 @@ InOrderCPU::tick()
pipes_idle = pipes_idle && pipelineStage[stNum]->idle;
}
checkForInterrupts();
if (pipes_idle)
idleCycles++;
else
@ -902,6 +903,7 @@ void
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
{
scheduleCpuEvent(Trap, fault, tid, inst, delay);
trapPending[tid] = true;
}
void

View file

@ -667,6 +667,8 @@ class InOrderCPU : public BaseCPU
*/
std::queue<ListIt> removeList;
bool trapPending[ThePipeline::MaxThreads];
/** List of all the cpu event requests that will be removed at the end of
* the current cycle.
*/

View file

@ -66,7 +66,9 @@ GraduationUnit::execute(int slot_num)
return;
}
if (lastFaultTick[tid] == cur_tick) {
//@todo: use trap Pending
if (cpu->trapPending[tid]) {
//if (lastFaultTick[tid] == cur_tick) {
DPRINTF(InOrderGraduation, "Unable to graduate [sn:%i]. "
"Only 1 fault can be handled per tick.\n");
grad_req->done(false);