Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/12594 )
Change subject: systemc: Implement the nonstandard halt function.
......................................................................
systemc: Implement the nonstandard halt function.
Change-Id: Ie9bd9db92a63169980230bc9a15e153d5609dd0b
Reviewed-on: https://gem5-review.googlesource.com/c/12594
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/process.cc
M src/systemc/core/process.hh
M src/systemc/core/sc_module.cc
3 files changed, 7 insertions(+), 1 deletion(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 1fd16e0..b8eab3c 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -338,6 +338,8 @@
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 2ec75dc..d28d463 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 8418a31..2ba0fa2 100644
--- a/src/systemc/core/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -670,7 +670,8 @@
void
halt()
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ ::sc_core::wait();
+ throw ::sc_gem5::ScHalt();
}
void
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12594
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ie9bd9db92a63169980230bc9a15e153d5609dd0b
Gerrit-Change-Number: 12594
Gerrit-PatchSet: 7
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev