33.4.3 Cache Performance Monitoring

The Cortex-M cache controller includes a programmable 32-bit monitor counter. The monitor can be configured to count the number of clock cycles, the number of data hits or the number of instruction hits.

Use the following sequence to activate the counter:

  1. Configure the monitor counter by writing to the MODE field of the Monitor Configuration register (CMCC_MCFG).
  2. Enable the counter by writing a one to the MENABLE bit of the Monitor Enable register (CMCC_MEN).
  3. If required, clear the counter by writing a one to the SWRST bit of the Monitor Control register (CMCC_MCTRL).
  4. Check the value of the monitor counter by reading the EVENT_CNT field of the Monitor Status register (CMCC_MSR).