code runs faster after CPC is disabled (T1040RDB)

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

code runs faster after CPC is disabled (T1040RDB)

691件の閲覧回数
hv
Contributor II

I have an application that seems to run faster after I disabled CPC.  What's the explanation for that?  Does anyone have any ideas?  I would expect that the code would run slower, not faster.  Thanks!

0 件の賞賛
4 返答(返信)

471件の閲覧回数
alexander_yakov
NXP Employee
NXP Employee

Unfortunately, it is difficult to debug this situation "in general", without an information what your "code" is exactly doing and how exactly you are disabling CPC.

In general I think it is possible to imagine a situation, where disabling cache may give some performance benefit, however this is for very specific case. First what comes to mind is write-back vs write-through cache on write operations.


Have a great day,
Alexander

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛

471件の閲覧回数
hv
Contributor II

Thanks Alexander! I disabled the CPC by doing these steps based on the T1040RM document since u-boot already enabled CPC:

1. Clear all bits of CPCPARn (this prevents any new transactions from allocating into

the CPC) using write operation.

2. Flush the CPC using one of the two following methods:

• Harware flush: Set CPCCSR0[CPCFL] and wait for hardware to clear

CPCCSR0[CPCFL] by polling

• Software flush: perform a dcbf operation to each coherency granule mapped to

the memory target (that is, one dcbf for each 64 bytes).

3. Clear all lock bits by setting CPCCSR0[CPCLFC].

4. Wait for hardware to clear CPCCSR0[CPCLFC] using a polling loop.

5. Disable the CPC by clearing CPCCSR0[CPCE].

I was baffled because the code in question is pretty cache-intensive! So when it runs faster after L3 is disabled is very confusing! So any help is greatly appreciated!

0 件の賞賛

471件の閲覧回数
alexander_yakov
NXP Employee
NXP Employee

Do you agree with my concern that it is really difficult to debug the situation without an information what your "cache-intensive code" is exactly doing?

If you want to continue debugging this situation "in general", than I can suggest checking your platform frequency configuration (CPC is a part of platform) and check your CPC setting before disabling.

0 件の賞賛

471件の閲覧回数
hv
Contributor II

I agree. I was just hoping that someone on the forum might have some insights or experiences with cases like this.

Thanks!

0 件の賞賛