Jump to content
wasim6691

TLM_READ_COMMAND NOT READING COMPLETE BUFFER

Recommended Posts

Hi

The TLM_READ_COMMAND IS NOT READING THE DATA ARRAY COMPLETELY. 

What can be the possible reason. I have allocated an array through malloc command in the memory module. and Then from the second module i am trying to read that array using the TLM_READ_COMMAND but the array is not being read completely and it stops in the mid somewhere. Just not running any further without showing any error. What can be possible reason for this . Thanks

Share this post


Link to post
Share on other sites

Without a minimal self-contained example exposing your problem, it is hard to give an answer to your question. Did you set besides the data pointer also the data length correctly in your instance of the TLM generic payload?

By the way, in C++ and SystemC, you should not use malloc() and free() to allocate/deallocate raw memory, Instead, you should prefer to use an appropriate container or C++'s new/delete operators as a last resort.

Share this post


Link to post
Share on other sites

I have defined a floating point array of 2528800 elements using Malloc( I will use new operator now). Now I am reading the array element through TLM_READ_COMMAND. It read the values correctly until 500 elements and then it stops reading further values and displaying no error message at all. Is that a memory problem or memory limitation problem? 

Share this post


Link to post
Share on other sites

You should set length to sizeof(Array).
Also, where are you locating the array? It should be static or allocated on the heap and not passed on the stack (e.g. automatic variables are located on the stack).

 

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

×