Part Number: EVMK2H
Tool/software: TI C/C++ Compiler
When using C6000 compiler v8.2.2 to compile a SYS/BIOS 6.50.1.12 program for a C66 core in the SYS/BIOS .cfg file attempted to set the heap size to the following, which uses the majority of the 2Gbyte DDR3 region:
BIOS.heapSize = 0x7fe00000;
Which causes SYS/BIOS to generate the following array to allocate space for the heap in the SYS/BIOS generated configPkg/package/cfg/<project_name>_pe66.c source file:
/* --> ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A */ __T1_ti_sysbios_heaps_HeapMem_Instance_State__buf ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A[2145386496];
When the program was compiled no warnings were generated, but looking at the map file the size of the array for the heap has been truncated to 0x1fe00000 bytes rather than the size 0x7fe00000 specified in the source file:
.far 0 80000000 1fe00c08 UNINITIALIZED 80000000 1fe00000 (.common:ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A) 9fe00000 00000800 66AK2H14_C66_max_sysbios_heap_size_pe66.oe66 (.far:taskStackSection) 9fe00800 00000200 (.common:xdc_runtime_LoggerBuf_Instance_State_0_entryArr__A) 9fe00a00 00000200 (.common:xdc_runtime_SysMin_Module_State_0_outbuf__A) 9fe00c00 00000008 (.common:parmbuf)
Inspecting the size of the symbols in the object file, by using nm --print-size shows that the compiler has truncated the size of the ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A array.
I think this problem is the subject of open defect SDSCM00043877. Is it by design that the C6000 compiler truncates the size of objects >= 512Mbytes, or is it a bug?
The headline of SDSCM00043877 suggests the intended fix is to make the compiler emit a warning when the size of an object is truncated, rather that generate the requested object size.