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.

RM48L952 CCS profile clock

Other Parts Discussed in Thread: HALCOGEN

Hello,

Using the CCS profile clock to check execution time of code, shows that there are a lot of cycles needed per instruction

What do I miss?

CMP R12, #0

Breakpoint on this instruction -> reset profileclock -> "Assembly step into" -> Clock has 21 cycles

Or:

ADD R12, R12, #1

--> 17 cycles

Is this really true?

Code runs from flash

Thank you for your opinion.

Roger

  • It should not take that long. If there is no memory access, usually, it takes 1 or less than 1 cycles for one instruction in pipeline mode.

    The problem might be: By doing in your method, the flash pipeline and the CPU prefetch is kind of in-active in this breakpoint mode.

    What you can do is:

    put a bunch of instructions together and measure their performance. By doing this, you can see the benefit of the flash pipeline and CPU prefetch and sometimes two instruction can be executed in parallel.

    Regards,

    Haixiao

  • Thank you Haixiao for your answer!

    I will try what you mention. PLease give me a week to answer, I will not have the time to work on this until next week.

    In this context I checked the flash wait states and saw that HALCoGen sets data wait states to 4 (cannot be modified). The data sheet says that it needs 3 data wait states.

    What's correct now?

    Roger

  • Back after some tests...

    You were right! If I measure the cycles used of a whole function, the execution time seems to be ok. Stepping does not give accurate results.

    Thanks for the hint!