code runs faster after CPC is disabled (T1040RDB)

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

code runs faster after CPC is disabled (T1040RDB)

662 Views
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 Kudos
4 Replies

442 Views
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 Kudos

442 Views
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 Kudos

442 Views
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 Kudos

442 Views
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 Kudos