diff options
author | Kevin Lim <ktlim@umich.edu> | 2006-11-09 11:33:44 -0500 |
---|---|---|
committer | Kevin Lim <ktlim@umich.edu> | 2006-11-09 11:33:44 -0500 |
commit | 0b0d5a282a25a936d4aa92ec81ef2bd50141ce03 (patch) | |
tree | 1bf75a956efa4df7a0297dd91da3efe1f7bca4c0 /src/cpu | |
parent | 344f72dd62f6cc9ab8c7ab5454a320b2e5674a37 (diff) | |
download | gem5-0b0d5a282a25a936d4aa92ec81ef2bd50141ce03.tar.xz |
Draining fixes.
src/cpu/o3/cpu.cc:
Handle draining properly when CPU isn't actually being used.
src/cpu/simple/atomic.cc:
Be sure to set status properly when draining.
src/mem/bus.cc:
Fix for draining.
--HG--
extra : convert_revision : d9796e6693e974f022159029fc9743c49a970c8f
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/o3/cpu.cc | 6 | ||||
-rw-r--r-- | src/cpu/simple/atomic.cc | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index dfe42d882..580816372 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -819,6 +819,12 @@ unsigned int FullO3CPU<Impl>::drain(Event *drain_event) { DPRINTF(O3CPU, "Switching out\n"); + + // If the CPU isn't doing anything, then return immediately. + if (_status == Idle || _status == SwitchedOut) { + return 0; + } + drainCount = 0; fetch.drain(); decode.drain(); diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 4f68cfd6f..f94ea0917 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -213,6 +213,9 @@ AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU) break; } } + if (_status != Running) { + _status = Idle; + } } |