18 #ifndef __TLM_INITIATOR_SOCKET_H__
19 #define __TLM_INITIATOR_SOCKET_H__
27 template <
unsigned int BUSWIDTH = 32,
28 typename FW_IF = tlm_fw_transport_if<>,
29 typename BW_IF = tlm_bw_transport_if<> >
44 template <
unsigned int BUSWIDTH,
48 template <
unsigned int BUSWIDTH,
52 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
57 template <
unsigned int BUSWIDTH = 32,
61 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
67 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
74 typedef FW_IF fw_interface_type;
75 typedef BW_IF bw_interface_type;
76 typedef sc_core::sc_port<fw_interface_type, N
77 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
82 typedef sc_core::sc_export<bw_interface_type> export_type;
84 typedef tlm_base_target_socket_b<BUSWIDTH,
86 bw_interface_type> base_target_socket_type;
87 typedef tlm_base_initiator_socket_b<BUSWIDTH,
89 bw_interface_type> base_type;
91 template <unsigned int, typename, typename, int
92 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
93 ,sc_core::sc_port_policy
96 friend class tlm_base_target_socket;
99 tlm_base_initiator_socket()
100 : port_type(sc_core::sc_gen_unique_name("tlm_base_initiator_socket"))
101 , m_export(sc_core::sc_gen_unique_name("tlm_base_initiator_socket_export"))
105 explicit tlm_base_initiator_socket(const char* name)
107 , m_export(sc_core::sc_gen_unique_name((std::string(name) + "_export").c_str()))
111 virtual const char* kind() const
113 return "tlm_base_initiator_socket";
116 unsigned int get_bus_width() const
128 virtual void bind(base_target_socket_type& s)
131 (get_base_port())(s.get_base_interface());
133 (s.get_base_port())(get_base_interface());
136 void operator() (base_target_socket_type& s)
145 virtual void bind(base_type& s)
148 (get_base_port())(s.get_base_port());
150 (s.get_base_export())(get_base_export());
153 void operator() (base_type& s)
162 virtual void bind(bw_interface_type& ifs)
164 (get_base_export())(ifs);
167 void operator() (bw_interface_type& s)
173 virtual sc_core::sc_port_b<FW_IF> & get_base_port()
175 virtual sc_core::sc_port_b<FW_IF> const & get_base_port() const
178 virtual BW_IF & get_base_interface()
180 virtual BW_IF const & get_base_interface() const
181 #if !( defined(IEEE_1666_SYSTEMC) && IEEE_1666_SYSTEMC >= 201101L )
182 { return const_cast<export_type &>(m_export); }
187 virtual sc_core::sc_export<BW_IF> & get_base_export()
189 virtual sc_core::sc_export<BW_IF> const & get_base_export() const
193 export_type m_export;
200 template <unsigned int BUSWIDTH = 32,
201 typename TYPES = tlm_base_protocol_types,
203 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
204 ,sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND
207 class tlm_initiator_socket :
208 public tlm_base_initiator_socket <BUSWIDTH,
209 tlm_fw_transport_if<TYPES>,
210 tlm_bw_transport_if<TYPES>,
212 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
218 tlm_initiator_socket() :
219 tlm_base_initiator_socket<BUSWIDTH,
220 tlm_fw_transport_if<TYPES>,
221 tlm_bw_transport_if<TYPES>,
223 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
230 explicit tlm_initiator_socket(const char* name) :
231 tlm_base_initiator_socket<BUSWIDTH,
232 tlm_fw_transport_if<TYPES>,
233 tlm_bw_transport_if<TYPES>,
235 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
242 virtual const char* kind() const
244 return "tlm_initiator_socket";
virtual ~tlm_base_initiator_socket_b()
virtual BW_IF & get_base_interface()=0
virtual sc_core::sc_port_b< FW_IF > & get_base_port()=0
virtual sc_core::sc_export< BW_IF > & get_base_export()=0