summaryrefslogtreecommitdiff
path: root/src/systemc/ext/core
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-14 21:28:16 -0700
committerGabe Black <gabeblack@google.com>2018-10-09 21:51:03 +0000
commit164f3e01876b74618de111c4a0d2ee027d023e47 (patch)
tree1ef0d19ca6bfbfb0233a10e3048539e3625645f3 /src/systemc/ext/core
parent69a40e98d01bab5c520723f35398c29f739d226f (diff)
downloadgem5-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/ext/core')
-rw-r--r--src/systemc/ext/core/sc_module.hh6
-rw-r--r--src/systemc/ext/core/sc_sensitive.hh27
2 files changed, 29 insertions, 4 deletions
diff --git a/src/systemc/ext/core/sc_module.hh b/src/systemc/ext/core/sc_module.hh
index e5e4c2086..d318a755e 100644
--- a/src/systemc/ext/core/sc_module.hh
+++ b/src/systemc/ext/core/sc_module.hh
@@ -310,10 +310,8 @@ bool timed_out();
#name, new ::sc_gem5::ProcessMemberFuncWrapper< \
SC_CURRENT_USER_MODULE>(this, \
&SC_CURRENT_USER_MODULE::name)); \
- if (p) { \
- this->sensitive << p; \
- this->sensitive << clk; \
- } \
+ if (p) \
+ this->sensitive(p, clk); \
}
// Nonstandard
diff --git a/src/systemc/ext/core/sc_sensitive.hh b/src/systemc/ext/core/sc_sensitive.hh
index 72d401f68..51ee45900 100644
--- a/src/systemc/ext/core/sc_sensitive.hh
+++ b/src/systemc/ext/core/sc_sensitive.hh
@@ -37,6 +37,13 @@ class Process;
} // namespace sc_gem5
+namespace sc_dt
+{
+
+class sc_logic;
+
+} // namespace sc_dt
+
namespace sc_core
{
@@ -46,6 +53,15 @@ class sc_interface;
class sc_module;
class sc_port_base;
+template <class T>
+class sc_signal_in_if;
+
+template <class T>
+class sc_in;
+
+template <class T>
+class sc_inout;
+
class sc_sensitive
{
public:
@@ -56,6 +72,17 @@ class sc_sensitive
sc_sensitive &operator << (::sc_gem5::Process *p);
+ // Nonstandard.
+ void operator () (::sc_gem5::Process *p, const sc_signal_in_if<bool> &);
+ void operator () (::sc_gem5::Process *p,
+ const sc_signal_in_if<sc_dt::sc_logic> &);
+ void operator () (::sc_gem5::Process *p, const sc_in<bool> &);
+ void operator () (::sc_gem5::Process *p, const sc_in<sc_dt::sc_logic> &);
+ void operator () (::sc_gem5::Process *p, const sc_inout<bool> &);
+ void operator () (::sc_gem5::Process *p,
+ const sc_inout<sc_dt::sc_logic> &);
+ void operator () (::sc_gem5::Process *p, sc_event_finder &);
+
private:
friend class sc_module;