Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

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.

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