diff options
author | Gabe Black <gabeblack@google.com> | 2018-08-21 19:10:47 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-25 23:54:38 +0000 |
commit | c42dfdeda8ca198bf076817431f41d24463e1cda (patch) | |
tree | 60f0825160e2f310020c457e56d03ec360ba61c8 /src/systemc | |
parent | 9f177a190b5114554d0138c82b08c83f3063d91e (diff) | |
download | gem5-c42dfdeda8ca198bf076817431f41d24463e1cda.tar.xz |
systemc: Make sure no delta cycles are scheduled when stopping.
If the readyEvent is still scheduled when sc_main completes, gem5 will
return to it's main fiber and keep executing events, including that
one. That means a delta cycle will run even after sc_main is complete.
This change ensures that the readyEvent has been descheduled as part
of stopping.
Change-Id: I9479ac4ebff3335477b371b02efa6d44c70cbc8e
Reviewed-on: https://gem5-review.googlesource.com/12224
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r-- | src/systemc/core/scheduler.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index 6762086a0..f930bb515 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -272,6 +272,10 @@ Scheduler::stop() { _stopped = true; kernel->stop(); + + if (readyEvent.scheduled()) + eq->deschedule(&readyEvent); + runOnce = false; scMain->run(); } |