Hello, I am using T2080QDS and VxWorks 653(3.x). I am developing a program that reads the cycle value using the performance monitor register.
I set the registers by referring to the documentation (E6500 reference manual and EREF, BookE).
Below is the register I set through "mtpmr" instruction.
- PMGC0: PRIME, CE
- PMLCa0: CE, EVENT(every cycle)
Then I tried to carry the value of PMC0. However, the program did not execute normally and stopped while setting the PMGC0 value(The program was terminated without reading the value at all). In the other E6500 family chipset (e200), reading the value of PMC0 was normal.
So I checked the manual and checked the Machine State Register (MSR).
I checked MSR with "mfmsr" instruction and GS was set to 1. In the guest-supervisor mode, GS and other values could not be modified(I tried to modify it with the "mtmsr" instruction but it was not possible to fix it.). The manual says to disable PMM of MSRP, which only seemed to be fixable in the hypervisor.
VxWorks 653 is a hypervisor-based operating system, the problem is I can not modify the hypervisor code.
Is there any way I can read PMC0 in my user application?
P.S. The other question is, when reading cycle from e200 core, there is an occasion that cache is enabled more cycles than disable state. Is it normal?