161c161
< switchCount(0),
---
> drainCount(0),
716,717c716,717
< void
< FullO3CPU<Impl>::switchOut()
---
> bool
> FullO3CPU<Impl>::drain(Event *drain_event)
719,724c719,725
< 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();
729a731,732
>
> return false;
734c737
< FullO3CPU<Impl>::signalSwitched()
---
> FullO3CPU<Impl>::resume()
736,743c739,745
< 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();
745,748c747,750
< #if USE_CHECKER
< if (checker)
< checker->switchOut();
< #endif
---
> if (!tickEvent.scheduled())
> tickEvent.schedule(curTick);
> _status = Running;
> }
749a752,756
> template <class Impl>
> void
> FullO3CPU<Impl>::signalDrained()
> {
> if (++drainCount == NumStages) {
752c759,760
< _status = SwitchedOut;
---
> _status = Drained;
> drainEvent->process();
754c762
< assert(switchCount <= 5);
---
> assert(drainCount <= 5);
758a767,785
> 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