Merge ktlim@zizzer:/bk/newmem
into zamp.eecs.umich.edu:/z/ktlim2/clean/newmem-busfix --HG-- extra : convert_revision : 6ef2249bfa3f7149830efdb42a313422090da7d7
This commit is contained in:
commit
fd213f7270
2 changed files with 29 additions and 26 deletions
|
@ -392,6 +392,9 @@ class DefaultCommit
|
||||||
*/
|
*/
|
||||||
Tick trapLatency;
|
Tick trapLatency;
|
||||||
|
|
||||||
|
/** The interrupt fault. */
|
||||||
|
Fault interrupt;
|
||||||
|
|
||||||
/** The commit PC of each thread. Refers to the instruction that
|
/** The commit PC of each thread. Refers to the instruction that
|
||||||
* is currently being processed/committed.
|
* is currently being processed/committed.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -122,6 +122,9 @@ DefaultCommit<Impl>::DefaultCommit(Params *params)
|
||||||
tcSquash[i] = false;
|
tcSquash[i] = false;
|
||||||
PC[i] = nextPC[i] = nextNPC[i] = 0;
|
PC[i] = nextPC[i] = nextNPC[i] = 0;
|
||||||
}
|
}
|
||||||
|
#if FULL_SYSTEM
|
||||||
|
interrupt = NoFault;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
|
@ -635,28 +638,7 @@ DefaultCommit<Impl>::commit()
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
|
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
// Process interrupts if interrupts are enabled, not in PAL mode,
|
if (interrupt != NoFault) {
|
||||||
// and no other traps or external squashes are currently pending.
|
|
||||||
// @todo: Allow other threads to handle interrupts.
|
|
||||||
if (cpu->checkInterrupts &&
|
|
||||||
cpu->check_interrupts(cpu->tcBase(0)) &&
|
|
||||||
commitStatus[0] != TrapPending &&
|
|
||||||
!trapSquash[0] &&
|
|
||||||
!tcSquash[0]) {
|
|
||||||
|
|
||||||
// Get any interrupt that happened
|
|
||||||
Fault intr = cpu->getInterrupts();
|
|
||||||
|
|
||||||
// Exit this if block if there's no fault.
|
|
||||||
if (intr == NoFault) {
|
|
||||||
goto commit_insts;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tell fetch that there is an interrupt pending. This will
|
|
||||||
// make fetch wait until it sees a non PAL-mode PC, at which
|
|
||||||
// point it stops fetching instructions.
|
|
||||||
toIEW->commitInfo[0].interruptPending = true;
|
|
||||||
|
|
||||||
// Wait until the ROB is empty and all stores have drained in
|
// Wait until the ROB is empty and all stores have drained in
|
||||||
// order to enter the interrupt.
|
// order to enter the interrupt.
|
||||||
if (rob->isEmpty() && !iewStage->hasStoresToWB()) {
|
if (rob->isEmpty() && !iewStage->hasStoresToWB()) {
|
||||||
|
@ -668,7 +650,7 @@ DefaultCommit<Impl>::commit()
|
||||||
thread[0]->inSyscall = true;
|
thread[0]->inSyscall = true;
|
||||||
|
|
||||||
// CPU will handle interrupt.
|
// CPU will handle interrupt.
|
||||||
cpu->processInterrupts(intr);
|
cpu->processInterrupts(interrupt);
|
||||||
|
|
||||||
thread[0]->inSyscall = false;
|
thread[0]->inSyscall = false;
|
||||||
|
|
||||||
|
@ -677,15 +659,33 @@ DefaultCommit<Impl>::commit()
|
||||||
// Generate trap squash event.
|
// Generate trap squash event.
|
||||||
generateTrapEvent(0);
|
generateTrapEvent(0);
|
||||||
|
|
||||||
|
// Clear the interrupt now that it's been handled
|
||||||
toIEW->commitInfo[0].clearInterrupt = true;
|
toIEW->commitInfo[0].clearInterrupt = true;
|
||||||
|
interrupt = NoFault;
|
||||||
} else {
|
} else {
|
||||||
DPRINTF(Commit, "Interrupt pending, waiting for ROB to empty.\n");
|
DPRINTF(Commit, "Interrupt pending, waiting for ROB to empty.\n");
|
||||||
}
|
}
|
||||||
|
} else if (cpu->checkInterrupts &&
|
||||||
|
cpu->check_interrupts(cpu->tcBase(0)) &&
|
||||||
|
commitStatus[0] != TrapPending &&
|
||||||
|
!trapSquash[0] &&
|
||||||
|
!tcSquash[0]) {
|
||||||
|
// Process interrupts if interrupts are enabled, not in PAL
|
||||||
|
// mode, and no other traps or external squashes are currently
|
||||||
|
// pending.
|
||||||
|
// @todo: Allow other threads to handle interrupts.
|
||||||
|
|
||||||
|
// Get any interrupt that happened
|
||||||
|
interrupt = cpu->getInterrupts();
|
||||||
|
|
||||||
|
if (interrupt != NoFault) {
|
||||||
|
// Tell fetch that there is an interrupt pending. This
|
||||||
|
// will make fetch wait until it sees a non PAL-mode PC,
|
||||||
|
// at which point it stops fetching instructions.
|
||||||
|
toIEW->commitInfo[0].interruptPending = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label for goto. Not pretty but more readable than really big
|
|
||||||
// if statement above.
|
|
||||||
commit_insts:
|
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|
Loading…
Reference in a new issue