inline Tick frequency() const { return Clock::Frequency / clock; }
inline Tick cycles(int numCycles) const { return clock * numCycles; }
inline Tick curCycle() const { return curTick / clock; }
+ inline Tick tickToCycles(Tick val) const { return val / clock; }
// @todo remove me after debugging with legion done
Tick instCount() { return instCnt; }
DPRINTF(Activity, "Waking up CPU\n");
- idleCycles += (curTick - 1) - lastRunningCycle;
+ idleCycles += tickToCycles((curTick - 1) - lastRunningCycle);
+ numCycles += tickToCycles((curTick - 1) - lastRunningCycle);
tickEvent.schedule(nextCycle());
}
{
assert(status() == Running || status() == Idle);
_status = SwitchedOut;
- numCycles += curTick - previousTick;
+ numCycles += tickToCycles(curTick - previousTick);
// If we've been scheduled to resume but are then told to switch out,
// we'll need to cancel it.
advanceInst(fault);
}
- numCycles += curTick - previousTick;
+ numCycles += tickToCycles(curTick - previousTick);
previousTick = curTick;
}
_status = Running;
- numCycles += curTick - previousTick;
+ numCycles += tickToCycles(curTick - previousTick);
previousTick = curTick;
if (getState() == SimObject::Draining) {
assert(_status == DcacheWaitResponse);
_status = Running;
- numCycles += curTick - previousTick;
+ numCycles += tickToCycles(curTick - previousTick);
previousTick = curTick;
Fault fault = curStaticInst->completeAcc(pkt, this, traceData);