This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: TIDL uses all of TIVX_MEM_INTERNAL_L3 heap

Part Number: TDA4VM


Hi,

I developed a C7X kernel that needs a bit of memory from TIVX_MEM_INTERNAL_L3. It runs fine in standalone, but tivxMemAlloc() fails when my kernel runs alongside TIDL. I added a print of tivxMemStats() in my kernel after failure and there are 0 bytes available in C7X L3!

[C7x_1 ] 1233482.518632 s: VX_ZONE_ERROR:[Allocate:132] Couldn't allocate m_myVariable for 7552 bytes!
[C7x_1 ] 1233482.518661 s: VX_ZONE_LOG:[Allocate:137] l3_stats.mem_size = 8159232, l3_stats.free_size = 0

After digging a bit, I found that TIVX_MEM_INTERNAL_L3 is configured as APP_MEM_HEAP_FLAGS_TYPE_LINEAR_ALLOCATE in app_init.c, thus a quick tivxMemFree(nullptr, 0, TIVX_MEM_INTERNAL_L3) at beginning and end of my kernel should fix my conflict with TIDL. 

 

However, I also found this comment in ti-processor-sdk-rtos-j721e-evm-08_06_00_12/tiovx/source/platform/vision_sdk/bios/tivx_mem.c

case (vx_enum)TIVX_MEM_INTERNAL_L3:
/* In case of EVE, L3 memory correspond to one of the OCMC memory.
* We use hardcoded addresses because on EVE, only TI-DL use case needs allocation
* in OCMC and the TI_DL implementation assumes that the entire OCMC memory is available for its consumption.
* The only issue that can arise from using hard-coded address is in case On-the-fly capture from VIP is enabled
* because it also uses OCMC_1. However there is no use-case up-to-date that combines both TI-DL and OTF capture.
*/
So the question arises: Is it safe to use L3 while TIDL is running? Does it reinitialize L3 contents every frame?
Thanks,
Fred