Skip to content

Commit d68acaa

Browse files
committed
fixes stop condition in report.cpp
If SCCERR is called during start of simulation, no sc_stop has been called
1 parent ad44f61 commit d68acaa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sysc/scc/report.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <spdlog/sinks/basic_file_sink.h>
2525
#include <spdlog/sinks/stdout_color_sinks.h>
2626
#include <spdlog/spdlog.h>
27+
#include <sysc/kernel/sc_status.h>
2728
#include <tuple>
2829
#include <unordered_map>
2930
#include <util/logging.h>
@@ -294,7 +295,7 @@ void report_handler(const sc_report& rep, const sc_actions& actions) {
294295
flush_loggers();
295296
} catch(spdlog::spdlog_ex e) {
296297
}
297-
if(sc_is_running() && !sc_stop_called) {
298+
if((sc_get_status() & (sc_core::SC_START_OF_SIMULATION | SC_RUNNING | SC_PAUSED | SC_SUSPENDED)) && !sc_stop_called) {
298299
sc_stop();
299300
sc_stop_called = true;
300301
}

0 commit comments

Comments
 (0)