Randy Suen Posted October 8, 2022 Report Share Posted October 8, 2022 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? Quote Link to comment Share on other sites More sharing options...
David Black Posted October 8, 2022 Report Share Posted October 8, 2022 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. Quote Link to comment Share on other sites More sharing options...
Randy Suen Posted October 9, 2022 Author Report Share Posted October 9, 2022 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? 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.