eTPU - Why ERBA is aligned to 512 bytes - MPC5746R

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eTPU - Why ERBA is aligned to 512 bytes - MPC5746R

Jump to solution
1,353 Views
demian91
Contributor III

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?

0 Kudos
Reply
1 Solution
1,301 Views
johndiener
Contributor IV

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:

johndiener_0-1639411989009.png

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.

 

John Diener

View solution in original post

4 Replies
1,302 Views
johndiener
Contributor IV

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:

johndiener_0-1639411989009.png

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.

 

John Diener
1,294 Views
demian91
Contributor III

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.

0 Kudos
Reply
1,286 Views
johndiener
Contributor IV

AID[6:0] is a word (4 bytes) address, not a byte address, so effectively references a space of 128 * 4 = 512 bytes.

 

John Diener
1,310 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I was talking to eTPU expert, she will respond as soon as possible.

Best regards,

Peter

0 Kudos
Reply