diff options
author | Gabe Black <gabeblack@google.com> | 2018-08-16 19:01:28 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-25 23:50:05 +0000 |
commit | 440b143742ece282c2b0497c70818a5796f66f1a (patch) | |
tree | a42c7419a84fb78ae15c6958998c5fd752da99f2 /src/systemc/core | |
parent | 54f3a76afe055fa62a818b8355dd8c6f8bd39856 (diff) | |
download | gem5-440b143742ece282c2b0497c70818a5796f66f1a.tar.xz |
systemc: Don't run the ready event inline when unpausing.
Now that delta events are handled explicitly by the scheduler, there's
no reason to run the readyEvent inline when returning from a pause. The
delta events will necessarily be run after the evaluate and update
phases.
Change-Id: Iad6d431a87742354e3a46a0fb44c309aa785ea60
Reviewed-on: https://gem5-review.googlesource.com/12214
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core')
-rw-r--r-- | src/systemc/core/scheduler.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index bc08d5556..ceaa5f474 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -196,10 +196,8 @@ Scheduler::runReady() e->run(); deltas.clear(); - if (runOnce) { - eq->reschedule(&maxTickEvent, eq->getCurTick()); - runOnce = false; - } + if (runOnce) + schedulePause(); } void @@ -220,14 +218,6 @@ Scheduler::pause() kernel->status(::sc_core::SC_PAUSED); runOnce = false; scMain->run(); - - // If the ready event is supposed to run now, run it inline so that it - // preempts any delta notifications which were scheduled while we were - // paused. - if (readyEvent.scheduled()) { - eq->deschedule(&readyEvent); - runReady(); - } } void @@ -298,13 +288,16 @@ Scheduler::scheduleStop(bool finish_delta) if (!finish_delta) { // If we're not supposed to finish the delta cycle, flush the list - // of ready processes and scheduled updates. + // of ready processes, scheduled updates, and delta notifications. Process *p; while ((p = readyList.getNext())) p->popListNode(); Channel *c; while ((c = updateList.getNext())) c->popListNode(); + for (auto &e: deltas) + e->deschedule(); + deltas.clear(); } eq->schedule(&stopEvent, eq->getCurTick()); } |