diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-14 21:28:16 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-09 21:51:03 +0000 |
commit | 164f3e01876b74618de111c4a0d2ee027d023e47 (patch) | |
tree | 1ef0d19ca6bfbfb0233a10e3048539e3625645f3 /src/systemc/core/sc_sensitive.cc | |
parent | 69a40e98d01bab5c520723f35398c29f739d226f (diff) | |
download | gem5-164f3e01876b74618de111c4a0d2ee027d023e47.tar.xz |
systemc: Handle nonstandard cthread sensitivities.
Accellera allows some non-standard values in the second position of the
SC_CTHREAD macro. Do that as well, with the same special handling which
automatically selects the positive edge of boolean ports/interfaces.
Change-Id: I79594980898a17afc30fea6f77384589cbc3c250
Reviewed-on: https://gem5-review.googlesource.com/c/12809
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/sc_sensitive.cc')
-rw-r--r-- | src/systemc/core/sc_sensitive.cc | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/systemc/core/sc_sensitive.cc b/src/systemc/core/sc_sensitive.cc index b254f6861..9b8ae2de4 100644 --- a/src/systemc/core/sc_sensitive.cc +++ b/src/systemc/core/sc_sensitive.cc @@ -29,6 +29,9 @@ #include "base/logging.hh" #include "systemc/core/process.hh" +#include "systemc/ext/channel/sc_in.hh" +#include "systemc/ext/channel/sc_inout.hh" +#include "systemc/ext/channel/sc_signal_in_if.hh" #include "systemc/ext/core/sc_interface.hh" #include "systemc/ext/core/sc_sensitive.hh" @@ -72,4 +75,51 @@ sc_sensitive::operator << (::sc_gem5::Process *p) return *this; } + +void +sc_sensitive::operator () (::sc_gem5::Process *p, + const sc_signal_in_if<bool> &i) +{ + sc_gem5::newStaticSensitivityEvent(p, &i.posedge_event()); +} + +void +sc_sensitive::operator () (::sc_gem5::Process *p, + const sc_signal_in_if<sc_dt::sc_logic> &i) +{ + sc_gem5::newStaticSensitivityEvent(p, &i.posedge_event()); +} + +void +sc_sensitive::operator () (::sc_gem5::Process *p, const sc_in<bool> &port) +{ + sc_gem5::newStaticSensitivityFinder(p, &port.pos()); +} + +void +sc_sensitive::operator () (::sc_gem5::Process *p, + const sc_in<sc_dt::sc_logic> &port) +{ + sc_gem5::newStaticSensitivityFinder(p, &port.pos()); +} + +void +sc_sensitive::operator () (::sc_gem5::Process *p, const sc_inout<bool> &port) +{ + sc_gem5::newStaticSensitivityFinder(p, &port.pos()); +} + +void +sc_sensitive::operator () (::sc_gem5::Process *p, + const sc_inout<sc_dt::sc_logic> &port) +{ + sc_gem5::newStaticSensitivityFinder(p, &port.pos()); +} + +void +sc_sensitive::operator () (::sc_gem5::Process *p, sc_event_finder &f) +{ + sc_gem5::newStaticSensitivityFinder(p, &f); +} + } // namespace sc_core |