diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-26 00:24:01 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-16 00:35:11 +0000 |
commit | f4ab64a588771391c2eebd9b1c8b089aa33cda67 (patch) | |
tree | 5768dc92ef1d12770e6c53af76c66d87d49328b2 /src/systemc | |
parent | fc752d3f3c967557e28f42664b86c18e027e8eec (diff) | |
download | gem5-f4ab64a588771391c2eebd9b1c8b089aa33cda67.tar.xz |
systemc: Implement the synchronous reset state.
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>
Diffstat (limited to 'src/systemc')
-rw-r--r-- | src/systemc/core/process.hh | 1 | ||||
-rw-r--r-- | src/systemc/core/scheduler.cc | 14 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh index 4266c2d7d..9e85fc7cc 100644 --- a/src/systemc/core/process.hh +++ b/src/systemc/core/process.hh @@ -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; } diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index d79abb251..6d571f60b 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -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); + } } } |