Jump to content

Reading Data From Memory through TLM

Recommended Posts


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

Share this post

Link to post
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.


Share this post

Link to post
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 ?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now