changeset 7fc527ab626a in /z/repo/gem5 details: http://repo.gem5.org/gem5?cmd=changeset;node=7fc527ab626a description: cpu: Fix Minor drain issues when switched out
The Minor CPU currently doesn't drain properly when it is switched out. This happens because Fetch 1 expects to be in the FetchHalted state when it is drained. However, because the CPU is switched out, it is stuck in the FetchWaitingForPC state. Fix this by ignoring drain requests and returning DrainState::Drained from MinorCPU::drain() if the CPU is switched out. This is always safe since a switched out CPU, by definition, doesn't have any instructions in flight. diffstat: src/cpu/minor/cpu.cc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diffs (15 lines): diff -r 40526b73c7db -r 7fc527ab626a src/cpu/minor/cpu.cc --- a/src/cpu/minor/cpu.cc Thu Jul 30 10:16:36 2015 +0100 +++ b/src/cpu/minor/cpu.cc Fri Jul 31 17:04:59 2015 +0100 @@ -201,6 +201,11 @@ DrainState MinorCPU::drain() { + if (switchedOut()) { + DPRINTF(Drain, "Minor CPU switched out, draining not needed.\n"); + return DrainState::Drained; + } + DPRINTF(Drain, "MinorCPU drain\n"); /* Need to suspend all threads and wait for Execute to idle. _______________________________________________ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev