rahuljn Posted December 4, 2014 Report Share Posted December 4, 2014 Hi guys I have some models written using tlm initiator/target sockets. In one of the model there are two target sockets abd there is one b_transport method. In this method is there a way to know on which socket context it is called Thank Rahul Quote Link to comment Share on other sites More sharing options...
apfitch Posted December 4, 2014 Report Share Posted December 4, 2014 Have a look at this thread http://forums.accellera.org/topic/1890-model-with-multiple-target-ports/ Alan Quote Link to comment Share on other sites More sharing options...
rahuljn Posted December 5, 2014 Author Report Share Posted December 5, 2014 Hi Alan Actually all of my models are based on tlm_initiator_socket/tlm_target_socket, and now I do not want to switched to tagged sockets. Is there some other way to provide this tagging in existing models. Thanks RahulJn Quote Link to comment Share on other sites More sharing options...
apfitch Posted December 5, 2014 Report Share Posted December 5, 2014 See the last two posts in that thread for some ideas, Alan Quote Link to comment Share on other sites More sharing options...
rahuljn Posted December 6, 2014 Author Report Share Posted December 6, 2014 Hi Alan, It is not much clear how to implement that. Can you please tell how to do that Thanks Quote Link to comment Share on other sites More sharing options...
apfitch Posted December 7, 2014 Report Share Posted December 7, 2014 Perhaps David's suggestion is easiest (the last post in that thread). Each time b_transport is called, you can look up the process handle in an array. If it exists, you know that's the same caller as before. If it doesn't exist, you know you're being called by a process you haven't seen before, so you can store the handle in the array. Alan Quote Link to comment Share on other sites More sharing options...
rahuljn Posted December 8, 2014 Author Report Share Posted December 8, 2014 Thanks Alain. but if I want to add tags for these sockets,how can I do that in existing modules without switching to tagged sockets. A pseudo code will be of great help. Thanks RahulJn Quote Link to comment Share on other sites More sharing options...
apfitch Posted December 8, 2014 Report Share Posted December 8, 2014 I thought my sentence *was* pseudo-code Let me re-write it... Inside b_transport if process handle exists in array I'm being called by someone I know about. Do whatever's appropriate for that initiator else store process handle in array Do whatever's appropriate for that initiator regards Alan Quote Link to comment Share on other sites More sharing options...
rahuljn Posted December 8, 2014 Author Report Share Posted December 8, 2014 Hi Alan Sorry to bother you again. Actually the process handle related solution was much clear to me. Sorry for the confusion. What I need, I want to add tags to my initiator_socket/target_sockets but without switching to tagged versions whcih are available in tlm_utils. I need some help to attach user specified ids to these sockets. A pseudo code will be of great help. Thanks RahulJn 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.