dcbf instruction use issue

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

dcbf instruction use issue

2,532 Views
quenreyn
Contributor III

Hi,

I used dcbf instruction to flush my data cache, but it seems that it did not work (I verified via a probe the content of the data cache).

In C, I created a variable:

int i = 0;

// then I call the next routine

FlushDataCache((int)&i, (int)(&i + DATA_CACHE_FLUSH_48K/4));

which is in assembly langage:

                                                      # r1 = start of shared region
                                                      # r2 = end of region

loop:

dcbf       0,r1                                  # flush line at address r1
addi       r1,r1,<line size in bytes> # point to next line
cmpw    r1,r2                                 # finished?
ble         loop

isync

msync

blr

 

I thought the dcbf instruction will find the D-cache according to i variable, and flush the line. I don't know what's wrong ?

 

Sorry to bother, thank you for your anwsers,

Quentin Reynard

Labels (1)
Tags (2)
0 Kudos
Reply
4 Replies

2,153 Views
quenreyn
Contributor III

My fundamental issue was that the address given to dcbf was not in cache.  
The reference manual says:

Perform reads to any 48 Kbyte region, THEN execute dcbf instruction

I now am searching for how to read the L1 data cache !

0 Kudos
Reply

2,153 Views
alexander_yakov
NXP Employee
NXP Employee

You said: "I verified via a probe the content of the data cache"

Please submit a screenshot of data cache contents, including cache tags, for two cases - before and after dcbf instruction execution.


Have a great day,
Alexander
TIC

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

0 Kudos
Reply

2,153 Views
quenreyn
Contributor III

Ok, I will do that.


Can you tell me if the parameter given to the function are ok ?

Thank you,

Quentin Reynard.

0 Kudos
Reply

2,156 Views
alexander_yakov
NXP Employee
NXP Employee

I do not see anything obviously incorrect in your code.

0 Kudos
Reply