Jump to content

Questions regarding generic payload queue


Recommended Posts

Hi,

 

I have designed a data packet class having data members as address, data pointer, burst length.. and so on. I created an sc_fifo for request and response for this packet. basically everything here is written in systemC. Can you please tell me how do i incorporate generic payload queue here and remove the sc_fifo so that i am able to convert the systemC code into TLM2.0 ..

 

P.s : Please reply ASAP thank you in advance.. 

Link to comment
Share on other sites

A cheap; albeit, imperfect, solution would be to put all elements except address, and burst information into the data portion (payload, checksums, and other decorations) of the generic payload (GP). Perhaps remove those elements (the ones already handled by GP), and then:

// CAVEAT EMPTOR: **UNTESTED**
#include <tlm>
...
Your_struct data;
tlm::tlm_generic_payload* gp;
gp = memory_manager.allocate();
gp->set_data_ptr(reinterpret_cast<unsigned char*>(&data));
gp->set_data_len(sizeof(data));
gp->set_address(address);
...

Alternately, you could use TLM 2.0 with your custom data structure, but it won't interoperate with other TLM components that don't know about your structure. If you are using TLM for a network application rather than the targeted memory mapped bus use case, then this approach might be valid. You can of course use TLM 2.0 extensions to put additional fields on the data, but this is certainly a less standard approach. The closer you come to using the GP unmodified, the more interoperable your TLM IP will be.

Link to comment
Share on other sites

Yet another question regarding the same..

 

If i have 

struct My_struct

{

addr

*data

buerst lenght

byte enable

R/w

tag

port_id

 

 

 

some inline functions

...

...

...

...

 

}

 

 

now how do I map These struct elements to to generic payload like

trans->set_command();

trans->set_address(???);  // map value of struct here

trans -> setdatapointer(???) // map values of struct element

....

..

similarly all the attributes/....

 

Thank you in advance.. I need to do these.. kindly help

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