Update stats for quiesced cycles
authorAli Saidi <saidi@eecs.umich.edu>
Fri, 28 Sep 2007 17:22:14 +0000 (13:22 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Fri, 28 Sep 2007 17:22:14 +0000 (13:22 -0400)
--HG--
extra : convert_revision : 703ba58f156c9f2677b020f05d36bc1e3ae0b9e5

src/cpu/simple/atomic.cc
src/cpu/simple/timing.cc

index 9187fa7c7916a624b6dc9dfeb0c4bb7706700131..525bcbd227cdc97fff6884a29d30e270f2a0cc8b 100644 (file)
@@ -252,6 +252,7 @@ AtomicSimpleCPU::activateContext(int thread_num, int delay)
     assert(!tickEvent.scheduled());
 
     notIdleFraction++;
+    numCycles += tickToCycles(thread->lastActivate - thread->lastSuspend);
 
     //Make sure ticks are still on multiples of cycles
     tickEvent.schedule(nextCycle(curTick + ticks(delay)));
index 2b5577e04e8cc0dd0b57f3020b93d5b71c85763b..b70fc2a414ebb6a1ba1e791e5a1cd1598c261846 100644 (file)
@@ -172,7 +172,6 @@ TimingSimpleCPU::resume()
     }
 
     changeState(SimObject::Running);
-    previousTick = curTick;
 }
 
 void
@@ -207,6 +206,7 @@ TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
     if (_status != Running) {
         _status = Idle;
     }
+    previousTick = curTick;
 }