161c161
< switchCount(0),
---
> drainCount(0),
711,712c711,712
< void
< FullO3CPU<Impl>::switchOut()
---
> bool
> FullO3CPU<Impl>::drain(Event *drain_event)
714,719c714,720
< switchCount = 0;
< fetch.switchOut();
< decode.switchOut();
< rename.switchOut();
< iew.switchOut();
< commit.switchOut();
---
> drainCount = 0;
> drainEvent = drain_event;
> fetch.drain();
> decode.drain();
> rename.drain();
> iew.drain();
> commit.drain();
724a726,727
>
> return false;
729c732
< FullO3CPU<Impl>::signalSwitched()
---
> FullO3CPU<Impl>::resume()
731,738c734,740
< if (++switchCount == NumStages) {
< fetch.doSwitchOut();
< rename.doSwitchOut();
< commit.doSwitchOut();
< instList.clear();
< while (!removeList.empty()) {
< removeList.pop();
< }
---
> if (_status == SwitchedOut)
> return;
> fetch.resume();
> decode.resume();
> rename.resume();
> iew.resume();
> commit.resume();
740,743c742,745
< #if USE_CHECKER
< if (checker)
< checker->switchOut();
< #endif
---
> if (!tickEvent.scheduled())
> tickEvent.schedule(curTick);
> _status = Running;
> }
744a747,751
> template <class Impl>
> void
> FullO3CPU<Impl>::signalDrained()
> {
> if (++drainCount == NumStages) {
747c754,755
< _status = SwitchedOut;
---
> _status = Drained;
> drainEvent->process();
749c757
< assert(switchCount <= 5);
---
> assert(drainCount <= 5);
753a762,780
> FullO3CPU<Impl>::switchOut()
> {
> fetch.switchOut();
> rename.switchOut();
> commit.switchOut();
> instList.clear();
> while (!removeList.empty()) {
> removeList.pop();
> }
>
> _status = SwitchedOut;
> #if USE_CHECKER
> if (checker)
> checker->switchOut();
> #endif
> }
>
> template <class Impl>
> void