This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Disabling PFU / instruction pre-fetch on Cortex-R4?

Hello,

I'm trying to find the proper way to disable PFU / instruction pre-fetch on an R4. System control register bit 12 might do the job, but it's not clear to me:

Determines if instructions can be cached at any available cache level:
0 = instruction caching disabled at all levels. This is the reset value.
1 = instruction caching enabled.

Does "instruction caching disabled at all levels" mean that PFU is disabled? I would guess not, because the TRM says "The PFU obtains instructions from the instruction cache, the TCMs, or from external memory".

If SCR bit 12 doesn't disable PFU, what's the proper way to completely disable instruction pre-fetch?

Thanks!

Parents
  • Thanks for the info. Suppose my application nominally executes out of flash. Flash diagnostic require that flash be completely idle during the diagnostic test. So, I might decide to execute the diagnostic routine out of RAM, when the routine completes I'll jump back to flash. If I don't disable PFU, then unwanted flash accesses can occur during the final N instructions of my diagnostic routine (where N is the effective PFU FIFO depth) when PFU follows the return instruction and starts pre-fetching from flash.

    If PFU can't be disabled, one simple solution is to pad the end of my routine with N NOPs. Any better ideas?

Reply
  • Thanks for the info. Suppose my application nominally executes out of flash. Flash diagnostic require that flash be completely idle during the diagnostic test. So, I might decide to execute the diagnostic routine out of RAM, when the routine completes I'll jump back to flash. If I don't disable PFU, then unwanted flash accesses can occur during the final N instructions of my diagnostic routine (where N is the effective PFU FIFO depth) when PFU follows the return instruction and starts pre-fetching from flash.

    If PFU can't be disabled, one simple solution is to pad the end of my routine with N NOPs. Any better ideas?

Children