what is the difference between the RPCMEM_FLAG_UNCACHED and RPCMEM_FLAG_CACHED when I allocate memory for DSP? can you tell me the details when I call the DSP function with memory address allocated with the two different parameters.
what is the difference between the RPCMEM_FLAG_UNCACHED and RPCMEM_FLAG_CACHED.
Posted: Sat, 2018-10-27 02:33
Hi,
The flags RPCMEM_FLAG_UNCACHED and RPCMEM_FLAG_CACHED are passed as second parameter to the function rpcmem_alloc(),
rpcmem_alloc(0, RPCMEM_HEAP_DEFAULT, len);
The second parameter, RPCMEM_FLAG_CACHED, means that the allocated memory will be cached.
To allocate an uncached buffer instead, use the RPCMEM_HEAP_UNCACHED parameter:
rpcmem_alloc(0, RPCMEM_HEAP_UNCACHED, len);
The reason for this optimization is that all cached buffers are shared across multiple processing units, so the cache coherency mechanism must be in place. Therefore, if you are certain the HLOS will not modify this allocated buffer other than during HVX processing, mark the memory buffer as uncached so that all mechanisms and related latencies will be circumvented.
For more reference, kindly look into the below document in the link
https://usermanual.wiki/Pdf/80N70392FASTRPCDEBUGGUIDE.399075392.pdf