Jump to content
Ramarao V

What is the difference between set_data_length() and set_streaming_width() in tlm_generic_payload

Recommended Posts

You may check section 14.12 Data length attribute and '14.15 Streaming width attribute' in the LRM.

The first says:

Quote

For a read command or a write command, the target shall interpret the data length attribute as the number of bytes to be copied to or from the data array, inclusive of any bytes disabled by the byte enable attribute.

while the second states in paragraph 😄

Quote

Streaming affects the way a component should interpret the data array. A stream consists of a sequence of data transfers occurring on successive notional beats, each beat having the same start address as given by the generic payload address attribute. The streaming width attribute shall determine the width of the stream, that is, the number of bytes transferred on each beat. In other words, streaming affects the local address associated with each byte in the data array. In all other respects, the organization of the data array is unaffected by streaming.

 

Share this post


Link to post
Share on other sites

For ordinary memory transfers, you want the data length equal to the streaming width.

For FIFO-like transfers, you would set the streaming width to the width of the FIFO, which will be less than the data length.

Having a streaming length greater than the data length is somewhat pointless; however, it you don't want to think about it, using a value of UNINT_MAX (#include <climits>) is a great way of ensuring that streaming won't mess up the transaction.

The default constructed value of streaming width is zero and illegal.

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