+void
+InOrderCPU::checkForInterrupts()
+{
+ for (int i = 0; i < threadContexts.size(); i++) {
+ ThreadContext *tc = threadContexts[i];
+
+ if (interrupts->checkInterrupts(tc)) {
+ Fault interrupt = interrupts->getInterrupt(tc);
+
+ if (interrupt != NoFault) {
+ DPRINTF(Interrupt, "Processing Intterupt for [tid:%i].\n",
+ tc->threadId());
+
+ ThreadID tid = tc->threadId();
+ interrupts->updateIntrInfo(tc);
+
+ // Squash from Last Stage in Pipeline
+ unsigned last_stage = NumStages - 1;
+ dummyTrapInst[tid]->squashingStage = last_stage;
+ pipelineStage[last_stage]->setupSquash(dummyTrapInst[tid],
+ tid);
+
+ // By default, setupSquash will always squash from stage + 1
+ pipelineStage[BackEndStartStage - 1]->setupSquash(dummyTrapInst[tid],
+ tid);
+
+ // Schedule Squash Through-out Resource Pool
+ resPool->scheduleEvent(
+ (InOrderCPU::CPUEventType)ResourcePool::SquashAll,
+ dummyTrapInst[tid], Cycles(0));
+
+ // Finally, Setup Trap to happen at end of cycle
+ trapContext(interrupt, tid, dummyTrapInst[tid]);
+ }
+ }
+ }
+}