SumitK Posted December 27, 2016 Report Share Posted December 27, 2016 In one of my use case I have following ports in my module tlm_utils::multi_passthrough_initiator_socket<initiator, 32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> AXI_Master; tlm_utils::multi_passthrough_target_socket<initiator, 32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> AXI_Slave; These two ports are optional not bound at top level. For that I clearly specify the N=0 and POL=SC_ZERO_OR_MORE_BOUND. In systemc2.3.0, I didn't get any elaboration error with this use case but when I switch to systemc 2.3.1, I get the following errors Error: /OSCI_TLM-2/multi_socket: ERROR in instance memory_inst.AXI_Slave: Not bound to tlm_socket. In file: /usr2/pwcd/sw/systemc-2.3.1a/include/tlm_utils/multi_passthrough_target_socket.h:113 Is there some specific reason for this ? Is we can not keep such ports unconnected even with N=0 and POL=SC_ZERO_OR_MORE_BOUND. Thanks Sumit K Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted February 5, 2017 Report Share Posted February 5, 2017 Hi Sumit, even if the sockets are optional, you still need to bind at least one socket callback, right? Can you please check, that you actually do this? Greetings from Duisburg, Philipp Quote Link to comment Share on other sites More sharing options...
SumitK Posted February 15, 2017 Author Report Share Posted February 15, 2017 Hi Philipp The following code is working fine on 2.3.0 but giving port not bound error with 2.3.1. #include "tlm.h" #include "systemc.h" using namespace std; #include <tlm_utils/multi_passthrough_initiator_socket.h> #include <tlm_utils/multi_passthrough_target_socket.h> class initiator : public sc_module { private: public : tlm_utils::multi_passthrough_initiator_socket<initiator,32, tlm::tlm_base_protocol_types,0,::sc_core::SC_ZERO_OR_MORE_BOUND> AXI_Master; tlm_utils::multi_passthrough_target_socket<initiator,32, tlm::tlm_base_protocol_types,0,::sc_core::SC_ZERO_OR_MORE_BOUND> AXI_Slave; SC_HAS_PROCESS(initiator); initiator(sc_module_name name){ AXI_Slave.register_b_transport(this,&initiator::b_transport); AXI_Slave.register_transport_dbg(this,&initiator::transport_dbg); AXI_Slave.register_get_direct_mem_ptr(this,&initiator::get_direct_mem_ptr); AXI_Master.register_invalidate_direct_mem_ptr(this,&initiator::invalidate_direct_mem_ptr); SC_METHOD(run); } virtual tlm::tlm_sync_enum nb_transport_bw(int id,tlm::tlm_generic_payload &,tlm::tlm_phase &,sc_core::sc_time &){return tlm::TLM_ACCEPTED;} virtual void invalidate_direct_mem_ptr(int id,sc_dt::uint64 start_range,sc_dt::uint64 end_range){} virtual bool get_direct_mem_ptr(int id,tlm::tlm_generic_payload& trans,tlm::tlm_dmi& dmi_data){return false;} virtual unsigned int transport_dbg(int id,tlm::tlm_generic_payload& r){return 0;} void b_transport(int id,tlm::tlm_generic_payload& trans, sc_core::sc_time &t){} tlm::tlm_sync_enum nb_transport_fw(int id,tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_core::sc_time& t){return tlm::TLM_ACCEPTED;} void run(){} ~initiator(){} }; int sc_main(int argc, char** argv){ initiator* initiator_inst = new initiator("initiator_inst"); sc_start(0,SC_NS); return 0; } Quote Link to comment Share on other sites More sharing options...
SumitK Posted February 15, 2017 Author Report Share Posted February 15, 2017 On 2/5/2017 at 9:30 AM, Philipp A Hartmann said: Hi Sumit, even if the sockets are optional, you still need to bind at least one socket callback, right? Can you please check, that you actually do this? Greetings from Duisburg, Philipp Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted February 15, 2017 Report Share Posted February 15, 2017 Thanks for the reproducer, Sumit! This is indeed a regression compared to SystemC 2.3.0. I'll forward the issue to the SystemC Language Working Group. Greetings from Duisburg, Philipp deeku 1 Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted April 18, 2017 Report Share Posted April 18, 2017 Unfortunately, the fix for this issue didn't make it into the 2.3.2 public review release. But we have now a possible fix, which is under review for the final 2.3.2 release: In src/tlm_utils/multi_passthrough_target_socket.h, add the following lines before the loop in multi_passthrough_target_socket::end_of_elaboration(): // complete binding only if there has been a real bind bool unbound = (binders.size() == 1 && m_export_callback_created); // no call to get_base_interface has consumed the export - ignore if (unbound) return; Hope that helps, Philipp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.