From: Giacomo Travaglini Date: Fri, 28 Jun 2019 09:04:43 +0000 (+0100) Subject: cpu: isDrained renamed to isCpuDrained X-Git-Tag: v19.0.0.0~734 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34e77161fb42847797338ffe95674f248798ab43;p=gem5.git cpu: isDrained renamed to isCpuDrained cpu models inheriting from BaseCPU implement a draining checker called isDrained. This hides the base Drainable::isDrained method and might create confusion in the reader. This patch is renaming it to isCpuDrained in order to avoid any ambiguity Change-Id: Ie5221da6a4673432c2403996e42d451cae960bbf Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19468 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index f2e0f60b7..920bef02c 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -1022,7 +1022,7 @@ FullO3CPU::drain() // Wake the CPU and record activity so everything can drain out if // the CPU was not able to immediately drain. - if (!isDrained()) { + if (!isCpuDrained()) { // If a thread is suspended, wake it up so it can be drained for (auto t : threadContexts) { if (t->status() == ThreadContext::Suspended){ @@ -1048,7 +1048,7 @@ FullO3CPU::drain() // Flush out any old data from the time buffers. In // particular, there might be some data in flight from the // fetch stage that isn't visible in any of the CPU buffers we - // test in isDrained(). + // test in isCpuDrained(). for (int i = 0; i < timeBuffer.getSize(); ++i) { timeBuffer.advance(); fetchQueue.advance(); @@ -1066,7 +1066,7 @@ template bool FullO3CPU::tryDrain() { - if (drainState() != DrainState::Draining || !isDrained()) + if (drainState() != DrainState::Draining || !isCpuDrained()) return false; if (tickEvent.scheduled()) @@ -1082,7 +1082,7 @@ template void FullO3CPU::drainSanityCheck() const { - assert(isDrained()); + assert(isCpuDrained()); fetch.drainSanityCheck(); decode.drainSanityCheck(); rename.drainSanityCheck(); @@ -1092,7 +1092,7 @@ FullO3CPU::drainSanityCheck() const template bool -FullO3CPU::isDrained() const +FullO3CPU::isCpuDrained() const { bool drained(true); diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index db8fca20a..68ad95b18 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -248,7 +248,7 @@ class FullO3CPU : public BaseO3CPU void drainSanityCheck() const; /** Check if a system is in a drained state. */ - bool isDrained() const; + bool isCpuDrained() const; public: /** Constructs a CPU with the given parameters. */ diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 5fc1d69a9..aa2b64112 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -112,7 +112,7 @@ AtomicSimpleCPU::drain() if (switchedOut()) return DrainState::Drained; - if (!isDrained()) { + if (!isCpuDrained()) { DPRINTF(Drain, "Requesting drain.\n"); return DrainState::Draining; } else { @@ -183,7 +183,7 @@ AtomicSimpleCPU::tryCompleteDrain() return false; DPRINTF(Drain, "tryCompleteDrain.\n"); - if (!isDrained()) + if (!isCpuDrained()) return false; DPRINTF(Drain, "CPU done draining, processing drain event\n"); @@ -200,7 +200,7 @@ AtomicSimpleCPU::switchOut() assert(!tickEvent.scheduled()); assert(_status == BaseSimpleCPU::Running || _status == Idle); - assert(isDrained()); + assert(isCpuDrained()); } diff --git a/src/cpu/simple/atomic.hh b/src/cpu/simple/atomic.hh index 100306981..ba52bc933 100644 --- a/src/cpu/simple/atomic.hh +++ b/src/cpu/simple/atomic.hh @@ -88,7 +88,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU *
  • Stay at PC is true. * */ - bool isDrained() { + bool isCpuDrained() const { SimpleExecContext &t_info = *threadInfo[curThread]; return t_info.thread->microPC() == 0 && diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index 454259099..4aa008e33 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -100,7 +100,7 @@ TimingSimpleCPU::drain() return DrainState::Drained; if (_status == Idle || - (_status == BaseSimpleCPU::Running && isDrained())) { + (_status == BaseSimpleCPU::Running && isCpuDrained())) { DPRINTF(Drain, "No need to drain.\n"); activeThreads.clear(); return DrainState::Drained; @@ -161,7 +161,7 @@ TimingSimpleCPU::tryCompleteDrain() return false; DPRINTF(Drain, "tryCompleteDrain.\n"); - if (!isDrained()) + if (!isCpuDrained()) return false; DPRINTF(Drain, "CPU done draining, processing drain event\n"); diff --git a/src/cpu/simple/timing.hh b/src/cpu/simple/timing.hh index a49822fc1..e423ae8e2 100644 --- a/src/cpu/simple/timing.hh +++ b/src/cpu/simple/timing.hh @@ -350,7 +350,7 @@ class TimingSimpleCPU : public BaseSimpleCPU * activated it can happen. * */ - bool isDrained() { + bool isCpuDrained() const { SimpleExecContext& t_info = *threadInfo[curThread]; SimpleThread* thread = t_info.thread;