Hi Paddu,

The Cortex-A8 has a Performance Monitor Control Register (coprocessor c9), 
you can check the documentation for the registers here (page 154, section 
3.2.42):
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0344k/DDI0344K_cortex_a8_r3p2_trm.pdf

For a simple example of the code check this page: 
http://stackoverflow.com/questions/3247373/how-to-measure-program-execution-time-in-arm-cortex-a8-processor
In there they use assembly to configure and read the registers for the 
Cortex-A8, so it can be ported to any OS I believe.

The Peformance Monitoring Unit is very cool, there's a ton of events you 
can measure there, you can record up to 5 events (including the Clock 
Cycles CCNT).


If you were using Linux it already has the implementation done for you, you 
only need some libraries (found in http://perfmon2.sourceforge.net/hw.html
 ).

Hope this helps.

Best Regards,

Luis

On Tuesday, 25 February 2014 03:02:31 UTC, Paddu wrote:
>
> Thank all for the kind reply.
>
> @liyaoshi-> I could find the link you have mentioned. 
>
> @Grissiom -> Currently we are not using Linux, we are using Starterware.
>
> I shall see if we could implement this using a ASM code.
>
>
> On Tuesday, February 25, 2014 11:56:11 AM UTC+9, liyaoshi wrote:
>>
>> From this link , you can see 
>>
>> readtsc() means this only support on x86 ,tsc register is 64bit register 
>> and clock with main clock , on x86/64 this is can very precise
>>
>> On ARM, use generic PIT,(maybe you should write your own driver ) ,
>>
>> only limit is  almost PIT register is 32bit 
>>
>>
>> 2014-02-25 10:49 GMT+08:00 Grissiom <[email protected]>:
>>
>>> On Mon, Feb 24, 2014 at 10:26 PM, Paddu <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> We need some advice in measuring Beaglebone CPU(Cortex-A8) clock cycles.
>>>> Is there any way to measure the CPU cycles and use it inside the 
>>>> program?
>>>> I have heard about "ccnt" register but don't know how exactly could we 
>>>> use that in the program.
>>>> Please let me know if there is a reference or pointers on how to 
>>>> implement the code.
>>>>
>>>>
>>> Do you want to measure cycles in Linux program or baremetal program? If 
>>> you are on Linux, this link:
>>>
>>> http://halobates.de/modern-pmus-yokohama.pdf
>>>
>>> may help you. If not, read the PMU section in the ARM ARM.
>>>
>>> -- 
>>> Cheers,
>>> Grissiom 
>>>
>>> -- 
>>> For more options, visit http://beagleboard.org/discuss
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "BeagleBoard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to