2c2
< * Copyright (c) 2010-2011 ARM Limited
---
> * Copyright (c) 2010-2012 ARM Limited
56a57
> #include "debug/Drain.hh"
76,77c77
< numThreads(params->numThreads),
< switchedOut(false)
---
> numThreads(params->numThreads)
363c363
< DefaultIEW<Impl>::drain()
---
> DefaultIEW<Impl>::isDrained() const
365,368c365
< // IEW is ready to drain at any time.
< cpu->signalDrained();
< return true;
< }
---
> bool drained(ldstQueue.isDrained());
370,373c367,378
< template <class Impl>
< void
< DefaultIEW<Impl>::resume()
< {
---
> for (ThreadID tid = 0; tid < numThreads; tid++) {
> if (!insts[tid].empty()) {
> DPRINTF(Drain, "%i: Insts not empty.\n", tid);
> drained = false;
> }
> if (!skidBuffer[tid].empty()) {
> DPRINTF(Drain, "%i: Skid buffer not empty.\n", tid);
> drained = false;
> }
> }
>
> return drained;
378c383
< DefaultIEW<Impl>::switchOut()
---
> DefaultIEW<Impl>::drainSanityCheck() const
380,383c385
< // Clear any state.
< switchedOut = true;
< assert(insts[0].empty());
< assert(skidBuffer[0].empty());
---
> assert(isDrained());
385,394c387,389
< instQueue.switchOut();
< ldstQueue.switchOut();
< fuPool->switchOut();
<
< for (ThreadID tid = 0; tid < numThreads; tid++) {
< while (!insts[tid].empty())
< insts[tid].pop();
< while (!skidBuffer[tid].empty())
< skidBuffer[tid].pop();
< }
---
> instQueue.drainSanityCheck();
> ldstQueue.drainSanityCheck();
> fuPool->drainSanityCheck();
405d399
< switchedOut = false;
409c403
< fuPool->takeOver();
---
> fuPool->takeOverFrom();