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.
Hi, experts
I am testing 280025 erad example1(erad_ex1_profile_function) , and enable CCS-run-clock option to measure delayFunction() clocks,
finally I find that the two result is quiet different.
cycle1 | cycle2 | cycle3 | cycle4 | cycle5 | |
cycles_Function | 30 | 33 | 49 | 65 | 81 |
cycles_Data | 21 | 24 | 40 | 56 | 72 |
run clocks | 45 | 55 | 71 | 87 | 103 |
I know cycles_Data is a little shorter than cycles_Function because of the different PC loacation.
but why cycles_Function is not same with CCS run clocks?
Hi Matt,
Can you provide some details on how did you use the runclock feature?
Have you kept breakpoints at the start and end of the function and measured the cycles in between? Or did you keep a breakpoint at the line where the function is called and measured the time for a stepover?
In the second case, there would be additional latency counted due to the branching, % operation etc.
ERAD measured cycles should match case 1. There could be slight difference of 1 or 2 cycles, because of the breakpoint (the CPU is halted and the pipeline might have been flushed out) ERAD measures the cycles in a non-intrusive way and should be more accurate compared to a breakpoint method
Regards,
Veena
Hi Veena,thank you for the reply.
my pre test is in the 2nd case:run to the line where the function is called and set run clock and then measure stepover clock number.
I tried the first case you mention as below:
the result is
cycle1 | cycle1 | cycle1 | cycle1 | cycle1 | |
run cycles case1 | 20 | 30 | 46 | 62 | 78 |
but in 280025 erad example1(erad_ex1_profile_function) , i think variable cycles_Function already contained the cycles of the function branching or % operation. variable cycles_Data only refers the running time from the start to the end part in the function.
case1 should be close to cycles_Data(the test results confirmed this inference), and case2 should be close to cycles_Function(the result is quiet different).
Is there something I misunderstood?
In case of ERAD, we are measuring the duration between the events PC = start of ISR and PC = end of ISR. So the branching latency will not be counted here (Cycles for the LCR and LRETR instructions). Also the % operation is not included, because it happens before branching to the function
case 1 should match cycles_Function. Both measures the cycles between the events PC = start of ISR and PC = end of ISR. But there could be slight difference in the cycles due to the usage of breakpoint.
Regards,
Veena