Jump to content

Is there a way to stub unused tlm sockets to avoid port not bound error


Recommended Posts

Hi Experts

Is there a way to stub unused tlm sockets to avoid port not bound error ?

In my top I have toomanymodules and thus too many tlm_initiator_sockets/tlm_traget_sockets. only some of them needs to be connected,not all

 

Is there a way (e.g.module which can be instantiated) which ensures default binding of unused ports

 

Thanks

 

Link to comment
Share on other sites

Since SystemC 2.1 (I think) it's been possible to set a port binding policy when creating a port. It is a template argument which defaults to SC_ONE_OR_MORE_BOUND, i.e. you must bind at least once. You can change it to SC_ZERO_OR_MORE_BOUND. See the LRM for details.

 

Another trick that is sometimes used is to instance dummy channels in the before_end_of_elaboration() callback, and bind them to any unbound ports.

 

regards

Alan

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

Hi Alain

In Systemc 2.3.1 if I left the following ports unbounded, I get elaboration error (Error: /OSCI_TLM-2/multi_socket: ERROR in instance memory_inst.AXI_Slave: Not bound to tlm_socket)

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;

But in 2.3.0, there were no elaboration error with that.

Thanks

Sumit

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...