Jump to content

Generic payload and custom bytes/words


Recommended Posts

Hello,

I'm trying to develop a memory that supports custom bytes/words. In the usual case, the byte is 8bit and word has 4 bytes (assuming 32bit data-path). Now, in embedded, it's possible that the byte is 12bit and word has 2 bytes (24bit data-path). For 12/24 integers, I can use sc_uint<12> or sc_uint<24>. So, my question is: Is there any helper function that stores/loads a custom int into the generic payload? If not, are there any rules to follow?

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Zdenek,

  the template parameter to the various sockets represents the width of the bus, so you could change that to 12 from the default of 32. However the existing code does generally assume that 1 byte = 8 bits (e.g. the byte enables work with words split into 8 bit bytes). So you'd probably have to write some custom code,

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