Jump to content
Sign in to follow this  
rahuljn

Tlm sockets

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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  

×