diff options
author | Gabe Black <gabeblack@google.com> | 2018-08-26 14:54:20 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-26 00:02:16 +0000 |
commit | 060303d7771015e18e69271574558d2303edf6e1 (patch) | |
tree | 26839789156876092e2c009205327bc2514e27d5 /src/systemc/core/kernel.cc | |
parent | 28b09df79bdd6c232be2b386119569291f92311c (diff) | |
download | gem5-060303d7771015e18e69271574558d2303edf6e1.tar.xz |
systemc: Fix where we checked if sc_stop was called durig elaboration.
If sc_stop is called during one of the various callbacks, that has
defined behavior and will cause the simulation to stop after the
current batch of callbacks. We were checking whether sc_stop had been
called during one of those batches and killing the system, erroneously
assuming that meant it had called during elaboration.
This change moves the check to before the callbacks which actually
does mean that sc_stop was called during elaboration.
Change-Id: I6876305450e52a407acffb9a2f45ee2ae24a9adf
Reviewed-on: https://gem5-review.googlesource.com/12266
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/kernel.cc')
-rw-r--r-- | src/systemc/core/kernel.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc index 545901a84..24d9f22b2 100644 --- a/src/systemc/core/kernel.cc +++ b/src/systemc/core/kernel.cc @@ -71,6 +71,9 @@ Kernel::init() if (scMainDone) return; + if (stopAfterCallbacks) + fatal("Simulation called sc_stop during elaboration.\n"); + status(::sc_core::SC_BEFORE_END_OF_ELABORATION); for (auto m: sc_gem5::allModules) { callbackModule(m); @@ -168,9 +171,6 @@ Kernel::stopWork() endComplete = true; status(::sc_core::SC_STOPPED); - - if (stopAfterCallbacks) - fatal("Simulation called sc_stop during elaboration.\n"); } void |