dcbf instruction use issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

dcbf instruction use issue

4,530 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
4 回复数

4,151 次查看
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 项奖励
回复

4,151 次查看
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 项奖励
回复

4,151 次查看
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 项奖励
回复

4,154 次查看
alexander_yakov
NXP Employee
NXP Employee

I do not see anything obviously incorrect in your code.

0 项奖励
回复