Gabe Black has submitted this change and it was merged. ( 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
Reviewed-on: https://gem5-review.googlesource.com/12266
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/kernel.cc
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved



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: 9
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to