-
I have a 7-word program and the (32-entry 4-word direct-mapped) instruction cache for it gets "miss hit hit hit miss hit" for the first 6 cycles. The graph in Ripes for the hit rates (together with a table I made) is shown below: The calculation for the cumulative hit rate is straightforward, but I've spent a few days on it and I still cannot understand how the (50-cycle) moving average is calculated even after I looked at the source code.
Could you show me how the values in the last row of my table above were calculated? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Copy-pasting from 211a420 Moving average was calculated incorrectly, as shown in #251. I can't recall the exact reason for the old implementation, but my hunch is that i wanted the moving average to be able to be plotted in the "total hits/total access" configuration, which led to this notion of tracking last iteration differences etc. etc.. A moving average can now be achieved by setting "was hit / 1" as the configuration, and enabling the moving average (and disabling the "ratio" plot). I still think allowing a user to freely mix and max numerators and denominators to their liking is a good design descision, however, i could also easily imagine that some people wouldn't immediatly intuit themselves into the exact configuration needed for a moving average to show. Both of these features need a bit more work to be implemented correctly, so that will have to be in a separate, followup commit. |
Beta Was this translation helpful? Give feedback.
Copy-pasting from 211a420
Moving average was calculated incorrectly, as shown in #251. I can't recall the exact reason for the old implementation, but my hunch is that i wanted the moving average to be able to be plotted in the "total hits/total access" configuration, which led to this notion of tracking last iteration differences etc. etc..
However, this methodology is flawed to begin with, since the moving average (obviously, in hindsight) need to be calculated on a a range of "was cycle # a hit or miss" values across a given window.
A moving average can now be achieved by setting "was hit / 1" as the configuration, and enabling the moving average (and disabling the "ratio" plot). I sti…