CPU cycles

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CPU cycles

跳至解决方案
3,362 次查看
spa
Contributor I
Hello all,
I am using code warrior development environment for HC08 and HC12. When debugging the applications by means of the full chip simulator I can rget a feeling of the execution time by reading the amount of "CPU cycles" needed (in the register window).
By the way, are the "CPU cycles" corresponding to the number of clocks required to run the application or shall I multiply the CPU cycles by a certain factor to get the number of CLOCK CYCLES?
If so, which are these factors for HC08, HCS08, HC12, HCS12?
Thank you very much...
Spa
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,527 次查看
CrasyCat
Specialist III
Hello
 
For HC12, HCS12 you can use the full chip simulator to get an idea of the execution time for a function or a portion of a function.
I would do it as follows:
  - Set a breakpoint at the beginning of the function.
  - run to that function
  - In the status bar (on the bottom of HI-WAVE window, double click on the cycle count. This will
    set the cycle count in the status bar to 0.
  - Point to the end of the function (or end of sequence you want to measure), click with right mouse button
    and select "Run to Cursor"
  - When application is stopped, you see the number of cycle needed to reach that instruction in the
    status bar.
Number of cycle there are number of CPU Cycles.
 
Note that for HC08 you cannot use the status bar:smileysad:.
You have to enable trace in the Trace component to get cycle counts.
 
CrasyCat

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,528 次查看
CrasyCat
Specialist III
Hello
 
For HC12, HCS12 you can use the full chip simulator to get an idea of the execution time for a function or a portion of a function.
I would do it as follows:
  - Set a breakpoint at the beginning of the function.
  - run to that function
  - In the status bar (on the bottom of HI-WAVE window, double click on the cycle count. This will
    set the cycle count in the status bar to 0.
  - Point to the end of the function (or end of sequence you want to measure), click with right mouse button
    and select "Run to Cursor"
  - When application is stopped, you see the number of cycle needed to reach that instruction in the
    status bar.
Number of cycle there are number of CPU Cycles.
 
Note that for HC08 you cannot use the status bar:smileysad:.
You have to enable trace in the Trace component to get cycle counts.
 
CrasyCat
0 项奖励
回复
1,527 次查看
spa
Contributor I
Hello,
thanks for your feedback! Do you also know how many clock cycles correspond to 1 CPU cycle for HC08, S08, RS08, HC12, HCS12?
Many thanks
Spa
0 项奖励
回复
1,527 次查看
CrasyCat
Specialist III
Hello
 
What do you mean with clock cycle? Do you mean bus cycles, oscillator cycles?
In any case, the conversion between CPU cycles and bus or oscillator cycles depends on your configuration (oscillator frequency, PPL settings, ....).
 
CrasyCat
0 项奖励
回复