diff options
Diffstat (limited to 'src/systemc')
-rw-r--r-- | src/systemc/core/scheduler.cc | 10 | ||||
-rw-r--r-- | src/systemc/core/scheduler.hh | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index c84aa9a46..46053b40f 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -124,7 +124,7 @@ Scheduler::initPhase() eventsToSchedule.clear(); if (_started) { - if (starved() && !runToTime) + if (!runToTime && starved()) scheduleStarvationEvent(); kernel->status(::sc_core::SC_RUNNING); } @@ -244,14 +244,14 @@ Scheduler::runReady() // 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(); } @@ -303,7 +303,7 @@ Scheduler::start(Tick max_tick, bool run_to_time) maxTick = max_tick; if (initDone) { - if (starved() && !runToTime) + if (!runToTime && starved()) scheduleStarvationEvent(); kernel->status(::sc_core::SC_RUNNING); } diff --git a/src/systemc/core/scheduler.hh b/src/systemc/core/scheduler.hh index 3068a0aaa..ff8434bef 100644 --- a/src/systemc/core/scheduler.hh +++ b/src/systemc/core/scheduler.hh @@ -266,6 +266,8 @@ class Scheduler { assert(ts == timeSlots.begin()->second); timeSlots.erase(timeSlots.begin()); + if (!runToTime && starved()) + scheduleStarvationEvent(); } // Pending activity ignores gem5 activity, much like how a systemc |