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.
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index fcee2da..c3be742 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -1326,7 +1326,10 @@
}
} 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 ||