diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-14 21:56:14 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-09 21:51:58 +0000 |
commit | cb85067eee3fd7184b692f71af1016e52d44bb67 (patch) | |
tree | 8b46df126ecbf57e27fcfe356364454f449f9f1a /src | |
parent | daecb2b529e81c54fe4804ea35e74f4840b93511 (diff) | |
download | gem5-cb85067eee3fd7184b692f71af1016e52d44bb67.tar.xz |
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 <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/systemc/core/sc_main.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc index 5e1cd4fe6..735fb0c1b 100644 --- a/src/systemc/core/sc_main.cc +++ b/src/systemc/core/sc_main.cc @@ -226,6 +226,16 @@ sc_get_stop_mode() 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; |