systemc: Implement the nonstandard halt function.

Change-Id: Ie9bd9db92a63169980230bc9a15e153d5609dd0b
Reviewed-on: https://gem5-review.googlesource.com/c/12594
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2018-09-05 16:08:24 -07:00
parent 38086692c4
commit 930386c114
3 changed files with 7 additions and 1 deletions

View File

@@ -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;

View File

@@ -52,6 +52,9 @@
namespace sc_gem5
{
class ScHalt
{};
class Sensitivity
{
protected:

View File

@@ -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