Tool/software:
Hi:
I use static array with LFU, they don't perserve, why?

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.
Tool/software:
Hi:
I use static array with LFU, they don't perserve, why?

Hi Max,
I need some details/clarifications:
- looks like txQueue and rxQueue are static arrays defined in both int_comm_drv.c and meter_comm_drv.c?
- Which .c file does the code that is shown above correspond to?
- What compiler version was used?
- What compiler options/settings were used? (can you copy paste)
Thanks,
Sira
Hi Sira,
Here's some information for you
1.looks like txQueue and rxQueue are static arrays defined in both int_comm_drv.c and meter_comm_drv.c?
Ans: Yes.
2.Which .c file does the code that is shown above correspond to?
Ans: meter_comm_drv.c.
The code of int_comm_drv.c is similar to meter_comm_drv.c
3.What compiler version was used?

4.What compiler options/settings were used? (can you copy paste)




Max
Max,
I am referring to the lfu compiler settings. For example:
--lfu_default=preserve --lfu_reference_elf=C:\workspace_v12\buck_F28003x_lfu\BANK1_FLASH/../BANK0_FLASH/buck_F28003x_lfu.out
Sira:
Here's complier settings.

Q2: if I added new one element in array of const MeterRespCmdTable, the compilation error is reported:
#30014 Cannot preserve address of symbol MeterRespCmdTable due to size being greater than in reference ELF. New symbol size = 256 bits, while reference symbol size = 192 bits.
MeterRespCmdTable is const array table, should not the error. Right?
Max,
Can you please provide a testcase? Please refer to this article
https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_How-to-Submit-a-Compiler-Test-Case.html
Sira,
As aligned internally, kindly help work with compiler team to investigate it.
Keep posted on any update here, thanks.
Johnny
Johnny/Max,
Using the test case, I was able to reproduce the error with const MeterRespCmdTable changing size. I created a Jira for tracking the issue and will add link once it's available public. However, the issue is that the size check is being done incorrectly prior to where the compiler decides to avoid handling const variables as "preserve". So the only work around is to keep MeterRespCmdTable variable as same size or mark as attribute(update). This will be fixed in 22.6.2.LTS
Regarding the issue with txQueue/rxQueue, I cannot reproduce with the provided test case.
My reference build map file has:.bss 0 0000b000 00000196 UNINITIALIZED
0000b000 00000079 int_comm_app.obj (.bss)
0000b079 00000041 int_comm_drv.obj (.bss:rxQueue)
0000b0ba 00000041 meter_comm_drv.obj (.bss:rxQueue)
0000b0fb 00000041 int_comm_drv.obj (.bss:txQueue)
0000b13c 00000041 meter_comm_drv.obj (.bss:txQueue)
0000b17d 00000002 meter_comm_app.obj (.bss)
0000b17f 00000001 app_isr.obj (.bss)
And my lfu build map file has:.TI.bound:rxQueue
* 0 0000b079 00000117 UNINITIALIZED
0000b079 00000041 int_comm_drv.obj (.TI.bound:rxQueue)
0000b0ba 00000041 meter_comm_drv.obj (.TI.bound:rxQueue)
0000b0fb 00000041 int_comm_drv.obj (.TI.bound:txQueue)
0000b13c 00000041 meter_comm_drv.obj (.TI.bound:txQueue)
The only change I made to the project was to keep MeterRespCmdTable as same size so that the BANK2 lfu build would not error
Thanks
Greg
Here's the link to const size bug:
sir.ext.ti.com/.../EXT_EP-11935