I’m working on some timing-sensitive code (an interrupt-driven SPI driver) that’s suffering from glitches due to instruction cache fills. The first time my function runs, it pauses for ~13us, then for ~160us. The second time it runs fine. That sounds pretty clearly like an instruction cache fill. I can, of course, work with this…but it got me wondering.
Is there any way to count or trap I-cache misses in the FE310G? It’d be great to confirm my hunches when I see glitches like this, and down the road (when my code gets >16KB), I’m going to need to know when an unexpected I-cache miss glitches my routine.