cpu-o3: Fix "OldestReady" scheduling bug

Fixed a bug in the SMT scheduling function oldestReady(), where
the oldest sequence number and its thread id were mixed up.

Change-Id: I31df5eac73ecabbe04fb54624ee1b1867fa4d3c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46940
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Marton Erdos
2021-06-17 02:34:09 +01:00
committed by Giacomo Travaglini
parent 8eefaa58af
commit 4e028f8412

View File

@@ -1498,6 +1498,7 @@ ThreadID
Commit::oldestReady()
{
unsigned oldest = 0;
unsigned oldest_seq_num = 0;
bool first = true;
std::list<ThreadID>::iterator threads = activeThreads->begin();
@@ -1517,9 +1518,11 @@ Commit::oldestReady()
if (first) {
oldest = tid;
oldest_seq_num = head_inst->seqNum;
first = false;
} else if (head_inst->seqNum < oldest) {
} else if (head_inst->seqNum < oldest_seq_num) {
oldest = tid;
oldest_seq_num = head_inst->seqNum;
}
}
}