This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Execution time analysis



I have an application in which I set up the FRC so it will have an update period of 62.5ns based on my HCLK. When running the software under the debugger I am able to ascertain the number of FRC periods that have elapsed between breakpoints I set. Based on the FRC period this appears to give an accurate indication of what the actual execution time will be. Can you confirm that this is the case, or will the debugger use additional instructions which would mean a faster execution time for the release software?

Thanks.

  • Mark,

    I personally prefer to use FRC to measure execution time except for single instruction. If you want measure execution time for a single instruction you can use Cortex-R4 PMU event counter which has the resolution of CPU clock. I am attaching two files to show how to set up it and how to use it.

    6332.sys_pmu.asm

    4174.main_pmu.c

    Thanks and regards,

    Zhaohong

  • Hi Zhaohong, thank for your quick response.

    I am really only interesteed in overall execution time of my software, so going to instruction level won't be necessary.

    I just wanted to confirm that using FRC was an accurate and reliable way to do this and would be representative of the final execution times when software is compiled without debug options and not executed under control of the JTAG emulator.

    Mark.

  • Mark,

    Yes. FRC is a reliable way to measure execution time regardless of compiling option and JTAG control of execution. If you do not want use JTAG at all, you can also toggle an I/O pin and see it realtime on a scope.

    Thanks and regards,

    Zhaohong

  • Mark,

    So long as the compile with debug symbols is using the same optimizations as your release code, I would not expect a difference in execution time.  Take care though as some compilers may disable optimizations when compiling for a debug target.  What compiler and version are you using?

    Regards,

    Karl

  • Hi Zhaohong,

    I'd like to use FRC to measure execution time of a computation routine on RM57L LaunchPad. Could you do me a favor to provide a simple example with codes?