eTPU - Why ERBA is aligned to 512 bytes - MPC5746R

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

eTPU - Why ERBA is aligned to 512 bytes - MPC5746R

跳至解决方案
1,286 次查看
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 项奖励
回复
1 解答
1,234 次查看
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

在原帖中查看解决方案

4 回复数
1,235 次查看
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,227 次查看
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 项奖励
回复
1,219 次查看
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,243 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

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

Best regards,

Peter

0 项奖励
回复