Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/14917 )
Change subject: systemc: Ignore process control functions on terminated
processes.
......................................................................
systemc: Ignore process control functions on terminated processes.
These functions can descend to the children of a terminated process,
but should have no effect on that process itself.
Change-Id: I6e4bdec8c492dd03d05bc1397aa080e8a51397c1
Reviewed-on: https://gem5-review.googlesource.com/c/14917
Reviewed-by: Matthias Jung <jun...@eit.uni-kl.de>
Maintainer: Gabe Black <gabebl...@google.com>
---
M src/systemc/core/process.cc
1 file changed, 10 insertions(+), 8 deletions(-)
Approvals:
Matthias Jung: Looks good to me, approved
Gabe Black: Looks good to me, approved
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 193056f..aaa42e8 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -81,7 +81,7 @@
if (inc_kids)
forEachKid([](Process *p) { p->suspend(true); });
- if (!_suspended) {
+ if (!_suspended && !_terminated) {
_suspended = true;
_suspendedReady = scheduler.suspend(this);
@@ -102,7 +102,7 @@
if (inc_kids)
forEachKid([](Process *p) { p->resume(true); });
- if (_suspended) {
+ if (_suspended && !_terminated) {
_suspended = false;
if (_suspendedReady)
scheduler.resume(this);
@@ -124,7 +124,8 @@
message.c_str());
}
- _disabled = true;
+ if (!_terminated)
+ _disabled = true;
}
void
@@ -134,7 +135,8 @@
if (inc_kids)
forEachKid([](Process *p) { p->enable(true); });
- _disabled = false;
+ if (!_terminated)
+ _disabled = false;
}
void
@@ -149,8 +151,8 @@
if (inc_kids)
forEachKid([](Process *p) { p->kill(true); });
- // If we're in the middle of unwinding, ignore the kill request.
- if (_isUnwinding)
+ // If we're unwinding or terminated, ignore the kill request.
+ if (_isUnwinding || _terminated)
return;
// Update our state.
@@ -177,8 +179,8 @@
if (inc_kids)
forEachKid([](Process *p) { p->reset(true); });
- // If we're in the middle of unwinding, ignore the reset request.
- if (_isUnwinding)
+ // If we're already unwinding or terminated, ignore the reset request.
+ if (_isUnwinding || _terminated)
return;
// Clear suspended ready since we're about to run regardless.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14917
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: I6e4bdec8c492dd03d05bc1397aa080e8a51397c1
Gerrit-Change-Number: 14917
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Matthias Jung <jun...@eit.uni-kl.de>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev