From: Gabe Black Date: Wed, 5 Sep 2018 23:08:24 +0000 (-0700) Subject: systemc: Implement the nonstandard halt function. X-Git-Tag: v19.0.0.0~1644 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=930386c114eda9e0f57d407d2ef61740fd75fc88;p=gem5.git systemc: Implement the nonstandard halt function. Change-Id: Ie9bd9db92a63169980230bc9a15e153d5609dd0b Reviewed-on: https://gem5-review.googlesource.com/c/12594 Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc index 1fd16e0d9..b8eab3cde 100644 --- a/src/systemc/core/process.cc +++ b/src/systemc/core/process.cc @@ -338,6 +338,8 @@ Process::run() reset = false; try { func->call(); + } catch(ScHalt) { + std::cout << "Terminating process " << name() << std::endl; } catch(const ::sc_core::sc_unwind_exception &exc) { reset = exc.is_reset(); _isUnwinding = false; diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh index 2ec75dc06..d28d46396 100644 --- a/src/systemc/core/process.hh +++ b/src/systemc/core/process.hh @@ -52,6 +52,9 @@ namespace sc_gem5 { +class ScHalt +{}; + class Sensitivity { protected: diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc index 8418a3136..2ba0fa221 100644 --- a/src/systemc/core/sc_module.cc +++ b/src/systemc/core/sc_module.cc @@ -670,7 +670,8 @@ wait(double d, sc_time_unit u, const sc_event_and_list &eal) void halt() { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); + ::sc_core::wait(); + throw ::sc_gem5::ScHalt(); } void