cpu: Idle CPU status logic revised
authorAlexandru Dutu <alexandru.dutu@amd.com>
Sat, 7 Feb 2015 02:01:22 +0000 (18:01 -0800)
committerAlexandru Dutu <alexandru.dutu@amd.com>
Sat, 7 Feb 2015 02:01:22 +0000 (18:01 -0800)
This patch sets the CPU status to idle when the last active thread gets
suspended.

src/cpu/o3/cpu.cc

index 55ef04ffc215975cdab9e32585812ab5cb277e78..b48c66c371b7e962128157f8e88be0708220c63b 100644 (file)
@@ -746,12 +746,13 @@ FullO3CPU<Impl>::suspendContext(ThreadID tid)
     deactivateThread(tid);
 
     // If this was the last thread then unschedule the tick event.
-    if (activeThreads.size() == 0)
+    if (activeThreads.size() == 0) {
         unscheduleTickEvent();
+        lastRunningCycle = curCycle();
+        _status = Idle;
+    }
 
     DPRINTF(Quiesce, "Suspending Context\n");
-    lastRunningCycle = curCycle();
-    _status = Idle;
 }
 
 template <class Impl>