summaryrefslogtreecommitdiff
path: root/src/cpu/ozone
diff options
context:
space:
mode:
authorLena Olson <lena@cs.wisc,edu>2013-08-19 03:52:35 -0400
committerLena Olson <lena@cs.wisc,edu>2013-08-19 03:52:35 -0400
commit646c4a23ca44aab5468c896034288151c89be782 (patch)
treee63c57a515669a9c7c24b39b8cfcf39804d00276 /src/cpu/ozone
parentc26911013c799d63dfe854de8cce11137324cde2 (diff)
downloadgem5-646c4a23ca44aab5468c896034288151c89be782.tar.xz
cpu: Accurately count idle cycles for simple cpu
Added a couple missing updates to the notIdleFraction stat. Without these, it sometimes gives a (not) idle fraction that is greater than 1 or less than 0.
Diffstat (limited to 'src/cpu/ozone')
-rw-r--r--src/cpu/ozone/cpu_impl.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/ozone/cpu_impl.hh b/src/cpu/ozone/cpu_impl.hh
index fe8ae2551..f64f287ea 100644
--- a/src/cpu/ozone/cpu_impl.hh
+++ b/src/cpu/ozone/cpu_impl.hh
@@ -282,7 +282,7 @@ OzoneCPU<Impl>::activateContext(int thread_num, int delay)
assert(thread_num == 0);
assert(_status == Idle);
- notIdleFraction++;
+ notIdleFraction = 1;
scheduleTickEvent(delay);
_status = Running;
if (thread.quiesceEvent && thread.quiesceEvent->scheduled())
@@ -300,7 +300,7 @@ OzoneCPU<Impl>::suspendContext(int thread_num)
// @todo: Figure out how to initially set the status properly so
// this is running.
// assert(_status == Running);
- notIdleFraction--;
+ notIdleFraction = 0;
unscheduleTickEvent();
_status = Idle;
}