From 8e07b36d2b6c1db8c4196336acc66d16e63f8ff3 Mon Sep 17 00:00:00 2001 From: Andrew Lukefahr Date: Sat, 11 Oct 2014 16:16:02 -0500 Subject: cpu: Fix o3 SMT IQCount bug Commmitted by: Nilay Vaish --- src/cpu/o3/fetch_impl.hh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/cpu/o3/fetch_impl.hh') 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; } -- cgit v1.2.3