summaryrefslogtreecommitdiff
path: root/src/cpu/minor
diff options
context:
space:
mode:
authorIlias Vougioukas <Ilias.Vougioukas@ARM.com>2016-05-27 16:55:01 +0100
committerIlias Vougioukas <Ilias.Vougioukas@ARM.com>2016-05-27 16:55:01 +0100
commit7c8d6e3660ffd497b565836d2605d7b5281f0a78 (patch)
tree0dd06bd94ab81d5d5b3220302e048f2871a00a53 /src/cpu/minor
parent07452aebf53cce698202b99075c1f895e580ba72 (diff)
downloadgem5-7c8d6e3660ffd497b565836d2605d7b5281f0a78.tar.xz
cpu: fix lastStopped unserialisation
MinorCPU fix for corrupt numCycles when resuming from a previous simulation. --- src/cpu/minor/cpu.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Diffstat (limited to 'src/cpu/minor')
-rw-r--r--src/cpu/minor/cpu.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpu/minor/cpu.cc b/src/cpu/minor/cpu.cc
index cd39a8b93..7e53a87f6 100644
--- a/src/cpu/minor/cpu.cc
+++ b/src/cpu/minor/cpu.cc
@@ -227,6 +227,11 @@ MinorCPU::signalDrainDone()
void
MinorCPU::drainResume()
{
+ /* When taking over from another cpu make sure lastStopped
+ * is reset since it might have not been defined previously
+ * and might lead to a stats corruption */
+ pipeline->resetLastStopped();
+
if (switchedOut()) {
DPRINTF(Drain, "drainResume while switched out. Ignoring\n");
return;
@@ -268,8 +273,6 @@ MinorCPU::takeOverFrom(BaseCPU *old_cpu)
DPRINTF(MinorCPU, "MinorCPU takeOverFrom\n");
BaseCPU::takeOverFrom(old_cpu);
-
- /* Don't think I need to do anything here */
}
void