Performance monitor events

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Performance monitor events

1,996件の閲覧回数
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

タグ(2)
9 返答(返信)

1,414件の閲覧回数
billie60
Contributor I

Hello! I met the same problem as yours. When I set PM registers used 'mtpmr' and 'mfpmr' the value to r3, r3 = 0. Do you remember how you solved this problem? Thank you so much! 

0 件の賞賛
返信

1,780件の閲覧回数
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 件の賞賛
返信

1,780件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

which device do you have exactly?

Regards,

Lukas

0 件の賞賛
返信

1,780件の閲覧回数
yuriy_serdyuk
Contributor III

Hello,

DEVKIT-MPC5748G (SPC5748GH)

Thank you

0 件の賞賛
返信

1,780件の閲覧回数
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 件の賞賛
返信

1,780件の閲覧回数
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 件の賞賛
返信

1,780件の閲覧回数
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

1,780件の閲覧回数
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 件の賞賛
返信

1,780件の閲覧回数
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 件の賞賛
返信