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 <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19468 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -1022,7 +1022,7 @@ FullO3CPU<Impl>::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<Impl>::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 <class Impl>
|
||||
bool
|
||||
FullO3CPU<Impl>::tryDrain()
|
||||
{
|
||||
if (drainState() != DrainState::Draining || !isDrained())
|
||||
if (drainState() != DrainState::Draining || !isCpuDrained())
|
||||
return false;
|
||||
|
||||
if (tickEvent.scheduled())
|
||||
@@ -1082,7 +1082,7 @@ template <class Impl>
|
||||
void
|
||||
FullO3CPU<Impl>::drainSanityCheck() const
|
||||
{
|
||||
assert(isDrained());
|
||||
assert(isCpuDrained());
|
||||
fetch.drainSanityCheck();
|
||||
decode.drainSanityCheck();
|
||||
rename.drainSanityCheck();
|
||||
@@ -1092,7 +1092,7 @@ FullO3CPU<Impl>::drainSanityCheck() const
|
||||
|
||||
template <class Impl>
|
||||
bool
|
||||
FullO3CPU<Impl>::isDrained() const
|
||||
FullO3CPU<Impl>::isCpuDrained() const
|
||||
{
|
||||
bool drained(true);
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU
|
||||
* <li>Stay at PC is true.
|
||||
* </ul>
|
||||
*/
|
||||
bool isDrained() {
|
||||
bool isCpuDrained() const {
|
||||
SimpleExecContext &t_info = *threadInfo[curThread];
|
||||
|
||||
return t_info.thread->microPC() == 0 &&
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -350,7 +350,7 @@ class TimingSimpleCPU : public BaseSimpleCPU
|
||||
* activated it can happen.
|
||||
* </ul>
|
||||
*/
|
||||
bool isDrained() {
|
||||
bool isCpuDrained() const {
|
||||
SimpleExecContext& t_info = *threadInfo[curThread];
|
||||
SimpleThread* thread = t_info.thread;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user