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/cpu/o3 | |
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/cpu/o3')
-rw-r--r-- | src/cpu/o3/cpu.cc | 12 | ||||
-rw-r--r-- | src/cpu/o3/cpu.hh | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 18e958278..89256a7f0 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -539,7 +539,7 @@ FullO3CPU<Impl>::tick() { DPRINTF(O3CPU, "\n\nFullO3CPU: Ticking main, FullO3CPU.\n"); assert(!switchedOut()); - assert(getDrainState() != Drainable::Drained); + assert(getDrainState() != DrainState::Drained); ++numCycles; ppCycles->notify(1); @@ -712,7 +712,7 @@ FullO3CPU<Impl>::activateContext(ThreadID tid) // We don't want to wake the CPU if it is drained. In that case, // we just want to flag the thread as active and schedule the tick // event from drainResume() instead. - if (getDrainState() == Drainable::Drained) + if (getDrainState() == DrainState::Drained) return; // If we are time 0 or if the last activation time is in the past, @@ -1004,12 +1004,12 @@ FullO3CPU<Impl>::drain(DrainManager *drain_manager) { // If the CPU isn't doing anything, then return immediately. if (switchedOut()) { - setDrainState(Drainable::Drained); + setDrainState(DrainState::Drained); return 0; } DPRINTF(Drain, "Draining...\n"); - setDrainState(Drainable::Draining); + setDrainState(DrainState::Draining); // We only need to signal a drain to the commit stage as this // initiates squashing controls the draining. Once the commit @@ -1031,7 +1031,7 @@ FullO3CPU<Impl>::drain(DrainManager *drain_manager) return 1; } else { - setDrainState(Drainable::Drained); + setDrainState(DrainState::Drained); DPRINTF(Drain, "CPU is already drained\n"); if (tickEvent.scheduled()) deschedule(tickEvent); @@ -1132,7 +1132,7 @@ template <class Impl> void FullO3CPU<Impl>::drainResume() { - setDrainState(Drainable::Running); + setDrainState(DrainState::Running); if (switchedOut()) return; diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index bbc9fde8e..44400542a 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -336,7 +336,7 @@ class FullO3CPU : public BaseO3CPU void updateThreadPriority(); /** Is the CPU draining? */ - bool isDraining() const { return getDrainState() == Drainable::Draining; } + bool isDraining() const { return getDrainState() == DrainState::Draining; } void serializeThread(CheckpointOut &cp, ThreadID tid) const M5_ATTR_OVERRIDE; |