O3CPU: O3's tick event gets squashed when it is switched out. When repeatedly
authorTimothy M. Jones <tjones1@inf.ed.ac.uk>
Thu, 22 Jul 2010 17:47:43 +0000 (18:47 +0100)
committerTimothy M. Jones <tjones1@inf.ed.ac.uk>
Thu, 22 Jul 2010 17:47:43 +0000 (18:47 +0100)
switching between O3 and another CPU, O3's tick event might still be scheduled
in the event queue (as squashed).  Therefore, check for a squashed tick event
as well as a non-scheduled event when taking over from another CPU and deal
with it accordingly.

src/cpu/o3/cpu.cc

index 2a4e0176a62c58614e8115c5af02fcf55453eae9..49bfe88e343beda774eac83d56bc217b94437602 100644 (file)
@@ -1143,7 +1143,7 @@ FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
     iew.takeOverFrom();
     commit.takeOverFrom();
 
-    assert(!tickEvent.scheduled());
+    assert(!tickEvent.scheduled() || tickEvent.squashed());
 
     // @todo: Figure out how to properly select the tid to put onto
     // the active threads list.
@@ -1168,7 +1168,7 @@ FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
         ThreadContext *tc = threadContexts[i];
         if (tc->status() == ThreadContext::Active && _status != Running) {
             _status = Running;
-            schedule(tickEvent, nextCycle());
+            reschedule(tickEvent, nextCycle(), true);
         }
     }
     if (!tickEvent.scheduled())