Jump to content

Backwards generic_payload


Recommended Posts

Hello All,

 

I have some confusion on the usage of the generic payload on the backwards path (e.g. AT nb_transport usage).  At first glance, I would expect the target to re-use the generic_payload that it receives on the forward path.

 

However, I'm working with a model that creates a new generic_payload on the backwards path.  This makes things a bit strange, as I must keep the forward path generic_payload until the end of the transaction.  I've looked in the LRM to determine if creation of a new GP by the target is allowed, acceptable, encouraged, etc, but I'm not finding anything obvious.

 

Thanks in advance for comments!

 

In case there is confusion, here is some pseudo code:

 

              // initiator sc_module.  (Not using simple socket)

My_sc_thread() {

    tlm_generic_payload    gp;

    …

     cout <<" FW pointers: gp= "<<hex<<showbase<< (unsigned long long)(&gp) <<endl;

      out->nb_transport_fw(gp,ph,delay);

}

 

  virtual tlm_sync_enum nb_transport_bw(tlm_generic_payload &gp, tlm_phase &ph, sc_time &t)

{

     cout <<" BW pointers: gp= "<<hex<<showbase<< (unsigned long long)(&gp) <<endl;

     …

}

 

Output (simply showing the generic_payload pointer returned is not the one sent):

 

FW WRITE pointers: gp= 0x7fb4423e5e90     gp.get_data_ptr()= 0x7fb4423e5f40

BW WRITE pointers: gp= 0x774ee0                gp.get_data_ptr()= 0x761f40

Link to comment
Share on other sites

I would say that is not within the spirit of TLM2 approximately timed modelling. In particular 11.2.3.5 b )  in IEEE 1666-2011

 

 

If there are multiple calls to nb_transport associated with a given transaction instance, one and the
same transaction object shall be passed as an argument to every such call. In other words, a given
transaction instance shall be represented by a single transaction object.

 

Note that the use of nb_transport in the above quote is defined in 11.1.2.4 a) of the same document

 

There are two non-blocking transport methods, nb_transport_fw for use on the forward path, and
nb_transport_bw for use on the backward path. Aside from their names and calling direction these
two methods have similar semantics. In this document, the italicized term nb_transport is used to
describe both methods in situations where there is no need to distinguish between them.

 

regards

Alan

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