About Data/Code and TCM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

About Data/Code and TCM

1,702件の閲覧回数
yaoxingshan
Contributor II

As we all know, i.MX RT MCU has two TCMs (Tightly-Coupled Memory): D-TCM and I-TCM, although in fact they are both FlexRAM. In theory, data should be placed in D-TCM, and code/instructions should be placed in I-TCM.

In Using the i.MX RT FlexRAM, Application Note, Rev. 3, 01/2021, section 3.1.2.1.Code memory footprint, the example places the interrupt vector table and related routines in the I-TCM:

3.1.2.1.Code memory footprint

The interrupt vector table and a couple of critical interrupt service routines must be placed in the ITCM (a 64-bit single-cycle access memory can pre-fetch 64-bit, 4 x 16-bit, or 2 x 32-bit instructions) to speed up its execution time. The interrupt vectors and corresponding interrupt service routines take 46 kB of memory.

I'm wondering about this because I think the interrupt vector table should be classified as data, which would be more appropriate in the D-TCM. I can't understand why the example arranges memory this way. Is my thinking wrong?

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,697件の閲覧回数
jay_heng
NXP Employee
NXP Employee

Vector table contains all ISR function addresses, CPU fetches ISR function address to execute when interrupt come, ISR function address is not simple data.

0 件の賞賛
返信

1,692件の閲覧回数
yaoxingshan
Contributor II

So would it be faster to put the vector table on ITCM than on DTCM?

0 件の賞賛
返信

1,683件の閲覧回数
jay_heng
NXP Employee
NXP Employee

Not slower than DTCM at least

0 件の賞賛
返信

1,681件の閲覧回数
yaoxingshan
Contributor II

According to the description of the reference manual, the speed of ITCM and DTCM can be the same, but the interface is different (64-bit I-TCM interface and 2x 32-bit D-TCM interface).

There should be no performance advantage to place the vector table in ITCM, but it should be more appropriate to place the vector table in DTCM (I think special data is also data, the difference between instructions and data should be executable or not).

The only reason I can think of to put a vector table on the ITCM is for it to start at address 0 (which is where most traditional programs start).

0 件の賞賛
返信