deactivateThread(tid);
removeThread(tid);
+ // If this was the last thread then unschedule the tick event.
+ if (activeThreads.size() == 0) {
+ if (tickEvent.scheduled())
+ {
+ unscheduleTickEvent();
+ }
+ lastRunningCycle = curCycle();
+ _status = Idle;
+ }
updateCycleCounters(BaseCPU::CPU_STATE_SLEEP);
}
rename.clearStates(tid);
iew.clearStates(tid);
+ // Flush out any old data from the time buffers.
+ for (int i = 0; i < timeBuffer.getSize(); ++i) {
+ timeBuffer.advance();
+ fetchQueue.advance();
+ decodeQueue.advance();
+ renameQueue.advance();
+ iewQueue.advance();
+ }
+
// at this step, all instructions in the pipeline should be already
// either committed successfully or squashed. All thread-specific
// queues in the pipeline must be empty.
bool robTailUpdate = false;
+ unsigned int numInstsToSquash = squashWidth;
+
+ // If the CPU is exiting, squash all of the instructions
+ // it is told to, even if that exceeds the squashWidth.
+ // Set the number to the number of entries (the max).
+ if (cpu->isThreadExiting(tid))
+ {
+ numInstsToSquash = numEntries;
+ }
+
for (int numSquashed = 0;
- numSquashed < squashWidth &&
+ numSquashed < numInstsToSquash &&
squashIt[tid] != instList[tid].end() &&
(*squashIt[tid])->seqNum > squashedSeqNum[tid];
++numSquashed)