systemc: Implement the synchronous reset state.
authorGabe Black <gabeblack@google.com>
Wed, 26 Sep 2018 07:24:01 +0000 (00:24 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 00:35:11 +0000 (00:35 +0000)
Change-Id: Ie0c29bb6cf918aea1c0bc719b9d37628b5b19339
Reviewed-on: https://gem5-review.googlesource.com/c/13185
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/process.hh
src/systemc/core/scheduler.cc

index 4266c2d7d57483cfe8c63662f89cf70195fa5dc6..9e85fc7cc3e6f77ec57962b8746b806f70128898 100644 (file)
@@ -119,6 +119,7 @@ class Process : public ::sc_core::sc_process_b, public ListNode
     bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
     bool internal() { return _internal; }
     bool timedOut() { return _timedOut; }
+    bool syncReset() { return _syncReset; }
 
     bool dontInitialize() { return _dontInitialize; }
     void dontInitialize(bool di) { _dontInitialize = di; }
index d79abb2514db52609d661fadbe97a65d11f3a9f6..6d571f60b765db6db0b22d6ecafdb1ce839bded1 100644 (file)
@@ -178,12 +178,14 @@ Scheduler::yield()
             }
         }
     }
-    if (_current && _current->excWrapper) {
-        // Make sure this isn't a method process.
-        assert(!_current->needsStart());
-        auto ew = _current->excWrapper;
-        _current->excWrapper = nullptr;
-        ew->throw_it();
+    if (_current && !_current->needsStart()) {
+        if (_current->excWrapper) {
+            auto ew = _current->excWrapper;
+            _current->excWrapper = nullptr;
+            ew->throw_it();
+        } else if (_current->syncReset()) {
+            _current->reset(false);
+        }
     }
 }