From: Steve Reinhardt Date: Thu, 16 Apr 2009 06:12:00 +0000 (-0700) Subject: o3: handle fetch with no active threads correctly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b146131d18c1567acdc9bbba5acd73ade086ded8;p=gem5.git 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 fcee2daa6..c3be74234 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -1326,7 +1326,10 @@ DefaultFetch::getFetchingThread(FetchPriority &fetch_priority) } } else { std::list::iterator thread = activeThreads->begin(); - assert(thread != activeThreads->end()); + if (thread == activeThreads->end()) { + return -1; + } + int tid = *thread; if (fetchStatus[tid] == Running ||