Jump to content

Connect Socket to Empty Connection


Recommended Posts

I have a class that has two socket members (target and initator):
 

    // input (target)
    tlm_utils::simple_target_socket<class my_class> m_in;
    // output (initator)
    tlm_utils::simple_initiator_socket<class my_class> m_out;


I wish to connect only one side each instance (m_in or m_out), 
how can I connect the other side to a NULL / EMPTY connection?

Thanks 

Link to comment
Share on other sites

I used before_end_of_elaboration to bind to a dummy:

void  before_end_of_elaboration(){
    if ( my_initiator_socket.size() == 0 ) {
        target* dummy = new target("my_initiator_socket_name");
        my_initiator_socket.bind(*dummy);
    }

    if ( my_target_socket.size() == 0 ) {
        initator* dummy = new target("my_target_socket_name");
        my_target_socket.bind(*dummy);
    }

}

 

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.

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