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

PMU in Cortex-A8 (OMAP 3530) - What am I doing wrong?

Note: This was originally posted on 1st June 2011 at http://forums.arm.com

I've been trying to use the PMU in the OMAP3530 (on a beagleboard) to do some profiling, but I don't seem to be able to get the 4 PMU counters to do anything - they always read 0. The cycle counter works well enough. Here's some disassembly from the code that I'm running:



...

;;    _setCounting(1)
ee19 1f1c    mrc  15, 0, r1, cr9, cr12, {0}
f041 0001    orr.w   r0, r1, #1
ee09 0f1c    mcr  15, 0, r0, cr9, cr12, {0}

;;    _resetClockCounter();
ee19 3f1c    mrc  15, 0, r3, cr9, cr12, {0}
f043 0704    orr.w   r7, r3, #4
ee09 7f1c    mcr  15, 0, r7, cr9, cr12, {0}

;;    _resetEventCounters();
ee19 6f1c    mrc  15, 0, r6, cr9, cr12, {0}
f046 0c02    orr.w   ip, r6, #2
ee09 cf1c    mcr  15, 0, ip, cr9, cr12, {0}

;;    _selectPerfCounter(0);
;;    _setPerfCounterFunction( count0func=0x8 );
2200            movs    r2, #0
ee09 2fbc    mcr  15, 0, r2, cr9, cr12, {5}
2108            movs    r1, #8
ee09 1f3d    mcr  15, 0, r1, cr9, cr13, {1}

;;    _selectPerfCounter(1);
;;    _setPerfCounterFunction( count1func=0xf );
2001            movs    r0, #1
ee09 0fbc    mcr  15, 0, r0, cr9, cr12, {5}
230f            movs    r3, #15
ee09 3f3d    mcr  15, 0, r3, cr9, cr13, {1}

;;    _selectPerfCounter(2);
;;    _setPerfCounterFunction( count2func=0x11 );
2702            movs    r7, #2
ee09 7fbc    mcr  15, 0, r7, cr9, cr12, {5}
2611            movs    r6, #17
ee09 6f3d    mcr  15, 0, r6, cr9, cr13, {1}

;;    _selectPerfCounter(3);
;;    _setPerfCounterFunction( count3func=0x40 );
2203            movs    r2, #3
ee09 2fbc    mcr  15, 0, r2, cr9, cr12, {5}
2140            movs    r1, #64 ; 0x40
ee09 1f3d    mcr  15, 0, r1, cr9, cr13, {1}

;;    _enableCounters(1, 1, 1, 1, 1);
200f            movs    r0, #15
f2c8 0000    movt    r0, #32768      ; 0x8000
ee09 0f3c    mcr  15, 0, r0, cr9, cr12, {1}

...


After this, when I read from the PMU registers, this is what I see:


PMNC:   41002001 
CNTENS: 8000000f       
CNTENC: 8000000f  
FLAG:   00000000  
CCNT:   0000009f 
PMCNT0: 00000000       
PMCNT1: 00000000       
PMCNT2: 00000000       
PMCNT3: 00000000       
USEREN: 00000001


Any ideas what I'm doing wrong here?
Parents Reply Children
No data