Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12265 )

Change subject: systemc: Make sure methods aren't restarted by yield.
......................................................................

systemc: Make sure methods aren't restarted by yield.

Methods may need to yield control to other Processes when throwing
them exceptions. In that case, we need to keep track of the fact that
the method doesn't need to be restarted when it resumes within yield.

Change-Id: I829c387d6ddb563b2957db47e55adadbbe6bc51a
Reviewed-on: https://gem5-review.googlesource.com/12265
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/scheduler.cc
3 files changed, 5 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 1a101f7..94e49a8 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -320,6 +320,7 @@
             _isUnwinding = false;
         }
     } while (reset);
+    needsStart(true);
 }

 void
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh
index 17f417b..0cb3e3c 100644
--- a/src/systemc/core/process.hh
+++ b/src/systemc/core/process.hh
@@ -271,6 +271,7 @@
   public:
     virtual ::sc_core::sc_curr_proc_kind procKind() const = 0;
     bool needsStart() const { return _needsStart; }
+    void needsStart(bool ns) { _needsStart = ns; }
     bool dynamic() const { return _dynamic; }
     bool isUnwinding() const { return _isUnwinding; }
     void isUnwinding(bool v) { _isUnwinding = v; }
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc
index 2dc3aa7..7851bac 100644
--- a/src/systemc/core/scheduler.cc
+++ b/src/systemc/core/scheduler.cc
@@ -174,8 +174,10 @@
         // Fibers which aren't running should be parked at this line.
         _current->fiber()->run();
         // If the current process needs to be manually started, start it.
-        if (_current && _current->needsStart())
+        if (_current && _current->needsStart()) {
+            _current->needsStart(false);
             _current->run();
+        }
     }
     if (_current && _current->excWrapper) {
         // Make sure this isn't a method process.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12265
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: I829c387d6ddb563b2957db47e55adadbbe6bc51a
Gerrit-Change-Number: 12265
Gerrit-PatchSet: 9
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

Reply via email to