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);
82 dynamic_cast<tlm_utils::multi_target_base_if<TYPES> *
>(obj);
119 std::vector<tlm::tlm_fw_transport_if<TYPES> *> &sockets =
121 for (
auto s : sockets) {
128 std::map<unsigned int, tlm::tlm_bw_transport_if<TYPES> *> &binds =
130 for (
const auto &b : binds) {
136 sc_core::sc_object *obj =
dynamic_cast<sc_core::sc_object *
>(
147 return dynamic_cast<tlm::tlm_fw_transport_if<TYPES> *
>(
148 base_socket_->get_export_base().get_interface()) != NULL;
155 handler->init(
this, controller);
166 typename std::vector<tlm_utils::callback_binder_bw<TYPES>* >::
173 static_cast<sc_core::sc_interface *
>(
198template <
typename TYPES>
200 public tlm::tlm_fw_transport_if<TYPES> {
208 sc_core::sc_time &t) {
210 return fw_if()->nb_transport_fw(trans, phase, t);
213 sc_core::sc_time &t) {
218 tlm::tlm_dmi &dmi_data) {
220 return fw_if()->get_direct_mem_ptr(trans, dmi_data);
224 return fw_if()->transport_dbg(trans);
227 tlm::tlm_fw_transport_if<TYPES> *fw_if() {
228 tlm::tlm_fw_transport_if<TYPES> *fw_if =
229 dynamic_cast<tlm::tlm_fw_transport_if<TYPES> *
>(
237template <
typename TYPES>
238injection::BTransportInvoker<TYPES> ProxyInitiatorSocket<TYPES>::invoker_;
240template <
typename TYPES>
242 public tlm::tlm_bw_transport_if<TYPES> {
251 sc_core::sc_time &t) {
253 return bw_if()->nb_transport_bw(trans, phase, t);
256 sc_dt::uint64 end_range) {
258 bw_if()->invalidate_direct_mem_ptr(start_range, end_range);
262 tlm::tlm_bw_transport_if<TYPES> *bw_if() {
263 tlm::tlm_bw_transport_if<TYPES> *bw_if =
264 dynamic_cast<tlm::tlm_bw_transport_if<TYPES> *
>(
static const char * get_typename(sc_export_base *object)
Definition: kernel_state_modifier.h:30
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:200
virtual tlm::tlm_sync_enum nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
Definition: proxy_socket.h:206
virtual unsigned int transport_dbg(transaction_type &trans)
Definition: proxy_socket.h:222
virtual bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
Definition: proxy_socket.h:217
virtual void b_transport(transaction_type &trans, sc_core::sc_time &t)
Definition: proxy_socket.h:212
TYPES::tlm_phase_type phase_type
Definition: proxy_socket.h:203
ProxyInitiatorSocket(simics::ConfObjectRef o)
Definition: proxy_socket.h:204
TYPES::tlm_payload_type transaction_type
Definition: proxy_socket.h:202
Definition: proxy_socket.h:51
std::string socket_name_
Definition: proxy_socket.h:185
virtual bool isTargetSocket()
Definition: proxy_socket.h:145
void addHandler(TlmHandlerInterface *handler)
Definition: proxy_socket.h:180
std::vector< tlm_utils::callback_binder_fw< TYPES > * > binders_fw_
Definition: proxy_socket.h:192
sc_core::sc_export_base * base_bw_
Definition: proxy_socket.h:187
virtual void simulationStarted()
Definition: proxy_socket.h:106
virtual void init(sc_core::sc_object *obj, SimulationInterface *simulation)
Definition: proxy_socket.h:60
virtual void simulationEnded()
Definition: proxy_socket.h:143
std::vector< TlmHandlerInterface * > all_handlers_
Definition: proxy_socket.h:193
tlm_utils::multi_target_base_if< TYPES > * multi_target_
Definition: proxy_socket.h:195
ProxySocketBase(simics::ConfObjectRef o)
Definition: proxy_socket.h:56
virtual void tool_controller_init(ToolController *controller)
Definition: proxy_socket.h:153
const char * base_bw_typename_
Definition: proxy_socket.h:189
virtual void allProxiesInitialized()
Definition: proxy_socket.h:96
const char * base_fw_typename_
Definition: proxy_socket.h:190
tlm_utils::multi_init_base_if< TYPES > * multi_initiator_
Definition: proxy_socket.h:194
std::vector< tlm_utils::callback_binder_bw< TYPES > * > binders_bw_
Definition: proxy_socket.h:191
sc_core::sc_export_base * base_fw_
Definition: proxy_socket.h:188
virtual ~ProxySocketBase()
Definition: proxy_socket.h:165
tlm::tlm_base_socket_if * base_socket_
Definition: proxy_socket.h:186
TYPES types
Definition: proxy_socket.h:54
virtual void connection_list_updated(ConnectionListState state)
Definition: proxy_socket.h:157
Definition: proxy_socket_interface.h:23
Definition: proxy_socket.h:242
virtual void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
Definition: proxy_socket.h:255
TYPES::tlm_payload_type transaction_type
Definition: proxy_socket.h:244
TYPES::tlm_phase_type phase_type
Definition: proxy_socket.h:245
virtual tlm::tlm_sync_enum nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
Definition: proxy_socket.h:249
ProxyTargetSocket(simics::ConfObjectRef o)
Definition: proxy_socket.h:246
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
virtual conf_object_t * export_to_proxy()
void init(sc_core::sc_object *object, iface::SimulationInterface *simulation)
static void addBinderExport(keytype key, sc_core::sc_export_base *obj)
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:140
static TlmHandlerInterface * mPInitiatorFwSocketHandler(tlm::tlm_fw_transport_if< TYPES > *socket)
Definition: tlm_base_handler.h:169
static TlmHandlerInterface * targetBwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:154
static TlmHandlerInterface * mPInitiatorBwSocketHandler(tlm_utils::callback_binder_bw< TYPES > *cb)
Definition: tlm_base_handler.h:184
static TlmHandlerInterface * mPtargetBwSocketHandler(tlm::tlm_bw_transport_if< TYPES > *socket)
Definition: tlm_base_handler.h:213
static TlmHandlerInterface * initiatorFwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:112
static TlmHandlerInterface * mPTargetFwSocketHandler(tlm_utils::callback_binder_fw< TYPES > *cb)
Definition: tlm_base_handler.h:194
static TlmHandlerInterface * mPTargetBwSocketHandler(tlm_utils::callback_binder_fw< TYPES > *cb)
Definition: tlm_base_handler.h:204
static TlmHandlerInterface * mPInitiatorFwMpSocketHandler(tlm::tlm_fw_transport_if< TYPES > *socket)
Definition: tlm_base_handler.h:179
static TlmHandlerInterface * initiatorBwSocketHandler(sc_core::sc_object *obj)
Definition: tlm_base_handler.h:126
Definition: tlm_handler_interface.h:26
Definition: b_transport_invoker.h:31
Definition: pci_bus_interface.h:24