Skip to content

Commit 4db09b1

Browse files
committed
fixes stop condition in report handler to be SC 2.4 compliant
1 parent d68acaa commit 4db09b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sysc/scc/report.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,12 @@ void report_handler(const sc_report& rep, const sc_actions& actions) {
295295
flush_loggers();
296296
} catch(spdlog::spdlog_ex e) {
297297
}
298-
if((sc_get_status() & (sc_core::SC_START_OF_SIMULATION | SC_RUNNING | SC_PAUSED | SC_SUSPENDED)) && !sc_stop_called) {
298+
#if SYSTEMC_VERSION < 20241015
299+
static const int stop_expr = sc_core::SC_START_OF_SIMULATION | SC_RUNNING | SC_PAUSED;
300+
#else
301+
static constexpr int stop_expr = sc_core::SC_START_OF_SIMULATION | SC_RUNNING | SC_PAUSED | SC_SUSPENDED;
302+
#endif
303+
if((sc_get_status() & stop_expr) && !sc_stop_called) {
299304
sc_stop();
300305
sc_stop_called = true;
301306
}

0 commit comments

Comments
 (0)