summaryrefslogtreecommitdiff
path: root/src/cpu/o3/fetch_impl.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-01-03 00:52:30 -0500
committerGabe Black <gblack@eecs.umich.edu>2007-01-03 00:52:30 -0500
commit8840ebcb00f3988c781063e572b6df5742968f95 (patch)
treee9711f561dff45b31489a7fb539ed98660e26d0e /src/cpu/o3/fetch_impl.hh
parenta0e8aa6737f534a8e51d866728dd6dc59bef263d (diff)
parent7d7f3d0e99eca98a5659e73bce56d615f0ed4fc3 (diff)
downloadgem5-8840ebcb00f3988c781063e572b6df5742968f95.tar.xz
Merge zizzer:/bk/newmem
into zower.eecs.umich.edu:/eecshome/m5/newmem --HG-- extra : convert_revision : f4a05accb8fa24d425dd818b1b7f268378180e99
Diffstat (limited to 'src/cpu/o3/fetch_impl.hh')
-rw-r--r--src/cpu/o3/fetch_impl.hh33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index 79e723fcd..90d3868a5 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -727,10 +727,10 @@ typename DefaultFetch<Impl>::FetchStatus
DefaultFetch<Impl>::updateFetchStatus()
{
//Check Running
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
-
- while (threads != (*activeThreads).end()) {
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+ while (threads != end) {
unsigned tid = *threads++;
if (fetchStatus[tid] == Running ||
@@ -785,12 +785,13 @@ template <class Impl>
void
DefaultFetch<Impl>::tick()
{
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
bool status_change = false;
wroteToTimeBuffer = false;
- while (threads != (*activeThreads).end()) {
+ while (threads != end) {
unsigned tid = *threads++;
// Check the signals for each thread to determine the proper status
@@ -1313,7 +1314,9 @@ DefaultFetch<Impl>::getFetchingThread(FetchPriority &fetch_priority)
return -1;
}
} else {
- int tid = *((*activeThreads).begin());
+ std::list<unsigned>::iterator thread = activeThreads->begin();
+ assert(thread != activeThreads->end());
+ int tid = *thread;
if (fetchStatus[tid] == Running ||
fetchStatus[tid] == IcacheAccessComplete ||
@@ -1363,9 +1366,10 @@ DefaultFetch<Impl>::iqCount()
{
std::priority_queue<unsigned> PQ;
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- while (threads != (*activeThreads).end()) {
+ while (threads != end) {
unsigned tid = *threads++;
PQ.push(fromIEW->iewInfo[tid].iqCount);
@@ -1393,10 +1397,10 @@ DefaultFetch<Impl>::lsqCount()
{
std::priority_queue<unsigned> PQ;
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
-
- while (threads != (*activeThreads).end()) {
+ while (threads != end) {
unsigned tid = *threads++;
PQ.push(fromIEW->iewInfo[tid].ldstqCount);
@@ -1422,7 +1426,10 @@ template<class Impl>
int
DefaultFetch<Impl>::branchCount()
{
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator thread = activeThreads->begin();
+ assert(thread != activeThreads->end());
+ unsigned tid = *thread;
+
panic("Branch Count Fetch policy unimplemented\n");
- return *threads;
+ return 0 * tid;
}