summaryrefslogtreecommitdiff
path: root/src/systemc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-06-07 18:23:41 -0700
committerGabe Black <gabeblack@google.com>2018-08-15 01:30:50 +0000
commit411f9077dc914c76b37104acd209a7944cbf037a (patch)
tree8890441a8498dde3a11e77d379cda0032035dc4b /src/systemc
parent9a457d97b543c5e1c03cf40b78ca4c53bf902642 (diff)
downloadgem5-411f9077dc914c76b37104acd209a7944cbf037a.tar.xz
systemc: Add in the deprecated binding port constructors.
These are needed by... you guessed it, the regression tests. Change-Id: Id30e71944cc7f3faca7dcb197f37938368364fcd Reviewed-on: https://gem5-review.googlesource.com/10958 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r--src/systemc/ext/channel/sc_fifo_in.hh20
-rw-r--r--src/systemc/ext/channel/sc_fifo_out.hh20
-rw-r--r--src/systemc/ext/channel/sc_in.hh63
-rw-r--r--src/systemc/ext/channel/sc_inout.hh65
-rw-r--r--src/systemc/ext/channel/sc_out.hh16
-rw-r--r--src/systemc/ext/core/sc_port.hh64
6 files changed, 236 insertions, 12 deletions
diff --git a/src/systemc/ext/channel/sc_fifo_in.hh b/src/systemc/ext/channel/sc_fifo_in.hh
index 7f593c16f..0952d77d1 100644
--- a/src/systemc/ext/channel/sc_fifo_in.hh
+++ b/src/systemc/ext/channel/sc_fifo_in.hh
@@ -49,6 +49,26 @@ class sc_fifo_in : public sc_port<sc_fifo_in_if<T>, 0>
{}
virtual ~sc_fifo_in() {}
+ // Deprecated binding constructors.
+ explicit sc_fifo_in(const sc_fifo_in_if<T> &interface) :
+ sc_port<sc_fifo_in_if<T>, 0>(interface)
+ {}
+ sc_fifo_in(const char *name, const sc_fifo_in_if<T> &interface) :
+ sc_port<sc_fifo_in_if<T>, 0>(name, interface)
+ {}
+ explicit sc_fifo_in(sc_port_b<sc_fifo_in_if<T> > &parent) :
+ sc_port<sc_fifo_in_if<T>, 0>(parent)
+ {}
+ sc_fifo_in(const char *name, sc_port_b<sc_fifo_in_if<T> > &parent) :
+ sc_port<sc_fifo_in_if<T>, 0>(name, parent)
+ {}
+ explicit sc_fifo_in(sc_port<sc_fifo_in_if<T>, 0> &parent) :
+ sc_port<sc_fifo_in_if<T>, 0>(parent)
+ {}
+ sc_fifo_in(const char *name, sc_port<sc_fifo_in_if<T>, 0> &parent) :
+ sc_port<sc_fifo_in_if<T>, 0>(name, parent)
+ {}
+
void
read(T &)
{
diff --git a/src/systemc/ext/channel/sc_fifo_out.hh b/src/systemc/ext/channel/sc_fifo_out.hh
index 4beb15d37..af2f6efe5 100644
--- a/src/systemc/ext/channel/sc_fifo_out.hh
+++ b/src/systemc/ext/channel/sc_fifo_out.hh
@@ -50,6 +50,26 @@ class sc_fifo_out : public sc_port<sc_fifo_out_if<T>, 0>
{}
virtual ~sc_fifo_out() {}
+ // Deprecated binding constructors.
+ explicit sc_fifo_out(const sc_fifo_out_if<T> &interface) :
+ sc_port<sc_fifo_out_if<T>, 0>(interface)
+ {}
+ sc_fifo_out(const char *name, const sc_fifo_out_if<T> &interface) :
+ sc_port<sc_fifo_out_if<T>, 0>(name, interface)
+ {}
+ explicit sc_fifo_out(sc_port_b<sc_fifo_out_if<T> > &parent) :
+ sc_port<sc_fifo_out_if<T>, 0>(parent)
+ {}
+ sc_fifo_out(const char *name, sc_port_b<sc_fifo_out_if<T> > &parent) :
+ sc_port<sc_fifo_out_if<T>, 0>(name, parent)
+ {}
+ explicit sc_fifo_out(sc_port<sc_fifo_out_if<T>, 0> &parent) :
+ sc_port<sc_fifo_out_if<T>, 0>(parent)
+ {}
+ sc_fifo_out(const char *name, sc_port<sc_fifo_out_if<T>, 0> &parent) :
+ sc_port<sc_fifo_out_if<T>, 0>(name, parent)
+ {}
+
void
write(const T &)
{
diff --git a/src/systemc/ext/channel/sc_in.hh b/src/systemc/ext/channel/sc_in.hh
index a283d0db3..f691afee0 100644
--- a/src/systemc/ext/channel/sc_in.hh
+++ b/src/systemc/ext/channel/sc_in.hh
@@ -52,6 +52,26 @@ class sc_in : public sc_port<sc_signal_in_if<T>, 1>
explicit sc_in(const char *name) : sc_port<sc_signal_in_if<T>, 1>(name) {}
virtual ~sc_in() {}
+ // Deprecated binding constructors.
+ explicit sc_in(const sc_signal_in_if<T> &interface) :
+ sc_port<sc_signal_in_if<T>, 1>(interface)
+ {}
+ sc_in(const char *name, const sc_signal_in_if<T> &interface) :
+ sc_port<sc_signal_in_if<T>, 1>(name, interface)
+ {}
+ explicit sc_in(sc_port_b<sc_signal_in_if<T> > &parent) :
+ sc_port<sc_signal_in_if<T>, 1>(parent)
+ {}
+ sc_in(const char *name, sc_port_b<sc_signal_in_if<T> > &parent) :
+ sc_port<sc_signal_in_if<T>, 1>(name, parent)
+ {}
+ explicit sc_in(sc_port<sc_signal_in_if<T>, 1> &parent) :
+ sc_port<sc_signal_in_if<T>, 1>(parent)
+ {}
+ sc_in(const char *name, sc_port<sc_signal_in_if<T>, 1> &parent) :
+ sc_port<sc_signal_in_if<T>, 1>(name, parent)
+ {}
+
virtual void
bind(const sc_signal_in_if<T> &)
{
@@ -152,6 +172,26 @@ class sc_in<bool> : public sc_port<sc_signal_in_if<bool>, 1>
sc_port<sc_signal_in_if<bool>, 1>(name) {}
virtual ~sc_in() {}
+ // Deprecated binding constructors.
+ explicit sc_in(const sc_signal_in_if<bool> &interface) :
+ sc_port<sc_signal_in_if<bool>, 1>(interface)
+ {}
+ sc_in(const char *name, const sc_signal_in_if<bool> &interface) :
+ sc_port<sc_signal_in_if<bool>, 1>(name, interface)
+ {}
+ explicit sc_in(sc_port_b<sc_signal_in_if<bool> > &parent) :
+ sc_port<sc_signal_in_if<bool>, 1>(parent)
+ {}
+ sc_in(const char *name, sc_port_b<sc_signal_in_if<bool> > &parent) :
+ sc_port<sc_signal_in_if<bool>, 1>(name, parent)
+ {}
+ explicit sc_in(sc_port<sc_signal_in_if<bool>, 1> &parent) :
+ sc_port<sc_signal_in_if<bool>, 1>(parent)
+ {}
+ sc_in(const char *name, sc_port<sc_signal_in_if<bool>, 1> &parent) :
+ sc_port<sc_signal_in_if<bool>, 1>(name, parent)
+ {}
+
virtual void
bind(const sc_signal_in_if<bool> &)
{
@@ -292,6 +332,29 @@ class sc_in<sc_dt::sc_logic> :
{}
virtual ~sc_in() {}
+ // Deprecated binding constructors.
+ explicit sc_in(const sc_signal_in_if<sc_dt::sc_logic> &interface) :
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(interface)
+ {}
+ sc_in(const char *name,
+ const sc_signal_in_if<sc_dt::sc_logic> &interface) :
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(name, interface)
+ {}
+ explicit sc_in(sc_port_b<sc_signal_in_if<sc_dt::sc_logic> > &parent) :
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(parent)
+ {}
+ sc_in(const char *name,
+ sc_port_b<sc_signal_in_if<sc_dt::sc_logic> > &parent) :
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(name, parent)
+ {}
+ explicit sc_in(sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &parent) :
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(parent)
+ {}
+ sc_in(const char *name,
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &parent) :
+ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(name, parent)
+ {}
+
virtual void
bind(const sc_signal_in_if<sc_dt::sc_logic> &)
{
diff --git a/src/systemc/ext/channel/sc_inout.hh b/src/systemc/ext/channel/sc_inout.hh
index 1802b2e8d..c183e0fff 100644
--- a/src/systemc/ext/channel/sc_inout.hh
+++ b/src/systemc/ext/channel/sc_inout.hh
@@ -60,6 +60,26 @@ class sc_inout : public sc_port<sc_signal_inout_if<T>, 1>
{}
virtual ~sc_inout() {}
+ // Deprecated binding constructors.
+ explicit sc_inout(const sc_signal_inout_if<T> &interface) :
+ sc_port<sc_signal_inout_if<T>, 1>(interface)
+ {}
+ sc_inout(const char *name, const sc_signal_inout_if<T> &interface) :
+ sc_port<sc_signal_inout_if<T>, 1>(name, interface)
+ {}
+ explicit sc_inout(sc_port_b<sc_signal_inout_if<T> > &parent) :
+ sc_port<sc_signal_inout_if<T>, 1>(parent)
+ {}
+ sc_inout(const char *name, sc_port_b<sc_signal_inout_if<T> > &parent) :
+ sc_port<sc_signal_inout_if<T>, 1>(name, parent)
+ {}
+ explicit sc_inout(sc_port<sc_signal_inout_if<T>, 1> &parent) :
+ sc_port<sc_signal_inout_if<T>, 1>(parent)
+ {}
+ sc_inout(const char *name, sc_port<sc_signal_inout_if<T>, 1> &parent) :
+ sc_port<sc_signal_inout_if<T>, 1>(name, parent)
+ {}
+
void
initialize(const T &)
{
@@ -170,6 +190,26 @@ class sc_inout<bool> : public sc_port<sc_signal_inout_if<bool>, 1>
{}
virtual ~sc_inout() {}
+ // Deprecated binding constructors.
+ explicit sc_inout(const sc_signal_inout_if<bool> &interface) :
+ sc_port<sc_signal_inout_if<bool>, 1>(interface)
+ {}
+ sc_inout(const char *name, const sc_signal_inout_if<bool> &interface) :
+ sc_port<sc_signal_inout_if<bool>, 1>(name, interface)
+ {}
+ explicit sc_inout(sc_port_b<sc_signal_inout_if<bool> > &parent) :
+ sc_port<sc_signal_inout_if<bool>, 1>(parent)
+ {}
+ sc_inout(const char *name, sc_port_b<sc_signal_inout_if<bool> > &parent) :
+ sc_port<sc_signal_inout_if<bool>, 1>(name, parent)
+ {}
+ explicit sc_inout(sc_port<sc_signal_inout_if<bool>, 1> &parent) :
+ sc_port<sc_signal_inout_if<bool>, 1>(parent)
+ {}
+ sc_inout(const char *name, sc_port<sc_signal_inout_if<bool>, 1> &parent) :
+ sc_port<sc_signal_inout_if<bool>, 1>(name, parent)
+ {}
+
void
initialize(const bool &)
{
@@ -320,6 +360,31 @@ class sc_inout<sc_dt::sc_logic> :
{}
virtual ~sc_inout() {}
+ // Deprecated binding constructors.
+ explicit sc_inout(const sc_signal_inout_if<sc_dt::sc_logic> &interface) :
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(interface)
+ {}
+ sc_inout(const char *name,
+ const sc_signal_inout_if<sc_dt::sc_logic> &interface) :
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name, interface)
+ {}
+ explicit sc_inout(
+ sc_port_b<sc_signal_inout_if<sc_dt::sc_logic> > &parent) :
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(parent)
+ {}
+ sc_inout(const char *name,
+ sc_port_b<sc_signal_inout_if<sc_dt::sc_logic> > &parent) :
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name, parent)
+ {}
+ explicit sc_inout(
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &parent) :
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(parent)
+ {}
+ sc_inout(const char *name,
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &parent) :
+ sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name, parent)
+ {}
+
void
initialize(const sc_dt::sc_logic &)
{
diff --git a/src/systemc/ext/channel/sc_out.hh b/src/systemc/ext/channel/sc_out.hh
index e55a821d4..53bd25560 100644
--- a/src/systemc/ext/channel/sc_out.hh
+++ b/src/systemc/ext/channel/sc_out.hh
@@ -45,6 +45,22 @@ class sc_out : public sc_inout<T>
explicit sc_out(const char *name) : sc_inout<T>(name) {}
virtual ~sc_out() {}
+ // Deprecated binding constructors.
+ explicit sc_out(const sc_signal_inout_if<T> &interface) :
+ sc_inout<T>(interface)
+ {}
+ sc_out(const char *name, const sc_signal_inout_if<T> &interface) :
+ sc_inout<T>(name, interface)
+ {}
+ explicit sc_out(sc_port_b<sc_signal_inout_if<T> > &parent) :
+ sc_inout<T>(parent)
+ {}
+ sc_out(const char *name, sc_port_b<sc_signal_inout_if<T> > &parent) :
+ sc_inout<T>(name, parent)
+ {}
+ explicit sc_out(sc_out<T> &parent) : sc_inout<T>(parent) {}
+ sc_out(const char *name, sc_out<T> &parent) : sc_inout<T>(name, parent) {}
+
sc_out<T> &
operator = (const T &)
{
diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh
index b2f9bd8bb..dfcae95da 100644
--- a/src/systemc/ext/core/sc_port.hh
+++ b/src/systemc/ext/core/sc_port.hh
@@ -61,73 +61,73 @@ class sc_port_b : public sc_port_base
void
operator () (IF &)
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
}
void
operator () (sc_port_b<IF> &)
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
}
virtual void
bind(IF &)
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
}
virtual void
bind(sc_port_b<IF> &)
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
}
int
size() const
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return 0;
}
IF *
operator -> ()
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return (IF *)nullptr;
}
const IF *
operator -> () const
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return (IF *)nullptr;
}
IF *
operator [] (int)
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return (IF *)nullptr;
}
const IF *
operator [] (int) const
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return (IF *)nullptr;
}
virtual sc_interface *
get_interface()
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return (sc_interface *)nullptr;
}
virtual const sc_interface *
get_interface() const
{
- warn_unimpl(__PRETTY_FUNCTION__);
+ this->warn_unimpl(__PRETTY_FUNCTION__);
return (sc_interface *)nullptr;
}
@@ -156,10 +156,50 @@ template <class IF, int N=1, sc_port_policy P=SC_ONE_OR_MORE_BOUND>
class sc_port : public sc_port_b<IF>
{
public:
- sc_port() : sc_port_b<IF>(sc_gen_unique_name("sc_port"), N, P) {}
+ sc_port() : sc_port_b<IF>(N, P) {}
explicit sc_port(const char *name) : sc_port_b<IF>(name, N, P) {}
virtual ~sc_port() {}
+ // Deprecated binding constructors.
+ explicit sc_port(const IF &interface) : sc_port_b<IF>(N, P)
+ {
+ this->warn_unimpl(__PRETTY_FUNCTION__);
+ // Should warn that these are deprecated. See Accellera sc_port.h.
+ sc_port_b<IF>::bind(const_cast<IF &>(interface));
+ }
+ sc_port(const char *name, const IF &interface) : sc_port_b<IF>(name, N, P)
+ {
+ this->warn_unimpl(__PRETTY_FUNCTION__);
+ // Should warn that these are deprecated. See Accellera sc_port.h.
+ sc_port_b<IF>::bind(const_cast<IF &>(interface));
+ }
+ explicit sc_port(sc_port_b<IF> &parent) : sc_port_b<IF>(N, P)
+ {
+ this->warn_unimpl(__PRETTY_FUNCTION__);
+ // Should warn that these are deprecated. See Accellera sc_port.h.
+ sc_port_b<IF>::bind(parent);
+ }
+ sc_port(const char *name, sc_port_b<IF> &parent) :
+ sc_port_b<IF>(name, N, P)
+ {
+ this->warn_unimpl(__PRETTY_FUNCTION__);
+ // Should warn that these are deprecated. See Accellera sc_port.h.
+ sc_port_b<IF>::bind(parent);
+ }
+ explicit sc_port(sc_port<IF, N, P> &parent) : sc_port_b<IF>(N, P)
+ {
+ this->warn_unimpl(__PRETTY_FUNCTION__);
+ // Should warn that these are deprecated. See Accellera sc_port.h.
+ sc_port_b<IF>::bind(parent);
+ }
+ sc_port(const char *name, sc_port<IF, N, P> &parent) :
+ sc_port_b<IF>(name, N, P)
+ {
+ this->warn_unimpl(__PRETTY_FUNCTION__);
+ // Should warn that these are deprecated. See Accellera sc_port.h.
+ sc_port_b<IF>::bind(parent);
+ }
+
virtual const char *kind() const { return "sc_port"; }
private: