Jump to content
yorkwar

Possible bug in tlm_utils::multi_passthrough_initiator_socket::before_end_of_elaboration()

Recommended Posts

Hi,

 

The code below in this function may be not appropriate.

    //get the interfaces bound to the top of the hierachical bind chain
    // NOTE: this could be the same socket if there is no hierachical bind
    m_used_sockets=get_hierarch_bind()->get_sockets();

IEEE-1666-2011 stated:

The  following  actions  may  be  performed  directly  or  indirectly  from  the  member  function
before_end_of_elaboration.
a) The instantiation of objects of class sc_module, sc_port, sc_export, sc_prim_channel.
B) The instantiation of objects of other classes derived from class sc_object.
c) Port binding.
d) Export binding.

 

In my case, I do some port binding in my sc_module's API of before_end_of_elaboration. Then, if tlm_utils::multi_passthrough_initiator_socket::before_end_of_elaboration() is called before the one in my sc_module, m_used_sockets may have the out-of-data of value. It still indicates that there's no binding for this socket. In fact, m_sockets really indicates that there's a binding now. Then subsequent usage of m_used_sockets may cause an error.

 

Share this post


Link to post
Share on other sites

I agree that this restriction is currently not mentioned explicitly in the standard. The only related part I've found is mentioned in IEEE 1666-2011, 16.1.4.4 (emphasis mine):

 

 

k) As for SystemC multi-ports, if size is called during elaboration and before the callback end_of_elaboration, the value returned is implementation-defined because the time at which port binding is completed is implementation-defined.

 

That said, I tend to agree that the preparation of the local callbacks can happen too early. I'll take this issue to the TLM Working Group for further discussion. Thanks for reporting!

 

Greetings from Duisburg,
  Philipp

Share this post


Link to post
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...