I have a project where initialize the eTPU module calling:
1) fs_etpu_init(): reserve memory for all globals vars so in my case is in 0x0530 bytes offset.
2) fs_etpu2_init(): reserve memory for stack with ERBA. In the example downloaded from https://www.nxp.com/webapp/etpu/ it sets ECR_A.B.ERBA aligned with 512 bytes and reserves other 512 bytes for ECR_A.B.ERBB. But the size that i has with the command ::ETPUenginememsize in the IDE CWide is 0x144. It results that the pointer of free space begin in offset 0x0948 so i have 3768 bytes left.
Is possible to reduce the size of 512 bytes to the size of 0x144? It is not better to set the two ERBA int the start of the SDM?
Solved! Go to Solution.
I can't speak to why the engine memory alignment is 512 bytes (other than it makes address generation in the execution unit a simple concatenation), but I agree the "holes" caused by it can be wasteful of data memory:
It would require some additional code beyond the standard eTPU utility API, but it may be possible to fill some of the gaps with channel frames. Also, if all global data were to eliminated (or placed elsewhere in memory via explicit locating, possible with Ashware tools) the engine memory sections could be moved to 0x0000 and 0x0200 respectively.
I can't speak to why the engine memory alignment is 512 bytes (other than it makes address generation in the execution unit a simple concatenation), but I agree the "holes" caused by it can be wasteful of data memory:
It would require some additional code beyond the standard eTPU utility API, but it may be possible to fill some of the gaps with channel frames. Also, if all global data were to eliminated (or placed elsewhere in memory via explicit locating, possible with Ashware tools) the engine memory sections could be moved to 0x0000 and 0x0200 respectively.
Thanks for the response. The question about why is 512 bytes was because i see the point 43.14.9.1.1.4 from the Reference Manual and see that the SDM phsycal word address in Engine Relative Addressing mode is:
physical address = (ETPUECR[ERBA] << 7) + AID[6:0]
so i thought that is 128 bytes of alignment.
AID[6:0] is a word (4 bytes) address, not a byte address, so effectively references a space of 128 * 4 = 512 bytes.
Hello,
I was talking to eTPU expert, she will respond as soon as possible.
Best regards,
Peter