diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2007-11-08 10:46:41 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2007-11-08 10:46:41 -0500 |
commit | cf1c25dbcc22e2baddb78592df515081c4800a65 (patch) | |
tree | 0e58073c4b9230b047fac4a878a6313daf2b3408 /src/cpu/simple | |
parent | f4222610ea1106b60deb2fa659e580168a8ce511 (diff) | |
download | gem5-cf1c25dbcc22e2baddb78592df515081c4800a65.tar.xz |
AtomicSimpleCPU: Refactor resume() code to have a cleaner control path.
--HG--
extra : convert_revision : f27bb96850e7fb0252fb1f47c3d0860705c32884
Diffstat (limited to 'src/cpu/simple')
-rw-r--r-- | src/cpu/simple/atomic.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 4e52f9b33..9d7181cea 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -194,15 +194,16 @@ AtomicSimpleCPU::unserialize(Checkpoint *cp, const string §ion) void AtomicSimpleCPU::resume() { + if (_status == Idle || _status == SwitchedOut) + return; + DPRINTF(SimpleCPU, "Resume\n"); - if (_status != SwitchedOut && _status != Idle) { - assert(system->getMemoryMode() == Enums::atomic); + assert(system->getMemoryMode() == Enums::atomic); - changeState(SimObject::Running); - if (thread->status() == ThreadContext::Active) { - if (!tickEvent.scheduled()) { - tickEvent.schedule(nextCycle()); - } + changeState(SimObject::Running); + if (thread->status() == ThreadContext::Active) { + if (!tickEvent.scheduled()) { + tickEvent.schedule(nextCycle()); } } } |