Kasturi Patil Posted January 17, 2014 Report Share Posted January 17, 2014 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.. Quote Link to comment Share on other sites More sharing options...
kocha Posted January 17, 2014 Report Share Posted January 17, 2014 Hi, Kas IEEE1666-2011 : 16.3 Payload event queue Doesn't it become your support? Regards, Kocha Quote Link to comment Share on other sites More sharing options...
David Black Posted January 17, 2014 Report Share Posted January 17, 2014 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. Quote Link to comment Share on other sites More sharing options...
Kasturi Patil Posted January 18, 2014 Author Report Share Posted January 18, 2014 Thanx David it was helpful.. Quote Link to comment Share on other sites More sharing options...
Kasturi Patil Posted January 23, 2014 Author Report Share Posted January 23, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.