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

Cycle count in cortex m3

Note: This was originally posted on 10th December 2009 at http://forums.arm.com

Hi all,
I am new to cortex m3...
For my application I need to calculate the number of cycles for a particular function....
I set the debug options as high optimization level and optimize for time....

How can I calculate the MIPS/cycles manually for a particular function.
Please suggest me a solution...

Thanks in advance.
Krish.
Parents
  • Note: This was originally posted on 11th December 2009 at http://forums.arm.com

    Thanks Marcus,

    so we can access the DWT only by connecting the board?
    I tried like this but did not work....

    int count = 0;
    int *DWT_CPICNT = (int *)0xE0001008; //address of the register
    *DWT_CPICNT = 0; // reset the counter
    .......
    ......
    count = *DWT_CPICNT;

    can you please suggest me how to access the DWT unit without the board?

    Thanks & regards,
    Krish.
Reply
  • Note: This was originally posted on 11th December 2009 at http://forums.arm.com

    Thanks Marcus,

    so we can access the DWT only by connecting the board?
    I tried like this but did not work....

    int count = 0;
    int *DWT_CPICNT = (int *)0xE0001008; //address of the register
    *DWT_CPICNT = 0; // reset the counter
    .......
    ......
    count = *DWT_CPICNT;

    can you please suggest me how to access the DWT unit without the board?

    Thanks & regards,
    Krish.
Children
No data