systemc: If a process hasn't started, still signal its reset event.
authorGabe Black <gabeblack@google.com>
Sat, 6 Oct 2018 11:11:00 +0000 (04:11 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 01:03:21 +0000 (01:03 +0000)
Change-Id: I9c8026cde455070841139d02955f5c083b9e0645
Reviewed-on: https://gem5-review.googlesource.com/c/13314
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

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

index 86ca6744e8343f6166638117e54a54d5cd725b59..d50c82905e15216b953b44d696f24fe52ba97de2 100644 (file)
@@ -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; }
 
index d4d70b256016e1949548fa1c543975fc9b89bf90..e0a270d4f271895ae3591218d3d017d36d8e75bc 100644 (file)
@@ -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 (...) {