Hi Paddu, I believe it is a 32-bit register (I found no mention of 64-bit registers in the c9 coprocessor). When it is overflown it resets to 0, in my code I take this into account. It looks like you can generate overflow interrupts (page 168 section 3.5.52) but I haven't used them.
Hope this helps. Regards, Luis On Monday, 10 March 2014 15:00:26 UTC, Paddu wrote: > > > Hi, > > Thank you for sharing very useful information. > With your suggestions currently I am able to read the Cycle count using > using this register. > Please let me ask more question about CCNT register. > > Just for the confirmation, I would like to know is this a 32 bit register? > or 64 bit? > and what would happen if the count value is overflown, will the register > reset to "0" ? > > Regards > Paddu. > > > On Tuesday, February 25, 2014 11:39:24 PM UTC+9, Luis wrote: >> >> 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/d/optout.
