Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / docxml2 / text / doc / hitas_user / stability_guidelines.xml
1 <?xml version="1.0" encoding="ISO-8859-1" ?>
2 <chapter>
3 <section niv='1'><title>Static Timing Analysis</title>
4
5
6
7 <section niv='2'><title>Performing the Analysis</title>
8 <p>The Static Timing Analysis (sometimes also referred to as Stability Analysis) is performed upon the UTD
9 timing database. The user must provide a timing constraints file, typically an SDC (Synopsys Design Constraints)
10 file, or its INF equivalent, which should at least provide the two following sets of information:</p>
11 <list>
12 <item>The definitions of all the external clocks and the global clock period.</item>
13 <item>Constraints specifications for the I/O connectors (corresponding to arrival and departures times).</item>
14 </list>
15 <p>For the first set of information, clock defintions can be specified with functions <f>create_clock</f>,
16 <f>create_generated_clock</f> and <f>set_clock_latency</f>.</p>
17 <p>For the second set of information, switching windows for the input connectors must
18 be specified with function <f>set_input_delay</f>. Switching window definition for the inputs is mandatory
19 to allow their propagation throughout the design. In addition, constraints on the
20 output connectors can be specified with the <f>set_output_delay</f> function.</p>
21 <p>The STA engine is invoked with the
22 function <f>stb</f>, taking as argument a pointer on the timing database (<f>TimingFigure</f> object).
23 A pointer on a <f>TimingFigure</f> object can be obtained as the
24 result of the <f>hitas</f> function. If the timing database has already been created and exists
25 on disk (DTX and STM files),
26 then a pointer on the <f>TimingFigure</f> object can be obtained with the <f>ttv_LoadSpecifiedTimingFigure</f> function. Here is an
27 example of the launch of the STA with a minimal set of constraints:</p>
28 <code>
29 <cl>set fig [ttv_LoadSpecifiedTimingFigure cpu]</cl>
30 <cl>inf_SetFigureName cpu</cl>
31 <cl>create_clock -period 900 -waveform {0 450} clk</cl>
32 <cl>set_input_delay -rise 850 -clock clk *</cl>
33 <cl>stb $fig</cl>
34 </code>
35
36 <p>The <f>stb</f> function first propagates the interface clocks onto the commands of the latches.
37 Then it propagates the switching windows defined on input connectors through the elements of the
38 database, either combinational or sequential, over one clock cycle.</p>
39 <p>When propagating through combinational elements (gates),
40 <f>stb</f> calculates the switching window on the gate's output by just summing up the gate's intrinsic
41 delays to the switching window on its inputs. Depending on the kind of analysis, detailed or not,
42 (<f>stbDetailedAnalysis</f>), the tool merges or not disjoint switching windows on the gate's output (see
43 diagram below). Detailed analysis has no impact on setup/hold calculations but is mandatory in
44 subsequent crosstalk analysis</p>
45 <p>When propagating through sequential elements (latches or precharges), the tool calculates the
46 switching window on the latch's output by propagating the switching window on its input, with regard to
47 the arrival times of the clock on the latch.</p>
48
49 <p>Once the <f>stb</f> function terminates, the timing database is annotated with stability information, i.e.
50 each reference point of the database (I/O connectors, latches, commands, precharge) is annotated with its
51 propagated switching window.</p>
52 <p>The comparison of the switching windows on the latch nodes, to the arrival times of the clocks,
53 define the setup/hold slacks on the latches. The comparison of the switching windows on the output
54 connectors, to the <f>set_output_delay</f> constraints, define the setup/hold slacks on the output
55 connectors.</p>
56 </section>
57
58
59 <section niv='2'><title>Output Files</title>
60 <p>With default behavior, the STA engine generates two files:</p>
61 <list>
62 <item><f>.sto</f> file: switching windows for each signal of the design under analysis.</item>
63 <item><f>.str</f> file: setup and hold slack report computed for all the reference points of the design under analysis.</item>
64 </list>
65 </section>
66
67 <section niv='2'><title>Tcl Reports</title>
68 <p>The slack report is also available through the Tcl function <f>stb_DisplaySlackReport</f>. This
69 function generates the same kind of report as the <f>.str</f> file, but with more customizable and
70 detailed information.</p>
71 </section>
72
73 &slack_reports;
74
75 <section niv='2'><title>Skew Compensation</title>
76 <p>When computing hold slack values between two latches, taking into account the clock skew on the full
77 clock tree may lead to excessive pessimism.</p>
78 <p>The hold slack is the difference between the data
79 arrival time and the clock arrival time on a latch. The data is supposed to
80 remain stable until after the latch has closed, i.e. the data is supposed to arrive after the time the clock
81 arrives. In the case of a master to slave data path, we have:</p>
82 <code>
83 <cl>hold_slack = data_time - ck_to_slave</cl>
84 </code>
85
86 <p>The data comes from the opening of the master latch, so we can express the data arrival time as follow:</p>
87 <code>
88 <cl>data_time = ck_to_master + master_to_slave</cl>
89 </code>
90 <p>All in all, we have: (minimized)</p>
91 <code>
92 <cl>hold_slack = ck_to_master + master_to_slave - ck_to_slave</cl>
93 <cl>hold_slack_min = ck_to_master_min + master_to_slave_min - ck_to_slave_max</cl>
94 </code>
95 <p>In this case, paths from clock to master and from clock to slave are almost identical, until
96 the node where they diverge towards master and slave. However,
97 static timing analysis hypothesis may lead to significant differences between min and max propagation delays
98 on a given path (especially when crosstalk effects are taken into account).</p>
99 <p>In the case of a hold slack, we check a data coming out from a master
100 latch (opening), against the memorizing event of a slave latch (closing). What should be emphasized here is that
101 a single clock edge generates both the opening event of the master latch and the closing event of the slave
102 latch. The signal is propagating through the common part of the clock-to-master and clock-to-slave paths, and
103 diverges to the master and the slave. Therefore, considering min and max propagation delays on the clock paths
104 only makes sense on the parts of the paths which are not common to the clock-to-master and clock-to-slave paths.
105 The following diagram illustrates this situation:</p>
106 <imgsize namehtml="skew_comp.gif" namepdf="skew_comp.gif" hpdf="200pt"/>
107 <p>&tool; supports this situation by a skew compensation mechanism. The global difference between
108 clock-to-master (minimum) and clock-to-slave (maximum) is computed. The difference relative to the common part
109 is removed afterwards. It appears in the slack report tagged as <f>[SKEW COMPENSATION]</f>.</p>
110
111
112
113 </section>
114
115 <section niv='2'><title>Multicycle Paths</title>
116
117 <p>&tool; supports multicycle paths through the SDC commands <f>set_multicycle_path</f> as described in this section. Multicycle paths
118 specifications typically allow the tool to perform timing checks for data which requires more than one clock cycle to reach its destination.
119 Let's consider the diagram below, which summarizes what can be done with multicycle paths:</p>
120
121 <code>
122 <cl> ____ ____ ____ ____ </cl>
123 <cl>ORIGIN_CK ___| |____| |____| |____| |____|</cl>
124 <cl> 0 1 2 3 4</cl>
125 <cl> ____ ____ ____ ____ ____</cl>
126 <cl>DEST_CK ___| |____| |____| |____| |____| |____|</cl>
127 <cl> 0 1 2 3 4 5</cl>
128 </code>
129
130 <p>In the 1-cycle default case, checks are done as follow:</p>
131 <list>
132 <item>Setup timing check: <f>ORIGIN(0)</f> vs. <f>DEST(1)</f></item>
133 <item>Hold timing check: <f>ORIGIN(0)</f> vs. <f>DEST(0)</f></item>
134 </list>
135
136 <p>Let's consider a multicycle path of 5, if one just writes the command:</p>
137 <code>set_multicycle_path 5 -end -to DEST_DATA</code>
138 <p>or its equivalent:</p>
139 <code>set_multicycle_path 5 -end -setup -to DEST_DATA</code>
140 <p>This gives:</p>
141 <list>
142 <item>Setup timing check: <f>ORIGIN(0)</f> vs. <f>DEST(5)</f></item>
143 <item>Hold timing check: <f>ORIGIN(0)</f> vs. <f>DEST(4)</f></item>
144 </list>
145
146 <p>As you can see, by default the path multiplier (5 here) is applied to the setup check, effectively saying that the
147 data is allowed 5x more clock cycles than the default of 1 to arrive at the destination latch. Note that changing the
148 path multiplier for setup also affects the hold check since, by default, the hold check is 1 cycle before the setup check.</p>
149 <p>If you want to have the hold checks done as in the 1-cycle case, one must moves the hold check backwards by 4 cycles.
150 This can be done by specifying a path multiplier of 4 for the hold chacks on the same paths as follows:</p>
151 <code>set_multicycle_path 4 -end -hold -to DEST_DATA</code>
152 <p>This gives:</p>
153 <list>
154 <item>Setup timing check: <f>ORIGIN(0)</f> vs. <f>DEST(5)</f></item>
155 <item>Hold timing check: <f>ORIGIN(0)</f> vs. <f>DEST(0)</f></item>
156 </list>
157
158 </section>
159
160
161 <section niv='2'><title>Tips</title>
162
163 <section niv='3'><title>Disabling Master-to-Slave Timing Checks</title>
164 <p>Since 2.7p6 release, there is a way to disable the setup/hold checks between master and slave latches,
165 with a semi-manual method.</p>
166
167 <p>The SDC command <f>set_false_path</f> accepts the <f>-hold</f> and <f>-setup</f> options, so
168 it is possible to disable
169 setup/hold checks on specific latches through this command, for example:</p>
170 <code>
171 <cl>set_false_path -setup -to "*.dff_s"</cl>
172 <cl>set_false_path -hold -to "*.dff_s"</cl>
173 </code>
174
175 <p>This will disable setup/hold checks on all the latches matching the pattern <f>*.dff_s</f>
176 (assuming the latch node's name is <f>dff_s</f>). This method assumes that you know the name of the
177 latch node. Obviously it's not always the case, so &tool; also provides an automatic master/slave detection
178 mechanism. This detection is done during the database construction (the <f>hitas</f> command), and is
179 controlled by the following configuration:</p>
180
181 <code>
182 <cl>avt_config yagleAutomaticFlipFlopDetection mark</cl>
183 </code>
184
185 <p>The effect of this configuration is to report master/slave information about the latches in the
186 <f>.rep</f> file, as follow:</p>
187
188 <code>
189 <cl>[WRN 33] Loop between 2 gates at 409 'm1.dff_m' (master latch found)</cl>
190 <cl>[WRN 34] Loop between 2 gates at 411 'm1.dff_s' (slave latch found)</cl>
191 </code>
192
193 <p>It is possible to extract the SDC commands from the <f>.rep</f> file with an AWK script looking like:</p>
194
195 <code>
196 <cl>#!/usr/local/bin/gawk -f</cl>
197 <cl>{</cl>
198 <cl> if ($2=="34]") {</cl>
199 <cl> gsub ("'", "", $9);</cl>
200 <cl> printf "set_false_path -setup -to "$9"\n" >"ms_chk.sdc";</cl>
201 <cl> printf "set_false_path -hold -to "$9"\n" >"ms_chk.sdc";</cl>
202 <cl> } </cl>
203 <cl>}</cl>
204 </code>
205
206
207 </section>
208
209 </section>
210
211 <section niv='2'><title>On-Chip Variation</title>
212 <p>&tool; handles On-Chip Variation by considering additionnal margins on timing paths. An added margin is associated
213 with a timing path and is defined by an absolute <f>delta</f> value and a relative <f>factor</f> value. The absolute value
214 is an added or substracted propagation delay. The relative value is a percentage of the propagation delay of the timing path itself.</p>
215 <p>Both the absolute value and the relative value should
216 be specified by the user, with the <f>inf_DefinePathDelayMargin</f> function:</p>
217 <code>
218 <cl>path_delay + margin = path_delay * factor + delta</cl>
219 </code>
220 <p>Those margins can be specified either path by path or by group of paths (data paths, clock paths, paths arriving on special
221 nodes...).</p>
222 <p>&tool; also considers positive and negative margins (if <f>factor &gt; 1</f>, the margin is positive, else it is negative).
223 Positive margins are used when considering max paths, negative margins are used when considering min paths (for example
224 STA computes setup slacks by considering max data path vs. min clock path, and the other way round for hold slacks).</p>
225 </section>
226
227 <section niv='2'><title>Clock Schemes Handling</title>
228
229 <section niv='3'><title>Clock Dividers</title>
230 <p>Under construction...</p>
231 </section>
232
233 <section niv='3'><title>Pulse Generators</title>
234 <p>Under construction...</p>
235 </section>
236
237 <section niv='3'><title>RS-based Clock Generators</title>
238 <p>Under construction...</p>
239 </section>
240
241 </section>
242
243 </section></chapter>