From a10685ad1e3077e6f4a059f984a4964e37dac807 Mon Sep 17 00:00:00 2001 From: "Timothy M. Jones" Date: Fri, 25 Feb 2011 13:50:29 +0000 Subject: [PATCH] O3CPU: Fix iqCount and lsqCount SMT fetch policies. Fixes two of the SMT fetch policies in O3CPU that were returning the count of instructions in the IQ or LSQ rather than the thread ID to fetch from. --- src/cpu/o3/fetch_impl.hh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 2c4906760..a2f2b4f8a 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -1404,19 +1404,22 @@ template ThreadID DefaultFetch::iqCount() { - std::priority_queue PQ; + std::priority_queue PQ; + std::map threadMap; list::iterator threads = activeThreads->begin(); list::iterator end = activeThreads->end(); while (threads != end) { ThreadID tid = *threads++; + unsigned iqCount = fromIEW->iewInfo[tid].iqCount; - PQ.push(fromIEW->iewInfo[tid].iqCount); + PQ.push(iqCount); + threadMap[iqCount] = tid; } while (!PQ.empty()) { - ThreadID high_pri = PQ.top(); + ThreadID high_pri = threadMap[PQ.top()]; if (fetchStatus[high_pri] == Running || fetchStatus[high_pri] == IcacheAccessComplete || @@ -1434,19 +1437,22 @@ template ThreadID DefaultFetch::lsqCount() { - std::priority_queue PQ; + std::priority_queue PQ; + std::map threadMap; list::iterator threads = activeThreads->begin(); list::iterator end = activeThreads->end(); while (threads != end) { ThreadID tid = *threads++; + unsigned ldstqCount = fromIEW->iewInfo[tid].ldstqCount; - PQ.push(fromIEW->iewInfo[tid].ldstqCount); + PQ.push(ldstqCount); + threadMap[ldstqCount] = tid; } while (!PQ.empty()) { - ThreadID high_pri = PQ.top(); + ThreadID high_pri = threadMap[PQ.top()]; if (fetchStatus[high_pri] == Running || fetchStatus[high_pri] == IcacheAccessComplete || -- 2.30.2