Invalidate cache
Posted: Sat Aug 05, 2023 8:11 pm
I am trying to understand a way to invalidate the cache whenever i want to read some data from PSRAM.
for example.
byte *memory = (byte *)ps_malloc(1024*64);
loop:
memcpy(memory, memory, 1024);
goto loop:
The first access takes around ~600us and consequent memcpy takes only 80us. I think the value is loaded to the cache and the operation happens in the dcache rather than on the psram hardware. This is for a research purpose. so there is no practical need for this option.
but I want to know if i can disable the cache for such memcpy operation so the operation happens on the PSRAM directly and not through the cache. I dont care about the execution time. i want to have direct access to the psram without any cache.
xthal_dcache_line_invalidate() this has no effect
for example.
byte *memory = (byte *)ps_malloc(1024*64);
loop:
memcpy(memory, memory, 1024);
goto loop:
The first access takes around ~600us and consequent memcpy takes only 80us. I think the value is loaded to the cache and the operation happens in the dcache rather than on the psram hardware. This is for a research purpose. so there is no practical need for this option.
but I want to know if i can disable the cache for such memcpy operation so the operation happens on the PSRAM directly and not through the cache. I dont care about the execution time. i want to have direct access to the psram without any cache.
xthal_dcache_line_invalidate() this has no effect