some questions about how to use performance monitor unit

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

some questions about how to use performance monitor unit

727 Views
billie60
Contributor I

Hello everyone.

I want to set a performance monitor interrupt with MPC5744P. But now I meet some questions that are beyond my comprehension. First, I initialized the performance monitor register in startup.s, as follows:

acb674f6b8c68c36e893f2bf5f7b98e.jpg

I set the monitoring event as the number of completed instructions, and immediately jump to the main function. I think the performance monitor counter can count after entering the main function, but it does not. I must reset my project then PMC seems can work. so this is my first question, why can't the counter automatically start counting after entering the main function, but wait until reset to count?

Then, after I reset the project, I found that the initial value of the counter I set is different, which also has a great impact on the result. When I set a large PMC initial value like 0x7fffffff or 0x7fffff00, this means that PMC will overflow and trigger an interrupt after running one or a few instructions. I got the result as follow:   (int flog7 = 0 and flog7++ in the interrupt response function)

454668b7576363146ebfd00b5df5c3d.jpg

The program cannot stop anywhere and when I suspend the code, I can see flog7 changed to 1 in the expression view.  

However,  when I set a small PMC initial value like 0x00000000, I press the reset button on the development board and run. I got this:

bd493c6c26e5d6889dd2858803e292a.jpg

I never set any breakpoint and when a = 306783369, my code stopped at the b++ line. At this time, I checked the assembly instruction set in the Disassembly window and found that a total of 0x80000000 instructions were run at this time. The PMC overflowed, but the program was only automatically interrupted and did not enter the interrupt processing function. When I resume my code, it will still run in the endless loop.  The result is similar when I set the initial value of PMC to 0x40000000.

I cannot understand why PMC can count must after reset, and I also cannot understand why I only change the PMC initial value and get different results without changing any other code. This is my project and I need your help. Please help me. Thank you very much.

Best Regards

0 Kudos
Reply
3 Replies

702 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi I will try to test it on my side if I am able, letting you know then.

0 Kudos
Reply

653 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

One yet note, some event working only with certain counters. There is a limitation it wasn't present in previous implementations.

It is only described in z4251n3 core reference manual, that is confidential proprietary document, I could send you directly only in case you have valid Non-Disclosure Agreement (NDA):

https://www.nxp.com/support/support:SUPPORTHOME

 

0 Kudos
Reply

657 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I just test it performance monitor in the TRACE32. It works fine. You may see graphical IDE and its representation in PMC registers.

davidtosenovjan_1-1662978340177.png

 

 

0 Kudos
Reply