/* * tlm_rec_target_socket.h * * Created on: 08.11.2015 * Author: eyck */ #ifndef TLM_REC_INITIATOR_SOCKET_H_ #define TLM_REC_INITIATOR_SOCKET_H_ #include #include "tlm2_recorder.h" namespace scv4tlm { template class tlm_rec_initiator_socket: public tlm::tlm_initiator_socket { static std::string gen_name(const char* first, const char* second){ std::stringstream ss; ss< fw_interface_type; typedef tlm::tlm_bw_transport_if bw_interface_type; typedef sc_core::sc_port port_type; typedef sc_core::sc_export export_type; typedef tlm::tlm_base_target_socket_b base_target_socket_type; typedef tlm::tlm_base_initiator_socket_b base_type; tlm_rec_initiator_socket() : tlm::tlm_initiator_socket() ,recorder() { } explicit tlm_rec_initiator_socket(const char* name) : tlm::tlm_initiator_socket(name) ,recorder(gen_name(name, "rec").c_str()) { } virtual ~tlm_rec_initiator_socket(){} virtual const char* kind() const { return "tlm_rec_target_socket"; } // // Bind initiator socket to target socket // - Binds the port of the initiator socket to the export of the target // socket // - Binds the port of the target socket to the export of the initiator // socket // virtual void bind(base_target_socket_type& s) { // initiator.port -> target.export (this->get_base_port())(recorder); recorder.fw_port(s.get_base_interface()); // target.port -> initiator.export (s.get_base_port())(recorder); recorder.bw_port(this->get_base_interface()); } // // Bind initiator socket to initiator socket (hierarchical bind) // - Binds both the export and the port // virtual void bind(base_type& s){ // port (this->get_base_port())(recorder); recorder.fw_port(s.get_base_port()); // export (s.get_base_export())(recorder); recorder.bw_port(this->get_base_export()); } // // Bind interface to socket // - Binds the interface to the export of this socket // virtual void bind(bw_interface_type& ifs) { (this->get_base_export())(ifs); } void setExtensionRecording(tlm_extensions_recording_if* extensionRecording){ recorder.setExtensionRecording(extensionRecording); } protected: scv4tlm::tlm2_recorder recorder; }; } // namespace scv4tlm #endif /* TLM_REC_TARGET_SOCKET_H_ */