From: Andrew Lukefahr Date: Sat, 11 Oct 2014 21:16:02 +0000 (-0500) Subject: cpu: Fix o3 SMT IQCount bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e07b36d2b6c1db8c4196336acc66d16e63f8ff3;p=gem5.git cpu: Fix o3 SMT IQCount bug Commmitted by: Nilay Vaish --- diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 7319b38a5..1c9799e41 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -1511,7 +1511,9 @@ template ThreadID DefaultFetch::iqCount() { - std::priority_queue PQ; + //sorted from lowest->highest + std::priority_queue, + std::greater > PQ; std::map threadMap; list::iterator threads = activeThreads->begin(); @@ -1521,6 +1523,8 @@ DefaultFetch::iqCount() ThreadID tid = *threads++; unsigned iqCount = fromIEW->iewInfo[tid].iqCount; + //we can potentially get tid collisions if two threads + //have the same iqCount, but this should be rare. PQ.push(iqCount); threadMap[iqCount] = tid; } @@ -1544,7 +1548,9 @@ template ThreadID DefaultFetch::lsqCount() { - std::priority_queue PQ; + //sorted from lowest->highest + std::priority_queue, + std::greater > PQ; std::map threadMap; list::iterator threads = activeThreads->begin(); @@ -1554,6 +1560,8 @@ DefaultFetch::lsqCount() ThreadID tid = *threads++; unsigned ldstqCount = fromIEW->iewInfo[tid].ldstqCount; + //we can potentially get tid collisions if two threads + //have the same iqCount, but this should be rare. PQ.push(ldstqCount); threadMap[ldstqCount] = tid; }