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 件の賞賛
返信