cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Anonymous
Not applicable
18,656 Views

what is the difference between cache invalidate and cache flush?

If one function has updated variables that are cached, does it need to invalidate it or flush it?
For other functions that need to see the new values of the variables updated (and invalidated/flushed) by the first one, do they need to flush the cache or invalidate it when reading?
Thanks for help.

-Wenwei

0 Kudos
1 Reply
Highlighted
Xilinx Employee
Xilinx Employee
18,636 Views
Registered: ‎01-18-2008

See other thread for your specific case: It is probably not so much about caches, but more about volatiles.

 

A cache invalidate simply marks the cache contents as invalid. So the next time you access data, you will get what is in memory. A cache flush writes back data from cache into memory. These two will differ only when memory contents get out of sync with cache contents, which will happen only when you have DMA or a 2nd processor writing to the same memory location.

0 Kudos