diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2009-04-15 23:12:00 -0700 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2009-04-15 23:12:00 -0700 |
commit | b146131d18c1567acdc9bbba5acd73ade086ded8 (patch) | |
tree | 940e37f2300bb9281884ceed563afb12ea9aef9c /src | |
parent | bb974d5a47b05163d1286ea3e4e41d26b40f7de3 (diff) | |
download | gem5-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')
-rw-r--r-- | src/cpu/o3/fetch_impl.hh | 5 |
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 || |