cpu: fix lastStopped unserialisation
authorIlias Vougioukas <Ilias.Vougioukas@ARM.com>
Fri, 27 May 2016 15:55:01 +0000 (16:55 +0100)
committerIlias Vougioukas <Ilias.Vougioukas@ARM.com>
Fri, 27 May 2016 15:55:01 +0000 (16:55 +0100)
MinorCPU fix for corrupt numCycles when resuming from a previous simulation.
---
 src/cpu/minor/cpu.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

src/cpu/minor/cpu.cc

index cd39a8b93e305ce2c9740923ce1eed3dfc8a3495..7e53a87f67d82e2d349ac83e62bcc9e70877b31d 100644 (file)
@@ -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