From e035d680f0051936052ae02c70c8527e194007aa Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 6 Oct 2018 04:11:00 -0700 Subject: [PATCH] systemc: If a process hasn't started, still signal its reset event. Change-Id: I9c8026cde455070841139d02955f5c083b9e0645 Reviewed-on: https://gem5-review.googlesource.com/c/13314 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/core/process.hh | 4 ++-- src/systemc/core/scheduler.cc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh index 86ca6744e..d50c82905 100644 --- a/src/systemc/core/process.hh +++ b/src/systemc/core/process.hh @@ -97,8 +97,8 @@ class Process : public ::sc_core::sc_process_b, public ListNode void incref() { refCount++; } void decref() { refCount--; } - const ::sc_core::sc_event &resetEvent() { return _resetEvent; } - const ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; } + ::sc_core::sc_event &resetEvent() { return _resetEvent; } + ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; } void setStackSize(size_t size) { stackSize = size; } diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index d4d70b256..e0a270d4f 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -171,6 +171,10 @@ Scheduler::yield() // If the current process needs to be manually started, start it. if (_current && _current->needsStart()) { _current->needsStart(false); + // If a process hasn't started yet, "resetting" it just starts it + // and signals its reset event. + if (_current->inReset()) + _current->resetEvent().notify(); try { _current->run(); } catch (...) { -- 2.30.2