summaryrefslogtreecommitdiff
path: root/src/systemc/core/sc_spawn.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-04 14:59:28 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:52:24 +0000
commitee3e3278fd7e0d805ea0ecbf97a113cc5086c0af (patch)
tree261da6679e08b18cec591f4a2c5d5f189bed978d /src/systemc/core/sc_spawn.cc
parentd1a86fd7007dbdc6f6a5771c61ef45e72429e374 (diff)
downloadgem5-ee3e3278fd7e0d805ea0ecbf97a113cc5086c0af.tar.xz
systemc: Change how signal based resets work.
The previous implementation used the value changed event to track when signals changed value, but there were a couple problems with this approach. First, this piggybacked on the sensitivity mechanism in some ways, but diverged in others. The sensitivity didn't notify a process when it was satisfied like other sensitivity types would, and it also ignored whether the process was disabled. Second, the value_changed_event is notified by a signal instance as a delta notification, but reset signals are supposed to act immediately. That means they should happen before all delta notifications, or in other words all delta notifications should see the reset status of a given process. That's particularly important in the case of wait(int n) where setting the reset clears the reset count, and the count is checked when determining whether or not to wake up a process when its sensitivity is satisfied, potentially by a delta notification. Third, by removing the middle man and not trying to repurpose the sensitivity mechanism, the code gets simpler and easier to understand. Change-Id: I0d05d11437291d368b060f6a45a207813615f113 Reviewed-on: https://gem5-review.googlesource.com/c/13294 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/sc_spawn.cc')
-rw-r--r--src/systemc/core/sc_spawn.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/systemc/core/sc_spawn.cc b/src/systemc/core/sc_spawn.cc
index ed7f2f22b..8c4d2bc72 100644
--- a/src/systemc/core/sc_spawn.cc
+++ b/src/systemc/core/sc_spawn.cc
@@ -31,6 +31,10 @@
#include "systemc/core/process.hh"
#include "systemc/core/process_types.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/channel/sc_in.hh"
+#include "systemc/ext/channel/sc_inout.hh"
+#include "systemc/ext/channel/sc_out.hh"
+#include "systemc/ext/channel/sc_signal_in_if.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_module.hh"
#include "systemc/ext/core/sc_spawn.hh"
@@ -85,16 +89,16 @@ spawnWork(ProcessFuncWrapper *func, const char *name,
newStaticSensitivityFinder(proc, f);
for (auto p: opts->_in_resets)
- newResetSensitivityPort(proc, p.target, p.value, p.sync);
+ newReset(p.target, proc, p.sync, p.value);
for (auto p: opts->_inout_resets)
- newResetSensitivityPort(proc, p.target, p.value, p.sync);
+ newReset(p.target, proc, p.sync, p.value);
for (auto p: opts->_out_resets)
- newResetSensitivityPort(proc, p.target, p.value, p.sync);
+ newReset(p.target, proc, p.sync, p.value);
for (auto i: opts->_if_resets)
- newResetSensitivitySignal(proc, i.target, i.value, i.sync);
+ newReset(i.target, proc, i.sync, i.value);
}
if (opts && opts->_dontInitialize &&