diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-07-07 09:51:04 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-07-07 09:51:04 +0100 |
commit | e9c3d59aae58f8fcf77ce5cf4b985dc9e2a90de2 (patch) | |
tree | 799c50d9a0b99f1623a16d9c1d49f4cb0d1fcbaf /src/dev/copy_engine.cc | |
parent | 1dc5e63b889647a153f01351f560a3beaa41f293 (diff) | |
download | gem5-e9c3d59aae58f8fcf77ce5cf4b985dc9e2a90de2.tar.xz |
sim: Make the drain state a global typed enum
The drain state enum is currently a part of the Drainable
interface. The same state machine will be used by the DrainManager to
identify the global state of the simulator. Make the drain state a
global typed enum to better cater for this usage scenario.
Diffstat (limited to 'src/dev/copy_engine.cc')
-rw-r--r-- | src/dev/copy_engine.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dev/copy_engine.cc b/src/dev/copy_engine.cc index 5506103b1..035f824fa 100644 --- a/src/dev/copy_engine.cc +++ b/src/dev/copy_engine.cc @@ -140,12 +140,12 @@ CopyEngine::CopyEngineChannel::recvCommand() cr.status.dma_transfer_status(0); nextState = DescriptorFetch; fetchAddress = cr.descChainAddr; - if (ce->getDrainState() == Drainable::Running) + if (ce->getDrainState() == DrainState::Running) fetchDescriptor(cr.descChainAddr); } else if (cr.command.append_dma()) { if (!busy) { nextState = AddressFetch; - if (ce->getDrainState() == Drainable::Running) + if (ce->getDrainState() == DrainState::Running) fetchNextAddr(lastDescriptorAddr); } else refreshNext = true; @@ -635,20 +635,20 @@ CopyEngine::CopyEngineChannel::fetchAddrComplete() bool CopyEngine::CopyEngineChannel::inDrain() { - if (ce->getDrainState() == Drainable::Draining) { + if (ce->getDrainState() == DrainState::Draining) { DPRINTF(Drain, "CopyEngine done draining, processing drain event\n"); assert(drainManager); drainManager->signalDrainDone(); drainManager = NULL; } - return ce->getDrainState() != Drainable::Running; + return ce->getDrainState() != DrainState::Running; } unsigned int CopyEngine::CopyEngineChannel::drain(DrainManager *dm) { - if (nextState == Idle || ce->getDrainState() != Drainable::Running) + if (nextState == Idle || ce->getDrainState() != DrainState::Running) return 0; unsigned int count = 1; count += cePort.drain(dm); @@ -667,9 +667,9 @@ CopyEngine::drain(DrainManager *dm) count += chan[x]->drain(dm); if (count) - setDrainState(Draining); + setDrainState(DrainState::Draining); else - setDrainState(Drained); + setDrainState(DrainState::Drained); DPRINTF(Drain, "CopyEngine not drained\n"); return count; |