Jump to content

Reading Data From Memory through TLM


Recommended Posts

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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 ?

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