systemc: When sc_start-ing with zero time, ensure the ready event runs.
authorGabe Black <gabeblack@google.com>
Sun, 26 Aug 2018 21:56:30 +0000 (14:56 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 26 Sep 2018 00:02:35 +0000 (00:02 +0000)
The ready event is what notices that we only wanted to run one delta
cycle, or no delta cycle if there was nothing to do, and return to
sc_main. If the ready event wasn't scheduled, we would advance time
before the ready event ran and returned to sc_main which is incorrect.

Change-Id: Ic3c10a2f1405f744e8c2bd37aa45846ee6e98e12
Reviewed-on: https://gem5-review.googlesource.com/12267
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/scheduler.cc

index 7851bac67e8f0d5963b35b028ce1e71759a5318a..c84aa9a462214fab020c372e29d0cbb11f89b46c 100644 (file)
@@ -327,6 +327,7 @@ void
 Scheduler::oneCycle()
 {
     runOnce = true;
+    scheduleReadyEvent();
     start(::MaxTick, false);
 }