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
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 !
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!
-----------------------------------------------------------------------------------------------------------------------
Ok, I will do that.
Can you tell me if the parameter given to the function are ok ?
Thank you,
Quentin Reynard.
I do not see anything obviously incorrect in your code.