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.
assert(thread_num == 0);
assert(_status == Idle);
- notIdleFraction++;
+ notIdleFraction = 1;
scheduleTickEvent(delay);
_status = Running;
if (thread.quiesceEvent && thread.quiesceEvent->scheduled())
// @todo: Figure out how to initially set the status properly so
// this is running.
// assert(_status == Running);
- notIdleFraction--;
+ notIdleFraction = 0;
unscheduleTickEvent();
_status = Idle;
}
if (thread->status() == ThreadContext::Active) {
schedule(tickEvent, nextCycle());
_status = BaseSimpleCPU::Running;
+ notIdleFraction = 1;
} else {
_status = BaseSimpleCPU::Idle;
+ notIdleFraction = 0;
}
system->totalNumInsts = 0;
assert(_status == Idle);
assert(!tickEvent.scheduled());
- notIdleFraction++;
+ notIdleFraction = 1;
numCycles += ticksToCycles(thread->lastActivate - thread->lastSuspend);
//Make sure ticks are still on multiples of cycles
if (tickEvent.scheduled())
deschedule(tickEvent);
- notIdleFraction--;
+ notIdleFraction = 0;
_status = Idle;
}
if (thread->status() == ThreadContext::Active) {
schedule(fetchEvent, nextCycle());
_status = BaseSimpleCPU::Running;
+ notIdleFraction = 1;
} else {
_status = BaseSimpleCPU::Idle;
+ notIdleFraction = 0;
}
}
assert(_status == Idle);
- notIdleFraction++;
+ notIdleFraction = 1;
_status = BaseSimpleCPU::Running;
// kick things off by initiating the fetch of the next instruction
// just change status to Idle... if status != Running,
// completeInst() will not initiate fetch of next instruction.
- notIdleFraction--;
+ notIdleFraction = 0;
_status = Idle;
}