diff -r e2c43045a81b -r b2bfc7a0275f src/cpu/o3/fetch_impl.hh --- a/src/cpu/o3/fetch_impl.hh Tue Sep 09 04:36:43 2014 -0400 +++ b/src/cpu/o3/fetch_impl.hh Mon Sep 15 14:08:42 2014 -0400 @@ -1515,7 +1515,9 @@ 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(); @@ -1525,6 +1527,8 @@ 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; } @@ -1548,7 +1552,9 @@ 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(); @@ -1558,6 +1564,8 @@ 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; }