Performance monitor events

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance monitor events

345 Views
yuriy_serdyuk
Contributor III

Hello,

I can't find information about EVENT configuration in PMC for e200z4 mpc. I want activate number of clocks. Can you help me.

pastedImage_1.png

Tags (2)
8 Replies

129 Views
yuriy_serdyuk
Contributor III

I try use this code for read processor cycles according this information about event  https://www.nxp.com/docs/en/reference-manual/e200z760RM.pdf and examples https://www.nxp.com/docs/en/application-note/AN4341.pdf

But it is not working getPMC16 got r3=0, Can you help me.

.global getPMC16UserMode
.globl getPMC16
.global disableCounters
.global enableCounters
.global enableCpuCounter
.global testPM

.align 4

getPMC16:
 mfpmr r3,16
 se_blr

getPMC16UserMode:
 mfpmr r3,0
 se_blr


disableCounters:
 e_lis r3,0x8000
 e_or2i r3,0x0000
 mtpmr 400, r3
 se_blr

enableCounters:
 e_lis r3,0x0000
 e_or2i r3,0x0000
 mtpmr 400, r3
 se_blr

enableCpuCounter:
 e_lis r3,0x0000
 e_or2i r3,0x0100
 mtpmr 144, r3
 se_blr

testPM:
 e_bl disableCounters
 e_bl enableCpuCounter
 e_bl enableCounters
 e_bl getPMC16
 e_nop
 e_nop
 e_bl getPMC16
 e_bl disableCounters
 se_blr
0 Kudos

129 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

which device do you have exactly?

Regards,

Lukas

0 Kudos

129 Views
yuriy_serdyuk
Contributor III

Hello,

DEVKIT-MPC5748G (SPC5748GH)

Thank you

0 Kudos

129 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

It looks like this is wrong:

enableCpuCounter:
     e_lis r3,0x0000
     e_or2i r3,0x0100
     mtpmr 144, r3
     se_blr

EVENT must be set to '1' if you want to count Processor Cycles. So, the value should be 0x00010000:

enableCpuCounter:
     e_lis r3,0x0001
     e_or2i r3,0x0000
     mtpmr 144, r3
     se_blr

If I do this modification in my debugger, I can see that the counter is working when I step some code.

By the way, what kind of debugger do you use? It may be necessary to change default settings. From Lauterbach debugger:

pastedImage_4.png

Regards,

Lukas

0 Kudos

129 Views
yuriy_serdyuk
Contributor III

Hi, 

It's not working. The problem stills, Unfortunately, i don't have Lauterbach debugger. i use OpenSDA. what i should write to EDBRAC0 register for activate performance monitor?

0 Kudos

129 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Yuriy,

I checked it using OpenSDA. The problem is that EDBRAC0 can't be changed in this debugger. Or I didn't find such option, at least.

The only way is to test this feature without debugger - send the results out using serial interface or something like that. It works as expected in normal mode when debugger is not attached.

Regards,

Lukas

129 Views
yuriy_serdyuk
Contributor III

Hi Lucas,

It's work without debugger with UART. 

I found description for EDBRAC0, but other architecture https://www.nxp.com/docs/en/reference-manual/E6500RM.pdf

pastedImage_1.png

initDbg:
 e_lis r3,0x4000
 e_or2i r3,0x0108
 mtspr 638,r3
 se_blr
‍‍‍‍‍‍‍‍‍‍‍

but have exception on mtspr, i suppose number of register is wrong 638. Do you have specification for e200z4?

0 Kudos

129 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

it's not possible to write this register by software:

pastedImage_1.png

Only debugger can do that. But such option must be implemented in the debugger - and this seems to be unavailable in S32DS debugger.

Regards,

Lukas

0 Kudos