HPM: Hardware Performance Monitoring

Today’s @risc_v Tip:

Machine (M) mode supports hardware performance monitoring (HPM) with the following CSRs:

  • mcycle: number of clock cycles executed
  • minstret: number of instructions retired
  • mhpmcounter[3-31]: event counters
  • mhpmevent[3-31]: event selectors

Original Tweet