Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/12266
Change subject: systemc: Fix where we checked if sc_stop was called durig
elaboration.
......................................................................
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
---
M src/systemc/core/kernel.cc
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc
index 545901a..24d9f22 100644
--- a/src/systemc/core/kernel.cc
+++ b/src/systemc/core/kernel.cc
@@ -71,6 +71,9 @@
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 @@
endComplete = true;
status(::sc_core::SC_STOPPED);
-
- if (stopAfterCallbacks)
- fatal("Simulation called sc_stop during elaboration.\n");
}
void
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12266
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I6876305450e52a407acffb9a2f45ee2ae24a9adf
Gerrit-Change-Number: 12266
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev