wasim6691 Posted January 22, 2018 Report Share Posted January 22, 2018 Hi I have to load a floating point data from the binary file and save it in an array inside the MODULE_1 (Memory) and then I wanted to transfer the content of that array from MODULE_1 to Another MODULE_2 (CACHE) through TLM. Can You guide me how to save an array in MODULE_1 (Memory) and transfer the floating point data to another MODULE_2 (Cache) through TLM. I am trying to read the data from CACHE to MEMORY but TLM_GENERIC_PAYLOAD does not access the correct memory address of the array elements to read from and therefore I am just reading some garbage value. A help through sample code is much appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
David Black Posted January 22, 2018 Report Share Posted January 22, 2018 Use member data for the memory. Assuming your two modules are endian and floating point compatible, you can just do a normal TLM transfer using a simple cast to a character array. If your original array is float, then you need to use sizeof to get the proper depth. You did not note whether this is AT or LT, but that should not matter. Quote Link to comment Share on other sites More sharing options...
wasim6691 Posted January 22, 2018 Author Report Share Posted January 22, 2018 Hi David In the memory module if use Dynamic Allocation for the Array then TLM transfer from one Module to Another Works. Otherwise TLM transfer does not work if just define the array like : mem[ i ] = data; where 0< i < 2528800. It may also cause stack overflow problem. Is dynamic Allocation for SHARED DRAM Memory ok ? Thanks. What Is meant by use MEMBER DATA for the memory ? 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.