diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-15 15:24:28 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-09 21:52:42 +0000 |
commit | dd017903991f51e1fa8df8dbc21cbb4a1501c1c1 (patch) | |
tree | 39f7e475414aaeef75dbb2bb2d9f7f7b30ff367f /src/systemc/ext/channel/sc_inout_rv.hh | |
parent | fad9488643dbf09e4d99b89b6b775fd6f1b24ba6 (diff) | |
download | gem5-dd017903991f51e1fa8df8dbc21cbb4a1501c1c1.tar.xz |
systemc: Implement the sc_signal_rv channel and ports.
Change-Id: Id1a3fd2ded224bbe94a4a65e0acf34a3547aedcc
Reviewed-on: https://gem5-review.googlesource.com/c/12813
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/channel/sc_inout_rv.hh')
-rw-r--r-- | src/systemc/ext/channel/sc_inout_rv.hh | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/systemc/ext/channel/sc_inout_rv.hh b/src/systemc/ext/channel/sc_inout_rv.hh index f231d9311..5ff9d105e 100644 --- a/src/systemc/ext/channel/sc_inout_rv.hh +++ b/src/systemc/ext/channel/sc_inout_rv.hh @@ -30,9 +30,12 @@ #ifndef __SYSTEMC_EXT_CHANNEL_SC_INOUT_RV_HH__ #define __SYSTEMC_EXT_CHANNEL_SC_INOUT_RV_HH__ +#include <sstream> + #include "../core/sc_port.hh" #include "sc_signal_in_if.hh" #include "sc_signal_inout_if.hh" +#include "sc_signal_rv.hh" #include "warn_unimpl.hh" namespace sc_dt @@ -55,37 +58,48 @@ class sc_inout_rv : public sc_inout<sc_dt::sc_lv<W>> virtual ~sc_inout_rv() {} sc_inout_rv<W> & - operator = (const sc_dt::sc_lv<W> &) + operator = (const sc_dt::sc_lv<W> &l) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + (*this)->write(l); return *this; } sc_inout_rv<W> & - operator = (const sc_signal_in_if<sc_dt::sc_lv<W>> &) + operator = (const sc_signal_in_if<sc_dt::sc_lv<W>> &i) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + (*this)->write(i.read()); return *this; } sc_inout_rv<W> & - operator = (const sc_port<sc_signal_in_if<sc_dt::sc_lv<W>>, 1> &) + operator = (const sc_port<sc_signal_in_if<sc_dt::sc_lv<W>>, 1> &p) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + (*this)->write(p->read()); return *this; } sc_inout_rv<W> & - operator = (const sc_port<sc_signal_inout_if<sc_dt::sc_lv<W>>, 1> &) + operator = (const sc_port<sc_signal_inout_if<sc_dt::sc_lv<W>>, 1> &p) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + (*this)->write(p->read()); return *this; } sc_inout_rv<W> & - operator = (const sc_inout_rv<W> &) + operator = (const sc_inout_rv<W> &p) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + (*this)->write(p->read()); return *this; } - virtual void end_of_elaboration() {}; + virtual void + end_of_elaboration() + { + sc_inout<sc_dt::sc_lv<W> >::end_of_elaboration(); + if (!dynamic_cast<sc_signal_rv<W> *>(this->get_interface())) { + std::ostringstream ss; + ss << this->name() << " (" << this->kind() << ")"; + SC_REPORT_ERROR( + "(E117) resolved port not bound to resolved signal", + ss.str().c_str()); + } + } virtual const char *kind() const { return "sc_inout_rv"; } }; |