summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-06-15 18:07:43 -0700
committerGabe Black <gabeblack@google.com>2018-08-22 01:05:59 +0000
commit0801de860c725b412ecbe44332279783abe3de32 (patch)
tree1947a5366aecabd47d0917602e12b1670848a845 /src
parentfc008a085db4685b0403f472478287111bed8d18 (diff)
downloadgem5-0801de860c725b412ecbe44332279783abe3de32.tar.xz
systemc: Add a nonstandard sc_signal constructor.
This constructor takes an initial value to set the sc_signal to, and is used in the tests. Change-Id: I197218846d9a79f9237238c78b1bbd8a7f55443f Reviewed-on: https://gem5-review.googlesource.com/11266 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/systemc/ext/channel/sc_signal.hh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/systemc/ext/channel/sc_signal.hh b/src/systemc/ext/channel/sc_signal.hh
index e1ed619bf..de571b23e 100644
--- a/src/systemc/ext/channel/sc_signal.hh
+++ b/src/systemc/ext/channel/sc_signal.hh
@@ -53,6 +53,12 @@ class sc_signal : public sc_signal_inout_if<T>,
explicit sc_signal(const char *name) : sc_signal_inout_if<T>(),
sc_prim_channel(name)
{}
+ explicit sc_signal(const char *name, const T &initial_value) :
+ sc_signal_inout_if<T>(), sc_prim_channel(name)
+ {
+ // Need to consume initial_value.
+ sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
+ }
virtual ~sc_signal() {}
virtual void
@@ -162,6 +168,12 @@ class sc_signal<bool, WRITER_POLICY> :
{
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
}
+ explicit sc_signal(const char *name, const bool &initial_value) :
+ sc_signal_inout_if<bool>(), sc_prim_channel(name)
+ {
+ // Need to consume initial_value.
+ sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
+ }
virtual ~sc_signal()
{
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
@@ -292,6 +304,13 @@ class sc_signal<sc_dt::sc_logic, WRITER_POLICY> :
{
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
}
+ explicit sc_signal(const char *name,
+ const sc_dt::sc_logic &initial_value) :
+ sc_signal_inout_if<sc_dt::sc_logic>(), sc_prim_channel(name)
+ {
+ // Need to consume initial_value.
+ sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
+ }
virtual ~sc_signal()
{
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);