English
Language : 

SH-2A Datasheet, PDF (489/501 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperH™ RISC engine Family
Section 8 Pipeline Operation
8.10 Simple Method of Calculating Required Number of Clock Cycles
A simple method of calculating required number of clock cycles is described below. This method
provides a rough approximation, but it allows the user to calculate the number of clock cycles
needed to execute the target instruction string.
The calculation is based on the following rules.
(1) The instructions are assumed to already have been fetched, so fetch time is not taken into
consideration.
(2) The 32-bit instructions operate in “execution state” cycles.
(3) If resource contention occurs, the previously issued instructions operate in “execution state”
cycles. Parallel execution of subsequent instructions is not possible.
(4) If the result from the previously issued instruction is used by the instruction that immediately
follows, the calculation assumes that the previously issued instruction will require “latency”
cycles.
(5) If the result from the previously issued instruction is not used by the instruction that
immediately follows, the calculation assumes that the previously issued instruction will require
“execution state” cycles.
(6) Correction for parallel execution is performed in simplified form as a compensation item.
There are a large number of exceptional cases, so the calculation method introduced here cannot
be 100% accurate. It does allow the user to obtain a rough idea of the number of clock cycles that
will be required, however. Examples are provided below.
1. Counting Latency Cycles
MOV.L
ADD
MOV.L
@ R1, R0
# imm, R0
R0, @ R1
↔
↔
ID
—
↔
EX
—
—
↔
MA
ID
↔
WB
EX
ID
↔
EX
↔
MA
↔
Cycles
2
1
The result from MOV.L, which precedes ADD, will be used, so the calculation assumes that
MOV.L will require “latency” cycles (two cycles) to execute. The next MOV.L instruction uses
the result from ADD, so the calculation assumes that the ADD instruction will require “latency”
execution (one cycle).
Rev. 3.00 Jul 08, 2005 page 475 of 484
REJ09B0051-0300