Jump to content

How to implement b_transport method for two tlm_target_sockets in one module?

Recommended Posts

Hello everyone,

I have defined a module like this:

class module_a : public sc_module, public  tlm_fw_transport_if<>{

tlm_target_socket target_1;

tlm_target_socket target_2;


void b_transport(tlm_generic_payload& trans, sc_time& delay);


Here module_a has two tlm_target_sockets target_1 and target_2. Since tlm_target_sockets has no callback register, I have to implement the virtual function b_transport in the module definition for any initiator_sockets binded these target sockets. However, I wish target_1 and target_2 have different actions when b_transport is called. So Is there any way to implement two different b_transport methods for target_1 and target_2 respectively?

Link to comment
Share on other sites

5 hours ago, David Black said:

Use a TLM tagged socket from the utilities. There are several to choose from. They allow you to register the method of choice or you can use the tag to differentiate. 

Thanks Black.

What if I also need child-to-parent binding? Does it mean that multi_passtrough_target_socket is the only choice?


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.

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...