diff options
Diffstat (limited to 'src/systemc')
-rw-r--r-- | src/systemc/tlm_port_wrapper.hh | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/src/systemc/tlm_port_wrapper.hh b/src/systemc/tlm_port_wrapper.hh index 59f8d9fe0..1e46c5d82 100644 --- a/src/systemc/tlm_port_wrapper.hh +++ b/src/systemc/tlm_port_wrapper.hh @@ -37,31 +37,27 @@ namespace sc_gem5 { -template <unsigned int BUSWIDTH=32, - typename TYPES=tlm::tlm_base_protocol_types, int N=1, - sc_core::sc_port_policy POL=sc_core::SC_ONE_OR_MORE_BOUND> -class TlmInitiatorWrapper; +template <unsigned int BUSWIDTH, typename FW_IF, typename BW_IF, int N, + sc_core::sc_port_policy POL> +class TlmInitiatorBaseWrapper; -template <unsigned int BUSWIDTH=32, - typename TYPES=tlm::tlm_base_protocol_types, int N=1, - sc_core::sc_port_policy POL=sc_core::SC_ONE_OR_MORE_BOUND> -class TlmTargetWrapper; +template <unsigned int BUSWIDTH, typename FW_IF, typename BW_IF, int N, + sc_core::sc_port_policy POL> +class TlmTargetBaseWrapper; -template <unsigned int BUSWIDTH, typename TYPES, int N, +template <unsigned int BUSWIDTH, typename FW_IF, typename BW_IF, int N, sc_core::sc_port_policy POL> -class TlmInitiatorWrapper : public ::Port +class TlmInitiatorBaseWrapper : public ::Port { public: - typedef tlm::tlm_base_initiator_socket<BUSWIDTH, - tlm::tlm_fw_transport_if<TYPES>, - tlm::tlm_bw_transport_if<TYPES>, N, POL> + typedef tlm::tlm_base_initiator_socket<BUSWIDTH, FW_IF, BW_IF, N, POL> InitiatorSocket; typedef typename InitiatorSocket::base_target_socket_type TargetSocket; - typedef TlmTargetWrapper<BUSWIDTH, TYPES, N, POL> TargetWrapper; + typedef TlmTargetBaseWrapper<BUSWIDTH, FW_IF, BW_IF, N, POL> TargetWrapper; InitiatorSocket &initiator() { return _initiator; } - TlmInitiatorWrapper( + TlmInitiatorBaseWrapper( InitiatorSocket &i, const std::string &_name, PortID _id) : Port(_name, _id), _initiator(i) {} @@ -87,19 +83,18 @@ class TlmInitiatorWrapper : public ::Port InitiatorSocket &_initiator; }; -template <unsigned int BUSWIDTH, typename TYPES, int N, +template <unsigned int BUSWIDTH, typename FW_IF, typename BW_IF, int N, sc_core::sc_port_policy POL> -class TlmTargetWrapper : public ::Port +class TlmTargetBaseWrapper : public ::Port { public: - typedef tlm::tlm_base_target_socket<BUSWIDTH, - tlm::tlm_fw_transport_if<TYPES>, - tlm::tlm_bw_transport_if<TYPES>, N, POL> + typedef tlm::tlm_base_target_socket<BUSWIDTH, FW_IF, BW_IF, N, POL> TargetSocket; TargetSocket &target() { return _target; } - TlmTargetWrapper(TargetSocket &t, const std::string &_name, PortID _id) : + TlmTargetBaseWrapper(TargetSocket &t, const std::string &_name, + PortID _id) : Port(_name, _id), _target(t) {} @@ -121,6 +116,20 @@ class TlmTargetWrapper : public ::Port TargetSocket &_target; }; +template <unsigned int BUSWIDTH=32, + typename TYPES=tlm::tlm_base_protocol_types, int N=1, + sc_core::sc_port_policy POL=sc_core::SC_ONE_OR_MORE_BOUND> +using TlmInitiatorWrapper = + TlmInitiatorBaseWrapper<BUSWIDTH, tlm::tlm_fw_transport_if<TYPES>, + tlm::tlm_bw_transport_if<TYPES>, N, POL>; + +template <unsigned int BUSWIDTH=32, + typename TYPES=tlm::tlm_base_protocol_types, int N=1, + sc_core::sc_port_policy POL=sc_core::SC_ONE_OR_MORE_BOUND> +using TlmTargetWrapper = + TlmTargetBaseWrapper<BUSWIDTH, tlm::tlm_fw_transport_if<TYPES>, + tlm::tlm_bw_transport_if<TYPES>, N, POL>; + } // namespace sc_gem5 #endif //__SYSTEMC_TLM_PORT_WRAPPER_HH__ |