We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How to compute the Clock cycles per instruction for arm cortex R4 ?
is it straight forward as, CPI = clock cycle counter (computed using PMU) / Number of instruction executed (computed using PMU)
or CPI = (clock cycle counter + memory stall cycles)/number of instructions
Also it gives rises to another logical question whether the cycle counter counts number of clock cycles of CPU execution or it counts the basic reference clock to the SoC ?
When WFI instruction is executed whether the cycle counter increments or it will hold ??
I believe Pete is wrong on the last point. The cycle counter will stop incrementing while the processor is stand-by, from the ARMv7-A/R ARM:
C12.1.5 Interaction with power saving operations All counters are subject to any changes in clock frequency, including clock stopping caused by the WFI and WFE instructions.
C12.1.5 Interaction with power saving operations
All counters are subject to any changes in clock frequency, including clock stopping caused by the WFI and WFE instructions.
Thanks for correcting Martin - it makes sense when you think about it.