diff options
-rw-r--r-- | src/systemc/core/sc_process_handle.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/systemc/core/sc_process_handle.cc b/src/systemc/core/sc_process_handle.cc index c4014b747..e0f6a8186 100644 --- a/src/systemc/core/sc_process_handle.cc +++ b/src/systemc/core/sc_process_handle.cc @@ -30,6 +30,7 @@ #include "base/logging.hh" #include "systemc/core/process.hh" #include "systemc/core/scheduler.hh" +#include "systemc/ext/core/sc_main.hh" #include "systemc/ext/core/sc_process_handle.hh" namespace sc_core @@ -292,7 +293,10 @@ sc_process_handle::sync_reset_off( sc_process_handle sc_get_current_process_handle() { - return sc_process_handle(::sc_gem5::scheduler.current()); + if (sc_is_running()) + return sc_process_handle(::sc_gem5::scheduler.current()); + else + return sc_process_handle(::sc_gem5::Process::newest()); } bool |