This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use the performance monitor of Cortex-A9?

Hello experts,
I feel I am an amateur.
I tried to work the performance monitor of Cortex-A9 but it did not work.
The followings are my codes.
Please tell me what was wrong.

        mov     r3, #0
        mcr     15, 0, r3, cr9, cr12, {0} // PMCR PMU disable
        mov     r0, #0x11                 // Cycle Count
        mov     r3, #0
        mov     r2, #0
        mov     r0, #17
        mcr     15, 0, r2, cr9, cr12, {5}  // PMSELR PMC0
        mcr     15, 0, r3, cr9, cr13, {2}  // PMXEVCNTR0 zero clear
        mcr     15, 0, r0, cr9, cr13, {1}  // PMXEVTYPER0 event set
        mov     r0, #3                     // DCache Miss
        mov     r3, #1
        mcr     15, 0, r3, cr9, cr12, {5}  // PMSELR PMC1
        mov     r3, #0
        mcr     15, 0, r3, cr9, cr13, {2}  // PMXEVCNTR1 zero clear
        mcr     15, 0, r0, cr9, cr13, {1}  // PMXEVTYPER1 event set
        mov     r3, #0x8000003f 
        mcr     15, 0, r3, cr9, cr12, {1}  // PMCNTENSET all counters enable
        mcr     15, 0, r3, cr9, cr12, {3}  // PMOVSR overflow flags clear
        mov     r3, #1
        mcr     15, 0, r3, cr9, cr14, {0}  // PMUSERENR User mode enable
        mov     r3, #7
        mcr     15, 0, r3, cr9, cr12, {0}  // PMCR PMU enable
        <<Target Program to be measured the performance >>
        mov     r3, #0
        mcr     15, 0, r3, cr9, cr12, {0}  // PMCR PMU disable
        mov     r0, #0
        mcr     15, 0, r0, cr9, cr12, {5}  // PMSELR PMC0
        mrc     15, 0, r0, cr9, cr13, {2}  // PMXEVCNTR0 read
        << the r0 value is 0!!>>
        mov     r0, #1
        mcr     15, 0, r0, cr9, cr12, {5}  // PMSELR PMC1
        mrc     15, 0, r0, cr9, cr13, {2}  // PMXEVCNTR1 read
       << the r0 value is 0!!>>

Thank you and best regards,
Yasuhiko Koumoto.

0