Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/12811

Change subject: systemc: Warn if sc_stop is called more than once.
......................................................................

systemc: Warn if sc_stop is called more than once.

Change-Id: Ief88b9af0119ba4b007f79905db2522b5f95b820
---
M src/systemc/core/sc_main.cc
1 file changed, 10 insertions(+), 0 deletions(-)



diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc
index 5e1cd4f..735fb0c 100644
--- a/src/systemc/core/sc_main.cc
+++ b/src/systemc/core/sc_main.cc
@@ -226,6 +226,16 @@
 void
 sc_stop()
 {
+    static bool stop_called = false;
+    if (stop_called) {
+        static bool stop_warned = false;
+        if (!stop_warned)
+ SC_REPORT_WARNING("(W545) sc_stop has already been called", "");
+        stop_warned = true;
+        return;
+    }
+    stop_called = true;
+
     if (::sc_gem5::Kernel::status() == SC_STOPPED)
         return;


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12811
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: Ief88b9af0119ba4b007f79905db2522b5f95b820
Gerrit-Change-Number: 12811
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

Reply via email to