wasim6691 Posted January 23, 2018 Report Posted January 23, 2018 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 Quote
maehne Posted January 23, 2018 Report Posted January 23, 2018 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. David Black 1 Quote
wasim6691 Posted January 23, 2018 Author Report Posted January 23, 2018 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? Quote
David Black Posted January 23, 2018 Report Posted January 23, 2018 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). Quote
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.