diff options
author | Andrew Lukefahr <lukefahr@umich.edu> | 2014-10-11 16:16:02 -0500 |
---|---|---|
committer | Andrew Lukefahr <lukefahr@umich.edu> | 2014-10-11 16:16:02 -0500 |
commit | 8e07b36d2b6c1db8c4196336acc66d16e63f8ff3 (patch) | |
tree | 636f9651d3b4913385a3d7a713c79ea588d63a0d /src/cpu | |
parent | 19ca35737d8ca48f9f0d9e788871d78ec1bb4e8a (diff) | |
download | gem5-8e07b36d2b6c1db8c4196336acc66d16e63f8ff3.tar.xz |
cpu: Fix o3 SMT IQCount bug
Commmitted by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/o3/fetch_impl.hh | 12 |
1 files changed, 10 insertions, 2 deletions
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<class Impl> ThreadID DefaultFetch<Impl>::iqCount() { - std::priority_queue<unsigned> PQ; + //sorted from lowest->highest + std::priority_queue<unsigned,vector<unsigned>, + std::greater<unsigned> > PQ; std::map<unsigned, ThreadID> threadMap; list<ThreadID>::iterator threads = activeThreads->begin(); @@ -1521,6 +1523,8 @@ DefaultFetch<Impl>::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<class Impl> ThreadID DefaultFetch<Impl>::lsqCount() { - std::priority_queue<unsigned> PQ; + //sorted from lowest->highest + std::priority_queue<unsigned,vector<unsigned>, + std::greater<unsigned> > PQ; std::map<unsigned, ThreadID> threadMap; list<ThreadID>::iterator threads = activeThreads->begin(); @@ -1554,6 +1560,8 @@ DefaultFetch<Impl>::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; } |