From: Gabe Black Date: Fri, 8 Jun 2018 01:23:41 +0000 (-0700) Subject: systemc: Add in the deprecated binding port constructors. X-Git-Tag: v19.0.0.0~1951 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=411f9077dc914c76b37104acd209a7944cbf037a;p=gem5.git 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 Maintainer: Gabe Black --- 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, 0> {} virtual ~sc_fifo_in() {} + // Deprecated binding constructors. + explicit sc_fifo_in(const sc_fifo_in_if &interface) : + sc_port, 0>(interface) + {} + sc_fifo_in(const char *name, const sc_fifo_in_if &interface) : + sc_port, 0>(name, interface) + {} + explicit sc_fifo_in(sc_port_b > &parent) : + sc_port, 0>(parent) + {} + sc_fifo_in(const char *name, sc_port_b > &parent) : + sc_port, 0>(name, parent) + {} + explicit sc_fifo_in(sc_port, 0> &parent) : + sc_port, 0>(parent) + {} + sc_fifo_in(const char *name, sc_port, 0> &parent) : + sc_port, 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, 0> {} virtual ~sc_fifo_out() {} + // Deprecated binding constructors. + explicit sc_fifo_out(const sc_fifo_out_if &interface) : + sc_port, 0>(interface) + {} + sc_fifo_out(const char *name, const sc_fifo_out_if &interface) : + sc_port, 0>(name, interface) + {} + explicit sc_fifo_out(sc_port_b > &parent) : + sc_port, 0>(parent) + {} + sc_fifo_out(const char *name, sc_port_b > &parent) : + sc_port, 0>(name, parent) + {} + explicit sc_fifo_out(sc_port, 0> &parent) : + sc_port, 0>(parent) + {} + sc_fifo_out(const char *name, sc_port, 0> &parent) : + sc_port, 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, 1> explicit sc_in(const char *name) : sc_port, 1>(name) {} virtual ~sc_in() {} + // Deprecated binding constructors. + explicit sc_in(const sc_signal_in_if &interface) : + sc_port, 1>(interface) + {} + sc_in(const char *name, const sc_signal_in_if &interface) : + sc_port, 1>(name, interface) + {} + explicit sc_in(sc_port_b > &parent) : + sc_port, 1>(parent) + {} + sc_in(const char *name, sc_port_b > &parent) : + sc_port, 1>(name, parent) + {} + explicit sc_in(sc_port, 1> &parent) : + sc_port, 1>(parent) + {} + sc_in(const char *name, sc_port, 1> &parent) : + sc_port, 1>(name, parent) + {} + virtual void bind(const sc_signal_in_if &) { @@ -152,6 +172,26 @@ class sc_in : public sc_port, 1> sc_port, 1>(name) {} virtual ~sc_in() {} + // Deprecated binding constructors. + explicit sc_in(const sc_signal_in_if &interface) : + sc_port, 1>(interface) + {} + sc_in(const char *name, const sc_signal_in_if &interface) : + sc_port, 1>(name, interface) + {} + explicit sc_in(sc_port_b > &parent) : + sc_port, 1>(parent) + {} + sc_in(const char *name, sc_port_b > &parent) : + sc_port, 1>(name, parent) + {} + explicit sc_in(sc_port, 1> &parent) : + sc_port, 1>(parent) + {} + sc_in(const char *name, sc_port, 1> &parent) : + sc_port, 1>(name, parent) + {} + virtual void bind(const sc_signal_in_if &) { @@ -292,6 +332,29 @@ class sc_in : {} virtual ~sc_in() {} + // Deprecated binding constructors. + explicit sc_in(const sc_signal_in_if &interface) : + sc_port, 1>(interface) + {} + sc_in(const char *name, + const sc_signal_in_if &interface) : + sc_port, 1>(name, interface) + {} + explicit sc_in(sc_port_b > &parent) : + sc_port, 1>(parent) + {} + sc_in(const char *name, + sc_port_b > &parent) : + sc_port, 1>(name, parent) + {} + explicit sc_in(sc_port, 1> &parent) : + sc_port, 1>(parent) + {} + sc_in(const char *name, + sc_port, 1> &parent) : + sc_port, 1>(name, parent) + {} + virtual void bind(const sc_signal_in_if &) { 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, 1> {} virtual ~sc_inout() {} + // Deprecated binding constructors. + explicit sc_inout(const sc_signal_inout_if &interface) : + sc_port, 1>(interface) + {} + sc_inout(const char *name, const sc_signal_inout_if &interface) : + sc_port, 1>(name, interface) + {} + explicit sc_inout(sc_port_b > &parent) : + sc_port, 1>(parent) + {} + sc_inout(const char *name, sc_port_b > &parent) : + sc_port, 1>(name, parent) + {} + explicit sc_inout(sc_port, 1> &parent) : + sc_port, 1>(parent) + {} + sc_inout(const char *name, sc_port, 1> &parent) : + sc_port, 1>(name, parent) + {} + void initialize(const T &) { @@ -170,6 +190,26 @@ class sc_inout : public sc_port, 1> {} virtual ~sc_inout() {} + // Deprecated binding constructors. + explicit sc_inout(const sc_signal_inout_if &interface) : + sc_port, 1>(interface) + {} + sc_inout(const char *name, const sc_signal_inout_if &interface) : + sc_port, 1>(name, interface) + {} + explicit sc_inout(sc_port_b > &parent) : + sc_port, 1>(parent) + {} + sc_inout(const char *name, sc_port_b > &parent) : + sc_port, 1>(name, parent) + {} + explicit sc_inout(sc_port, 1> &parent) : + sc_port, 1>(parent) + {} + sc_inout(const char *name, sc_port, 1> &parent) : + sc_port, 1>(name, parent) + {} + void initialize(const bool &) { @@ -320,6 +360,31 @@ class sc_inout : {} virtual ~sc_inout() {} + // Deprecated binding constructors. + explicit sc_inout(const sc_signal_inout_if &interface) : + sc_port, 1>(interface) + {} + sc_inout(const char *name, + const sc_signal_inout_if &interface) : + sc_port, 1>(name, interface) + {} + explicit sc_inout( + sc_port_b > &parent) : + sc_port, 1>(parent) + {} + sc_inout(const char *name, + sc_port_b > &parent) : + sc_port, 1>(name, parent) + {} + explicit sc_inout( + sc_port, 1> &parent) : + sc_port, 1>(parent) + {} + sc_inout(const char *name, + sc_port, 1> &parent) : + sc_port, 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 explicit sc_out(const char *name) : sc_inout(name) {} virtual ~sc_out() {} + // Deprecated binding constructors. + explicit sc_out(const sc_signal_inout_if &interface) : + sc_inout(interface) + {} + sc_out(const char *name, const sc_signal_inout_if &interface) : + sc_inout(name, interface) + {} + explicit sc_out(sc_port_b > &parent) : + sc_inout(parent) + {} + sc_out(const char *name, sc_port_b > &parent) : + sc_inout(name, parent) + {} + explicit sc_out(sc_out &parent) : sc_inout(parent) {} + sc_out(const char *name, sc_out &parent) : sc_inout(name, parent) {} + sc_out & 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 &) { - 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 &) { - 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 sc_port : public sc_port_b { public: - sc_port() : sc_port_b(sc_gen_unique_name("sc_port"), N, P) {} + sc_port() : sc_port_b(N, P) {} explicit sc_port(const char *name) : sc_port_b(name, N, P) {} virtual ~sc_port() {} + // Deprecated binding constructors. + explicit sc_port(const IF &interface) : sc_port_b(N, P) + { + this->warn_unimpl(__PRETTY_FUNCTION__); + // Should warn that these are deprecated. See Accellera sc_port.h. + sc_port_b::bind(const_cast(interface)); + } + sc_port(const char *name, const IF &interface) : sc_port_b(name, N, P) + { + this->warn_unimpl(__PRETTY_FUNCTION__); + // Should warn that these are deprecated. See Accellera sc_port.h. + sc_port_b::bind(const_cast(interface)); + } + explicit sc_port(sc_port_b &parent) : sc_port_b(N, P) + { + this->warn_unimpl(__PRETTY_FUNCTION__); + // Should warn that these are deprecated. See Accellera sc_port.h. + sc_port_b::bind(parent); + } + sc_port(const char *name, sc_port_b &parent) : + sc_port_b(name, N, P) + { + this->warn_unimpl(__PRETTY_FUNCTION__); + // Should warn that these are deprecated. See Accellera sc_port.h. + sc_port_b::bind(parent); + } + explicit sc_port(sc_port &parent) : sc_port_b(N, P) + { + this->warn_unimpl(__PRETTY_FUNCTION__); + // Should warn that these are deprecated. See Accellera sc_port.h. + sc_port_b::bind(parent); + } + sc_port(const char *name, sc_port &parent) : + sc_port_b(name, N, P) + { + this->warn_unimpl(__PRETTY_FUNCTION__); + // Should warn that these are deprecated. See Accellera sc_port.h. + sc_port_b::bind(parent); + } + virtual const char *kind() const { return "sc_port"; } private: