Sign in to follow this  
Followers 0
rahuljn

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

4 posts in this topic

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

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0