2 Replies Latest reply on Sep 27, 2011 9:20 AM by a.green

    collecting statistic every X cycles


      Dear all

      I want to run a program and every X cycles, collect some statistics (like branch mis predictions, cache hits...). Is this possible in codeanalyst or simnow?

        • collecting statistic every X cycles

          The Windows version of CodeAnalyst has an API.  You could use the counting functions (fnSetCountingEvent, fnGetEventCount, fnSetCountingConfiguration, fnGetCountingEventCount, and fnGetAllEventCounts) in a loop to get the number of events in each iteration.

          The events that would be of interest sound like 0x0c3 (retired mispredicted branch instructions), 0x040 (data cache accesses), and 0x041 (data cache misses).  If you also get the count of event 0x076 (unhalted clock cycles), you can determine how many cycles pass for each iteration.

          I hope this helps.