Forum Discussion

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi allen01,

    I think u can use the "performance counter" that is a Nios II peripheral available in SOPC builder under extra utilities. There is also a documentation that explains its usage...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I used Nois I, does Nios I can also use "performance counter"? THX!

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Sorry,

    the drivers for the performance counter are defined for the HAL of Nios II. I think u can calculate your timing using a simple timer: starting it before your call, stoping at return of the call and reading the value of timer. You could also calculate first the offset timing for these operation: starting-stoping-reading timer, and subtract this value from the timing above...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Allen,

    I would suggest that the cycle count of the custom instruction is pretty much what the field "cycle count" in the custom instruction tab of th SOPC cpu wizard says. I verified this using a timer for the hw division in a NIOS I cpu.