cpu-o3: prioritize exiting threads when committing (#1056)
Fix #1055. Prioritize committing from exiting threads before we consider other threads using the specified SMT commit policy. All instructions in the ROB for exiting threads should already have been squashed. Thus, this ensures that the ROB instruction queues for all exiting threads will be empty at the end of the current cycle, avoiding the assertion failure encountered in #1055. Change-Id: Ib0178a1aa6e94bce2b6c49dd87750e82776639dc
This commit is contained in:
@@ -1403,6 +1403,24 @@ ThreadID
|
||||
Commit::getCommittingThread()
|
||||
{
|
||||
if (numThreads > 1) {
|
||||
// If a thread is exiting, we need to ensure that *all* of its
|
||||
// instructions will be retired in this cycle, because the
|
||||
// thread will be removed from the CPU at the end of this cycle.
|
||||
// To ensure this, we prioritize committing from exiting threads
|
||||
// before we consider other threads using the specified SMT
|
||||
// commit policy.
|
||||
for (ThreadID tid : *activeThreads) {
|
||||
if (cpu->isThreadExiting(tid) &&
|
||||
!rob->isEmpty(tid) &&
|
||||
(commitStatus[tid] == Running ||
|
||||
commitStatus[tid] == Idle ||
|
||||
commitStatus[tid] == FetchTrapPending)) {
|
||||
assert(rob->isHeadReady(tid) &&
|
||||
rob->readHeadInst(tid)->isSquashed());
|
||||
return tid;
|
||||
}
|
||||
}
|
||||
|
||||
switch (commitPolicy) {
|
||||
case CommitPolicy::RoundRobin:
|
||||
return roundRobin();
|
||||
|
||||
Reference in New Issue
Block a user