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(-)
This commit is contained in:
Ilias Vougioukas 2016-05-27 16:55:01 +01:00
parent 07452aebf5
commit 7c8d6e3660

View file

@ -227,6 +227,11 @@ MinorCPU::signalDrainDone()
void void
MinorCPU::drainResume() 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()) { if (switchedOut()) {
DPRINTF(Drain, "drainResume while switched out. Ignoring\n"); DPRINTF(Drain, "drainResume while switched out. Ignoring\n");
return; return;
@ -268,8 +273,6 @@ MinorCPU::takeOverFrom(BaseCPU *old_cpu)
DPRINTF(MinorCPU, "MinorCPU takeOverFrom\n"); DPRINTF(MinorCPU, "MinorCPU takeOverFrom\n");
BaseCPU::takeOverFrom(old_cpu); BaseCPU::takeOverFrom(old_cpu);
/* Don't think I need to do anything here */
} }
void void