16#ifndef SIMICS_SYSTEMC_AWARENESS_PROXY_SOCKET_H
17#define SIMICS_SYSTEMC_AWARENESS_PROXY_SOCKET_H
20#include <tlm_utils/multi_socket_bases.h>
44template <
typename TYPES>
60 virtual void init(sc_core::sc_object *obj,
65 base_socket_ =
dynamic_cast<tlm::tlm_base_socket_if *
>(obj);
69 dynamic_cast<tlm_utils::multi_init_base_if<TYPES> *
>(obj);
74#elif defined SYSTEMC_2_3_4 || defined SYSTEMC_3_0_0
75 base_bw_ =
const_cast<sc_core::sc_export_base *
>(
76 &
const_cast<const tlm::tlm_base_socket_if *
>(
88 dynamic_cast<tlm_utils::multi_target_base_if<TYPES> *
>(obj);
93#elif defined SYSTEMC_2_3_4 || defined SYSTEMC_3_0_0
94 base_fw_ =
const_cast<sc_core::sc_export_base *
>(
95 &
const_cast<const tlm::tlm_base_socket_if *
>(
131 std::vector<tlm::tlm_fw_transport_if<TYPES> *> &sockets =
133 for (
auto s : sockets) {
140 std::map<unsigned int, tlm::tlm_bw_transport_if<TYPES> *> &binds =
142 for (
const auto &b : binds) {
148 sc_core::sc_object *obj =
dynamic_cast<sc_core::sc_object *
>(
159 const sc_core::sc_interface *iface =
nullptr;
161 iface =
base_socket_->get_export_base().get_interface();
162#elif defined SYSTEMC_2_3_4 || defined SYSTEMC_3_0_0
163 iface =
const_cast<const tlm::tlm_base_socket_if *
>(
166 return dynamic_cast<const tlm::tlm_fw_transport_if<TYPES> *
>(
174 handler->init(
this, controller);
185 typename std::vector<tlm_utils::callback_binder_bw<TYPES>* >::
192 static_cast<sc_core::sc_interface *
>(
217template <
typename TYPES>
219 public tlm::tlm_fw_transport_if<TYPES> {
227 sc_core::sc_time &t) {
229 return fw_if()->nb_transport_fw(trans, phase, t);
232 sc_core::sc_time &t) {
237 tlm::tlm_dmi &dmi_data) {
239 return fw_if()->get_direct_mem_ptr(trans, dmi_data);
243 return fw_if()->transport_dbg(trans);
246 tlm::tlm_fw_transport_if<TYPES> *fw_if() {
248 tlm::tlm_fw_transport_if<TYPES> *fw_if =
249 dynamic_cast<tlm::tlm_fw_transport_if<TYPES> *
>(
251#elif defined SYSTEMC_2_3_4 || defined SYSTEMC_3_0_0
252 tlm::tlm_fw_transport_if<TYPES> *fw_if =
253 dynamic_cast<tlm::tlm_fw_transport_if<TYPES> *
>(
254 const_cast<sc_core::sc_interface *
>(
255 const_cast<const tlm::tlm_base_socket_if *
>(
264template <
typename TYPES>
265injection::BTransportInvoker<TYPES> ProxyInitiatorSocket<TYPES>::invoker_;
267template <
typename TYPES>
269 public tlm::tlm_bw_transport_if<TYPES> {
278 sc_core::sc_time &t) {
280 return bw_if()->nb_transport_bw(trans, phase, t);
283 sc_dt::uint64 end_range) {
285 bw_if()->invalidate_direct_mem_ptr(start_range, end_range);
289 tlm::tlm_bw_transport_if<TYPES> *bw_if() {
291 tlm::tlm_bw_transport_if<TYPES> *bw_if =
292 dynamic_cast<tlm::tlm_bw_transport_if<TYPES> *
>(
294#elif defined SYSTEMC_2_3_4 || defined SYSTEMC_3_0_0
295 tlm::tlm_bw_transport_if<TYPES> *bw_if =
296 dynamic_cast<tlm::tlm_bw_transport_if<TYPES> *
>(
297 const_cast<sc_core::sc_interface *
>(
298 const_cast<const tlm::tlm_base_socket_if *
>(
static const char * get_typename(sc_export_base *object)
Definition: kernel_state_modifier.h:33
Utility class that reset the current context to the previous one upon leaving current scope.
Definition: kernel.h:29
virtual sc_core::sc_simcontext * context() const
Definition: simulation_interface_proxy.h:46
Definition: proxy_socket.h:219
virtual tlm::tlm_sync_enum nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
Definition: proxy_socket.h:225
virtual unsigned int transport_dbg(transaction_type &trans)
Definition: proxy_socket.h:241
virtual bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
Definition: proxy_socket.h:236
virtual void b_transport(transaction_type &trans, sc_core::sc_time &t)
Definition: proxy_socket.h:231
TYPES::tlm_phase_type phase_type
Definition: proxy_socket.h:222
ProxyInitiatorSocket(simics::ConfObjectRef o)
Definition: proxy_socket.h:223
TYPES::tlm_payload_type transaction_type
Definition: proxy_socket.h:221
Definition: proxy_socket.h:51
std::string socket_name_
Definition: proxy_socket.h:204
virtual bool isTargetSocket()
Definition: proxy_socket.h:157
void addHandler(TlmHandlerInterface *handler)
Definition: proxy_socket.h:199
std::vector< tlm_utils::callback_binder_fw< TYPES > * > binders_fw_
Definition: proxy_socket.h:211
sc_core::sc_export_base * base_bw_
Definition: proxy_socket.h:206
virtual void simulationStarted()
Definition: proxy_socket.h:118
virtual void init(sc_core::sc_object *obj, SimulationInterface *simulation)
Definition: proxy_socket.h:60
virtual void simulationEnded()
Definition: proxy_socket.h:155
std::vector< TlmHandlerInterface * > all_handlers_
Definition: proxy_socket.h:212
tlm_utils::multi_target_base_if< TYPES > * multi_target_
Definition: proxy_socket.h:214
ProxySocketBase(simics::ConfObjectRef o)
Definition: proxy_socket.h:56
virtual void tool_controller_init(ToolController *controller)
Definition: proxy_socket.h:172
const char * base_bw_typename_
Definition: proxy_socket.h:208
virtual void allProxiesInitialized()
Definition: proxy_socket.h:108
const char * base_fw_typename_
Definition: proxy_socket.h:209
tlm_utils::multi_init_base_if< TYPES > * multi_initiator_
Definition: proxy_socket.h:213
std::vector< tlm_utils::callback_binder_bw< TYPES > * > binders_bw_
Definition: proxy_socket.h:210
sc_core::sc_export_base * base_fw_
Definition: proxy_socket.h:207
virtual ~ProxySocketBase()
Definition: proxy_socket.h:184
tlm::tlm_base_socket_if * base_socket_
Definition: proxy_socket.h:205
TYPES types
Definition: proxy_socket.h:54
virtual void connection_list_updated(ConnectionListState state)
Definition: proxy_socket.h:176
Definition: proxy_socket_interface.h:23
Definition: proxy_socket.h:269
virtual void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
Definition: proxy_socket.h:282
TYPES::tlm_payload_type transaction_type
Definition: proxy_socket.h:271
TYPES::tlm_phase_type phase_type
Definition: proxy_socket.h:272
virtual tlm::tlm_sync_enum nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
Definition: proxy_socket.h:276
ProxyTargetSocket(simics::ConfObjectRef o)
Definition: proxy_socket.h:273
virtual void init(sc_core::sc_object *obj, iface::SimulationInterface *simulation)
virtual iface::SimulationInterface * simulation()
static ProxyInterface * findProxy(sc_core::sc_object *obj)
Definition: sc_export_connection.h:40
void insertKey(keytype key)
static void removeBinderExport(keytype key, sc_core::sc_export_base *obj)
std::pair< sc_core::sc_interface *, std::string > keytype
Definition: sc_export_connection.h:42
static void addBinderExport(const keytype &key, sc_core::sc_export_base *obj)
virtual conf_object_t * export_to_proxy()
void init(sc_core::sc_object *object, iface::SimulationInterface *simulation)
Definition: sc_port_connection.h:39
void init(sc_core::sc_object *object, iface::SimulationInterface *simulation)
virtual std::vector< conf_object_t * > port_to_proxies()
static TlmHandlerInterface * targetFwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:158
static TlmHandlerInterface * mPInitiatorFwSocketHandler(tlm::tlm_fw_transport_if< TYPES > *socket)
Definition: tlm_base_handler.h:199
static TlmHandlerInterface * targetBwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:178
static TlmHandlerInterface * mPInitiatorBwSocketHandler(tlm_utils::callback_binder_bw< TYPES > *cb)
Definition: tlm_base_handler.h:214
static TlmHandlerInterface * mPtargetBwSocketHandler(tlm::tlm_bw_transport_if< TYPES > *socket)
Definition: tlm_base_handler.h:243
static TlmHandlerInterface * initiatorFwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:118
static TlmHandlerInterface * mPTargetFwSocketHandler(tlm_utils::callback_binder_fw< TYPES > *cb)
Definition: tlm_base_handler.h:224
static TlmHandlerInterface * mPTargetBwSocketHandler(tlm_utils::callback_binder_fw< TYPES > *cb)
Definition: tlm_base_handler.h:234
static TlmHandlerInterface * mPInitiatorFwMpSocketHandler(tlm::tlm_fw_transport_if< TYPES > *socket)
Definition: tlm_base_handler.h:209
static TlmHandlerInterface * initiatorBwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:138
Definition: tlm_handler_interface.h:26
Definition: b_transport_invoker.h:31