Professional Documents
Culture Documents
on
Clocks in PrimeTime
October 1999
0
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
TABLE OF CONTENTS
Topic Page
Introduction ............................................................................2
PrimeTime Commands & Variables Related to Clocks: ...........3
List of All Clock Commands with Examples: ........................3
List of Environment Variables Related to Clocks ................10
Clock Commands in Action ...................................................13
set_clock_latency on a Pin vs. Clock ..................................15
set_clock_uncertainty on Pin vs. Clock ...............................17
Generated Clocks .................................................................18
PLLs (Phase Locked Loop) ...............................................18
Generated Propagated Clocks ............................................25
Multiple Clock Domains ........................................................26
Common Base Period Expansion.........................................26
Tips for Multi-Frequency Analysis: ......................................27
Asynchronous Clock Domains ............................................28
Inter-Clock skew ...............................................................29
Pre/Post Layout Clock Issues ................................................29
Ideal Clocks (Pre-layout) ...................................................29
Propagated Clocks (Clock Trees) ......................................30
SDF back annotated Clock tree .........................................31
Collapsed Tree: ( Ex:Toshiba, TI) .......................................31
Full Tree: (Ex: LSI, Lucent) ................................................31
Overriding Clock Net Delays .............................................31
How to Create a Clock on a Net .......................................32
Clock Issues Related to Min/Max timing ...............................33
Clock Reconvergence Adjustment .....................................33
Tester Skew ......................................................................34
Off-Chip skew modeling ....................................................34
Differences between DC and PT clocking .............................38
How to achieve correlation ................................................38
1
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Introduction
2
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
0 5 10 15 20
Figure 1 create_clock command
3
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
1 2 3 4 5 6 7
CLK
DIV_2
CLK
CLK with
uncertainty
4
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Propagation delay
Clock
Clock with
propagated
delay.
CLK1
CLK1 with
Latency
5
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
CLK1 with PT
calculated
transition
CLK1 with
user-asserted
transition
0.38 0.25
Figure 6 Specifying clock transition
• get_clocks: Creates a collection of selected clocks from the current design.
You can assign these clocks to a variable or pass them into another
command.
Example: The following example sets a rise clock transition of 0.38 on
all registers clocked by "CLK1".
• all_clocks: Creates a collection of all clocks in the current design. You can
assign these clocks to a variable or pass them into another command.
Example: The following example applies the set_propagated_clock command
to all clocks in the design.
6
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
7
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Latency
CLK1 with
Latency
Latency
removed
CLK1 with
user-asserted
transition
CLK1 with PT
calculated
transition
Figure 8 Removing clock transition
8
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
UNCERTAINTY
CLK with
uncertainty
uncertainty
removed
Propagation delay
Clock with
propagated
delay.
Propagation
delay removed
9
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Attributes:
p - propagated_clock
G - Generated clock
• timing_clock_reconvergence_pessimism
Values: “same_transition” or “normal” Default: “normal”
10
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
• timing_disable_clock_gating_checks
Values: “true” or “false” Default: “false”
When true, disables clock-gating setup and hold checks. When false (the default),
PrimeTime automatically determines clock-gating and performs setup and hold
checks on the gating input pin with respect to the clock input. By default
PrimeTime uses a “0” setup and “0” hold requirement for a clock gating check.
If you wish to override this default value, you can use the set_clock_gating_check
-setup / -hold command.
• timing_ideal_clock_zero_default_transition
Values: “true” or “false” Default: “true”
Specifies a transition value to use at clock pins of a flip-flop. When true (the
default), PrimeTime uses a zero transition value for all clocks. When false,
PrimeTime uses a propagated transition value for all clocks.
Also, the set_clock_transition command will override both the zero transition
value assigned to a clock pin by this variable as well as any calcualted transition
time if propagated clocks are used.
11
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
• timing_input_port_clock_shift_one_cycle
Values: “true” or “false” Default: “false”
Affects the behavior of PrimeTime when timing a path from an input port with no
clocked input external delay. When true, paths starting at such input ports are
given one extra cycle (set_multicycle_path 2) to meet timing constraints at
clocked destination registers or output ports. This behavior parallels Design
Compiler. When false, no extra multicycle shift is applied.
• timing_input_port_default_clock
Values: “true” or “false” Default: “true”
This environment variable affects the behavior of PrimeTime when timing a path
from an input port with no clocked input external delay. When true, all such input
ports are given one imaginary clock so that the inputs are constrained. The period
of the imaginary clock will be set by PrimeTime to be the common base period
of all clocks created in the design. This also causes the clocks along the paths
driven by these input ports to become related. When false, no such imaginary
clock is assumed.
Note: It is highly recommended that the user set the proper input delays with
respect to the appropriate clocks rather than relying on PrimeTime to do this
automatically. This will insure that the input delay is defined with respect to
the correct clock period rather than the common base period of all clocks in
the design.
• timing_clock_gating_propagate_enable
Values: “true” or “false” Default: “true”
This is an old environment variable that should always be set to true. It is kept
in PrimeTime for backwards compatibility reasons.
When true (the default), PrimeTime allows the delay from the data line of the
gating check to propagate. When false, PrimeTime blocks the delay from the
data line of the gating check from propagating; only the delay from the clock line
is propagated.
12
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
D Q
BUF1
CLK
BUF2
FF1
set_clock_latency -source
-late
set_propagated_clock
-early
used if the clock buffers are present (post layout)
(also called insertion delay) set_clock_transition
OR
Late Skew
Overrides the calculated
set_clock_latency
Early Skew transition time. Useful
+ in pre-layout designs.
CLK
1 2 3
set_clock_uncertainty
used if the clock buffers are not present to
estimate the delay through the buffers (pre-layout)
The diagram above illustrates the different clock commands and how they interact
in PrimeTime.
• The “create_clock” command defines the basic clock. The rest of the clock
commands modify this clock definition by adding uncertainty, phase shift etc..
• The “set_clock_uncertainty” command defines the +/- uncertainty (-hold or
-setup). If the -hold/-setup modifiers are not specified, the uncertainty will
be symmetric. This command is used to model both the jitter (i.e. clock
crystal jitter) as well as estimated clock skew in pre-layout desings. In post
layout designs where the clock tree exists, the “set_propagated_clock”
command should be used instead of the estimated clock skew uncertainty.
13
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
For example, if a CLK_1 has 0.2 ns of crystal jitter and an estimated 0.4 ns of
estimated clock tree skew then:
Post Laout: Use propagated clocks and an uncertainty value of 0.2 for jitter.
14
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
For clocks that are not used as references for set_input_delay constraints, it does
not make a difference whether latency is defined on the clock or a Part/Pin.
For example, in the circuit below, say we define a clock latency of 0.40 on the
clock “CLK” by executing the following commands:
15
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
IN1 D Q
A Z
CLK CP
BUF1
FF1
**********************************
Startpoint: J_01 (input port clocked by CLK)
Endpoint: I4 (rising edge-triggered flip-flop clocked by CLK)
Path Group: CLK
Path Type: max
As can be seen from the report above, the 0.40 latency showed up in both the
clock path as well as data path causing a violation.
16
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
**********************************
Startpoint: J_01 (input port clocked by CLK)
Endpoint: I4 (rising edge-triggered flip-flop clocked by CLK)
Path Group: CLK
Path Type: max
In this case, the latency only showed up the clock path resulting in a different
slack value.
17
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Generated Clocks
The circuit diagram below shows a simplified example of a PLL. In this ASIC,
the phase of a skewed feedback signal (CLKF) is dynamically adjusted so it
matches the phase of an input reference signal (RCLK). In other words, the PLL
shifts the feedback signal (CLKF) in the time domain so it rises at the same time
as the reference (RCLK). The resulting signal (CLKI) is said to be “locked” in
phase with the reference signal. The latecny due to the Clock tree is therefore
removed and is not seen by FF1 & FF2.
CLKF
i_clk
CLKI o_clk
Internal Clock
Reference RCLK Clock
Clock Tree
PLL
ASIC
18
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
PrimeTime, being an STA tool does not have the capability to properly analyze
PLLs automatically. In other words, if you were to create a clock at the reference
clock input to the ASIC above, the tool would not be able to calculate timing on
FF1 & FF2. The intenals of the PLL require dynamic simulation to be preperly
understood by a tool. PrimeTime treats a PLL as a black box.
Therefore, the clock waveform must be defined by the user at the output pin
(CLKI) of the PLL. The create_generated_clock command is used to assert CLKI.
Aside from creating a generated clock at the output of the PLL, there are three
other effects that need to be taken into account and modeled to properly analyze
PLLs in PrimeTime:
Jitter
PLLs intoduce additional error on the internal clock. Jitter is the amount by which
the internal, post PLL clock period can vary on consecutive cycles. This
uncertainty is a PLL spec that can be obtained from the ASIC vendor.
Offset
Offset is another specification of the PLL. It is the amount by which the internal,
post PLL clock (seen by FF1 & FF2) can lead or lag the PLL reference clock.
Insertion Delay
This is the delay between the ASIC reference clock and the mid point of the post
CTS clock tree. In pre-layout where clock tree does not exist, this delay is
estimated. Insertion Delay normally causes the internal clock to lag the external
clock. But the PLL does the job of removing the insertion delay by adjusting the
phase difference to match the phase of CLKI (feedback clock) to the phase of
RCLK (reference clock)
19
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
The clock in_clk is unaffected by jitter and offset. Therefore, while checking the
input path, only the internal clock (CLKI) has offset applied as latency and jitter
as uncertainty.
The internal clock (CLKI), on the other hand, is affected by both jitter and offset.
Therefore, jitter is applied as uncertainty on the internal clock and offset is applied
as latency, while checking internal paths.
Output paths are affected by jitter and offset, only on the source side (Clock of
FF2). But since Primetime does not apply uncertainty to the clock of the source
register (only to the destination register’s clock) it is necessary to apply it at the
destination clock, out_clk, while checking output paths. Therefore, latency offset
as well as uncertainty jitter is applied to the external clock feeding FF3 (o_clk).
Clock tree skew plays a role in prelayout analysis only. It is applied as uncertainty
on the internal clock (CLKI). It also has to be applied on the output clock (o_clk)
since PrimeTime does account for the uncertainty .
20
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
While doing hold time checks on input paths, it is necessary to apply the jitter
and offset effects on the internal clock, but this will then also affect hold time
checks on internal paths, unfairly. Therefore, instead of delaying the internal clock
by the jitter and offset value, the equivalent effect is achieved by keeping the
capture edge of internal clock constant and shifting the inputs earlier by an
amount equal to the jitter and offset. While doing setup check, the jitter value has
already been applied to internal clock and so only offset value needs to be added
to the maximum input delay to get the latest input arrival time.
21
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
#Input Delays
set_input_delay -clock i_clk -min $dly1 IPORT_A
set_input_delay -clock i_clk -max $dly2 IPORT_A
#Output Delays
set_output_delay -clock o_clk -min $output_hold OUT_A
set_output_delay -clock o_clk -max $output_setup OUT_A
22
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Gated Clocks
Gated clocks cause “glitches” or “clipped clocks” respectively if:
• The gating signal does not become active before the controling clock
edge
• The gating signal becomes inactive before the non-contorling clock
edge
The figure below illustrates these two problems:
CLK
GATE
GATED_CLK
To disable clock gating checks completely, you can set the environment variable:
timing_disable_clock_gating_checks to "true"
23
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Derived Clocks
PrimeTime allows you to define derived clocks by dividing or multiplying existing
clocks. To specify a clock derived from an existing clock use the following
command:
-divide_by divide_factor
-multiply_by multiply_factor
-edges {edge_list}
edge list corresponds to the edges of the original clock.
Example:
create_generated_clock -edges {1 2 5} \
-source CLK [get_pins DIV_2]
1 2 3 4 5 6 7
CLK
DIV_2
create_generated_clock -divide_by 2 \
-source sys_clk [get_pins FF1/Q]
create_generated_clock -multiply_by 3 \
-source sys_clock [get_pins div3/Q]
24
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
There are two ways to get around this issue. The best way is to add the generated
clocks to the propagated clock list:
25
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
If you have a register feeding another register and one period is 10 and another
is 10.1, the path is essentially asynchronous. The tool tries to determine the setup
requirement for this path by expanding both clocks to the base period and
determining the tightest single cycle relationship for setup. The common base
period for this case is 1010.0. Internally, the tool only approximates the base
period for the extreme cases, because the paths are not really synchronous. In
this case, it is best to explicity define these clock domains as asynchronous. See
the “Asynchronous Clock Domains” section for more info.
26
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Nearest common base period = 95 * 100 = 9500 (This is where the edges
line up.) (0, 100) (95, 100) (180, 200) ... (9405, 9500) (That’s 100 relationship
pairs.)
This means that PrimeTime must determine the most restrictive edge
relationship for setup and hold checks.
It is recommended that you avoid fractional clock periods like 100 ns vs. 100.0001
ns.
2) Generated internal clocks are preferred for PrimeTime, because you will have
to change only the period/waveform of the source clock to change the waveform
for the internal clocks. Also, this makes it easier for PrimeTime to associate the
clocks in the design, along with automatically deriving the delay from the source
clock to the generated clock.
The less desirable alternative is to create each of the individual clocks. In this
case, should the waveform/period change, you would have to change the
waveform/period of every internal clock. You would also have to manually specify
the skew between clocks. Another problem with this approach is that it will
increase your runtime because PrimeTime is not being told how the clocks are
associated.
27
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
3) If the design is post-layout, be sure that all of the clocks are propagated clocks.
Use the following:
set_propagated_clocks [all_clocks]
set_propagated_clocks [get_generated_clocks *]
Be sure you have specified all input/output delays with respect to a clock.
If there are any inputs that are not constrained with respect to a clock,
PrimeTime must compute the common base period for all clocks, EVEN if
they are asynchronous.
These commands tell PrimeTime not to analyze any data launched by CPUClk
and received by DotClk and vice-versa.
When there is larger number of asynchronous clock domains, this task becomes
tedious. SOLV-IT article “Static_Timing-137.html” contains a versatile TCL scripts
that simplifies asynchronous clock definition. Please refer to this article for further
details.
28
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Inter-Clock skew
You need to define skew values between clock domains when dealing with pre-
layout designs. In post-route designs, the propagated delays through the buffers
in the clock tree will take care of this skew, so this step is not needed. Setup,
hold, rise, and fall can be independently set for all skews. Use the
set_clock_uncertainty command to define this skew. In the example below, we
define a skew of 0.15 from clock Phi1 to clock Phi2 (note that a separated
set_clock_uncertainty command is needed to define skew from clock Phi2 to
clock Phi1).
D Q D Q
29
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Ideal
CLOCK
CLOCK with
Latency
+
Uncertainty
Uncertainty
Latency Transition
30
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Propagation delay
Clock
Clock with
propagated
delay.
31
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
The following script first identifies the fanout pins for all of the clocks - source
and generated - in the design, then finds the nets attached to these pins. It then
creates a collection of the fanin and fanout points of the nets. Finally, the
set_annotated_delay command is used to set a value (in this case 0) on all of
the nets connected between the startpoints and endpoints.
If the net has multiple drivers, one clock will be created by the script. However,
each of the driver pins and ports will be specified, creating a multi-source clock.
Please refer to the SOLV-IT article for further detail.
32
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
33
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Tester Skew
34
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
The challenge in defining the tester skew is making sure that skew reconvergence
is done properly. In the tester skew schematic below, the setup/hold check for
registers “n1_reg” and DOUT_reg need to account for tester skew since their
clock and data paths are either directly on indirectly dependent on different
primary inputs. “n2_reg” on the other hand, does not need a skew check because
its data path is indirectly dependent on the same primary input as its clock path.
DIN D Q D Q D Q
FD1 FD1 FD2
DOUT_reg
RESET
CLK Q
CLK2
It is very important to note that min/max skew analysis can only be performed in
PrimeTime when in “on_chip_variation” mode. Use the following command to
set the analysis in this mode:
35
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
Late Skew
Early Skew
CLK
1 2 3
To model skew on a data input signal, use the set_input delay command. For
example, say you need to model a -1.0/+2.0 skew on an input pin:
Late Skew
Early Skew
DATA
4 5 7
When reporting the setup/hold slack to n1_reg, PrimeTime will now add the +/-
1.0 skew to the clock path and the additional -1.0/+2.0 skew to the data path.
36
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
When reporting the setup/hold slack to n2_reg, however, you need to use the
“-remove_clock_reconvergence_pessimism” switch with the report_timing
command to have PrimeTime perform the clock reconvergence pessimism
correction discussed in the previous section. This will ensure that the additional
tester skew gets removed from the slack calculation. Below is an example of
report_timing using the “-remove_clock_reconvergence_pessimism” switch:
37
Synopsys Extensive Application Notes
Clocks in PrimeTime - October 1999
For the most part, the results of particular traces in DesignTime parallel that of
PrimeTime. There are situations, however, where the results might vary since
the two tools have been designed to perform two different tasks. If you need to
achieve timing correlation between Design Time and PrimeTime for a particular
trace, you need to set following environment variables in PT to simulate DT
behavior.
38