systemc: Ensure the reset event is notified before reseting the target.
authorGabe Black <gabeblack@google.com>
Thu, 27 Sep 2018 03:32:41 +0000 (20:32 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 00:36:27 +0000 (00:36 +0000)
The target may be the process which is currently running. In that case,
the reset method will end and never get to notifying the reset event.
To fix that, we need to notify the reset event first.

Change-Id: If3a9d87edc0999293a68d86d35989ae49eab3c07
Reviewed-on: https://gem5-review.googlesource.com/c/13187
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/process.cc

index 78bbf91d50bb0b2efafa7d4c1f652eae7f7c0480..d8ed5ffba130daea41f47df15743155367cfb354 100644 (file)
@@ -183,14 +183,14 @@ Process::reset(bool inc_kids)
         return;
 
 
+    _resetEvent.notify();
+
     if (_needsStart) {
         scheduler.runNow(this);
     } else {
         _isUnwinding = true;
         injectException(resetException);
     }
-
-    _resetEvent.notify();
 }
 
 void