summaryrefslogtreecommitdiff
path: root/src/cpu/o3
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2009-04-15 23:12:00 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2009-04-15 23:12:00 -0700
commitb146131d18c1567acdc9bbba5acd73ade086ded8 (patch)
tree940e37f2300bb9281884ceed563afb12ea9aef9c /src/cpu/o3
parentbb974d5a47b05163d1286ea3e4e41d26b40f7de3 (diff)
downloadgem5-b146131d18c1567acdc9bbba5acd73ade086ded8.tar.xz
o3: handle fetch with no active threads correctly.
This situation can arise now on the first fetch cycle after the last active thread is halted. It seems easy enough to deal with when it happens rather than trying to avoid it.
Diffstat (limited to 'src/cpu/o3')
-rw-r--r--src/cpu/o3/fetch_impl.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index fcee2daa6..c3be74234 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -1326,7 +1326,10 @@ DefaultFetch<Impl>::getFetchingThread(FetchPriority &fetch_priority)
}
} else {
std::list<unsigned>::iterator thread = activeThreads->begin();
- assert(thread != activeThreads->end());
+ if (thread == activeThreads->end()) {
+ return -1;
+ }
+
int tid = *thread;
if (fetchStatus[tid] == Running ||