inorder: use trapPending flag to manage traps
This commit is contained in:
parent
5ef0b7a9db
commit
8c0def8d03
3 changed files with 10 additions and 4 deletions
|
@ -149,6 +149,7 @@ InOrderCPU::CPUEvent::process()
|
||||||
DPRINTF(InOrderCPU, "Trapping CPU\n");
|
DPRINTF(InOrderCPU, "Trapping CPU\n");
|
||||||
cpu->trap(fault, tid, inst);
|
cpu->trap(fault, tid, inst);
|
||||||
cpu->resPool->trap(fault, tid, inst);
|
cpu->resPool->trap(fault, tid, inst);
|
||||||
|
cpu->trapPending[tid] = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if !FULL_SYSTEM
|
#if !FULL_SYSTEM
|
||||||
|
@ -359,6 +360,8 @@ InOrderCPU::InOrderCPU(Params *params)
|
||||||
dummyTrapInst[tid]->setTid(tid);
|
dummyTrapInst[tid]->setTid(tid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
trapPending[tid] = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dummyReqInst = new InOrderDynInst(this, NULL, 0, 0, 0);
|
dummyReqInst = new InOrderDynInst(this, NULL, 0, 0, 0);
|
||||||
|
@ -698,8 +701,8 @@ InOrderCPU::tick()
|
||||||
|
|
||||||
++numCycles;
|
++numCycles;
|
||||||
|
|
||||||
|
checkForInterrupts();
|
||||||
bool pipes_idle = true;
|
bool pipes_idle = true;
|
||||||
|
|
||||||
//Tick each of the stages
|
//Tick each of the stages
|
||||||
for (int stNum=NumStages - 1; stNum >= 0 ; stNum--) {
|
for (int stNum=NumStages - 1; stNum >= 0 ; stNum--) {
|
||||||
pipelineStage[stNum]->tick();
|
pipelineStage[stNum]->tick();
|
||||||
|
@ -707,8 +710,6 @@ InOrderCPU::tick()
|
||||||
pipes_idle = pipes_idle && pipelineStage[stNum]->idle;
|
pipes_idle = pipes_idle && pipelineStage[stNum]->idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForInterrupts();
|
|
||||||
|
|
||||||
if (pipes_idle)
|
if (pipes_idle)
|
||||||
idleCycles++;
|
idleCycles++;
|
||||||
else
|
else
|
||||||
|
@ -902,6 +903,7 @@ void
|
||||||
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
|
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
|
||||||
{
|
{
|
||||||
scheduleCpuEvent(Trap, fault, tid, inst, delay);
|
scheduleCpuEvent(Trap, fault, tid, inst, delay);
|
||||||
|
trapPending[tid] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -667,6 +667,8 @@ class InOrderCPU : public BaseCPU
|
||||||
*/
|
*/
|
||||||
std::queue<ListIt> removeList;
|
std::queue<ListIt> removeList;
|
||||||
|
|
||||||
|
bool trapPending[ThePipeline::MaxThreads];
|
||||||
|
|
||||||
/** List of all the cpu event requests that will be removed at the end of
|
/** List of all the cpu event requests that will be removed at the end of
|
||||||
* the current cycle.
|
* the current cycle.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -66,7 +66,9 @@ GraduationUnit::execute(int slot_num)
|
||||||
return;
|
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]. "
|
DPRINTF(InOrderGraduation, "Unable to graduate [sn:%i]. "
|
||||||
"Only 1 fault can be handled per tick.\n");
|
"Only 1 fault can be handled per tick.\n");
|
||||||
grad_req->done(false);
|
grad_req->done(false);
|
||||||
|
|
Loading…
Reference in a new issue