![Qorivva MPC5 Series Manual Download Page 121](http://html1.mh-extra.com/html/qorivva/mpc5-series/mpc5-series_manual_3255432121.webp)
Qorivva MPC5xxx/SPC5xx Debugger and NEXUS Trace
121
©1989-2021 Lauterbach GmbH
Example 3
: Measure instructions per processor cycle for a specific task on an RTOS:
BMC.<counter>.FREEZE
Freeze counter in certain core states
Halts the selected performance counter if one or more of the enabled states (i.e. states set to ON) match the
current state of the core. If contradicting states are enabled (e.g. SUPERVISOR and USER), the counter will
be permanently frozen. The table below explains the meaning of the individual states.
;Measure instructions per clock for task my_task
BMC.RESet
Break.Delete
;set up counter start / stop events
&magic=TASK.MAGIC("my_task") ;get magic value for the task of interest
Break.Set task.config(magic) /ReadWrite /Onchip /Data &magic /Alpha
Break.Set task.config(magic) /ReadWrite /Onchip /Data
!
&magic /Beta
;set up CNT0 to count processor cycles (using start/stop event)
BMC.CNT0.EVENT PROC-CYC
BMC.CNT0.ATOB ON
;set up CNT1 to count instructions executed (using start/stop event)
BMC.CNT1.EVENT INST-CMP
BMC.CNT1.ATOB ON
;set up ratio for BMC.state window display
BMC.CNT1.RATIO X/CNT0
BMC.state
;run measurement (for 10 second)
BMC.Init
Go
Wait 10s
Break
PRINT FORMAT.FLOAT(5.,2.,1.0*BMC.COUNTER(1)/BMC.COUNTER(0))+" IPC"
Format:
BMC.
<counter>
.FREEZE
<state>
[
ON
|
OFF
]
<state>
:
USER
|
SUPERVISOR
|
MASKSET
|
MASKCLEAR
<state>
Dependency in core
USER
Counter frozen if MSR[PR]==1
SUPERVISOR
Counter frozen if MSR[PR]==0