Gabe Black has submitted this change and it was merged. (
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
Reviewed-on: https://gem5-review.googlesource.com/c/12811
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/sc_main.cc
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
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: 7
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