Make sure we check for starvation after timed notifications and at the
very end of delta cycles (after delta notifications, not before). Also
reverse the order of starvation checks (whether they apply at all, then
if they're satisfied) to make those checks faster. Checking a bool
is a lot easier than checking if a bunch of other structures are
empty.
Change-Id: I514ff219909823f1f424fde69856d6b510655188
Reviewed-on: https://gem5-review.googlesource.com/12268
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
eventsToSchedule.clear();
if (_started) {
- if (starved() && !runToTime)
+ if (!runToTime && starved())
scheduleStarvationEvent();
kernel->status(::sc_core::SC_RUNNING);
}
// The update phase.
update();
- if (starved() && !runToTime)
- scheduleStarvationEvent();
-
// The delta phase.
for (auto &e: deltas)
e->run();
deltas.clear();
+ if (!runToTime && starved())
+ scheduleStarvationEvent();
+
if (runOnce)
schedulePause();
}
maxTick = max_tick;
if (initDone) {
- if (starved() && !runToTime)
+ if (!runToTime && starved())
scheduleStarvationEvent();
kernel->status(::sc_core::SC_RUNNING);
}
{
assert(ts == timeSlots.begin()->second);
timeSlots.erase(timeSlots.begin());
+ if (!runToTime && starved())
+ scheduleStarvationEvent();
}
// Pending activity ignores gem5 activity, much like how a systemc