Lecture 3 STA
Lecture 3 STA
Lecture 3 STA
Lecture 3:
Timing Analysis
Semester A, 2016-17
Lecturer: Dr. Adam Teman
20 November 2016
Disclaimer: This course was prepared, in its entirety, by Adam Teman. Many materials were copied from sources freely available on the internet. When possible, these sources have been cited;
however, some references may have been cited incorrectly or overlooked. If you feel that a picture, graph, or code example has been copied from you and either needs to be cited or removed,
please feel free to email [email protected] and I will address this as soon as possible.
2
1 3 4
Static Timing
Sequential Clocking Design Constraints Timing Reports
Analysis
Sequential Clocking
Synchronous Design - Reminder
• The majority of digital designs are Synchronous
and constructed with Sequential Elements.
• Synchronous design eliminates races
(like a traffic light).
• Pipelining increases throughput.
clk
clk
Q
Timing Parameters - thold
• thold - Hold time is the time the data has to be stable after the clock
to ensure correct sampling.
clk
clk D Q Logic D Q
A B
D tcq
A clk
B tsu
Setup (Max) Constraint
Launch Path
margin
Capture Path
B clk
thold
Hold (Min) Constraint
Launch Path
margin
Capture Path
17
Some basic assumptions
• Our design is synchronous
• In addition, we will only be showing how to deal with combinational elements
and max delay constraints.
• We will assume a pin-to-pin delay model
• In other words, each gate has a single, constant delay from input to output.
• In the real world, gate delay is affected by many factors, such as gate type,
loading, waveform shape, transition direction, particular pin, and random
variation.
• We will see how a real design gets all this data in the next lecture.
• We will take a topological approach
• In other words, we disregard the logical functionality of the gates and therefore,
consider all paths, though some of them cannot logically happen.
• More on this later…
18
Simple path representation
a c
• Let’s say we have the following circuit: b e
d
• And the timing model of our AND gate is: 2
2
• We will build a graph: a 2
• Vertices: Wires, 1 per gate output and 1 for 2
c
each PI and PO. e
• Edges: Gates, input pin to output pin, b 2
d 2
1 edge per input with a delay for each edge.
• Finally, add Source/Sink Nodes: 0 a 2
2
• 0-weight edge to each PI and from each PO. SRC
0 c
b 2 e SNK
• That way all paths start and end at a single node. 0
0 2
19 d
Node oriented timing analysis
• If we would enumerate every path, we would quickly get exponential explosion
in the number of paths.
• Instead, we will use node-oriented timing analysis
• For each node, find the worst delay to the node along any path.
• For this, we need to define two important values:
• Arrival Time at a node (AT): the longest path from the source to the node.
• Required Arrival Time at node (RAT): the latest time the signal is allowed to
leave the node to make it to the sink in time.
Slack at node n is defined as:
Slack(n) = RAT(n) – AT(n)
20
How do we compute ATs and RATs?
• Recursively!
• The Arrival Time at a node is just the maximum of the ATs at the predecessor
nodes plus the delay from that node.
• The Required Arrival Time to a node is just the minimum of the RATs at the
successor nodes minus the delay to that node.
0 n SRC
AT n max AT p p, n n SRC
ppred n
T n SNK
RAT n max RAT s n, s n SNK
ssucc n
21
So let’s try to understand AT, RAT, and Slack
If the signal arrives too late, we
get negative slack, which means
there is a timing violation.
Slack
Slack
RAT(n)
AT(n) RAT(n)
AT(n)
RAT: longest logic
AT: longest delay to the capture
logic delay edge of the clock
after launch (dependent on
of clock cycle time)
Launch Clock cycle time (T) Capture Clock cycle time (T)
22
Now let’s see an example
• Just look at this path and try to find the worst path.
• Does it meet a cycle time of T=12 ?
3 g
a 1
d 2
j
5 1
b 4 f
3
c 1 2 k
4
3 h
2 e 5 n
• Now let’s fill in the RAT, AT, and SLACK of each node and:
• Quickly find out if we meet timing
• Figure out what the worst path is
23
Now let’s see an example
• We’ll start by representing it as a
directed acyclic graph (DAG)
• Next, we’ll compute ATs from SRC to SNK
0 1 4 7
1 3 2
a d g j
0 5 1 0
0 0 6 12 15
0 4 3 0
SRC b f 4 k SNK
2
0 1 h 0
0 2 3 5
15
2 10
c e n
24
Now let’s see an example
• And now RAT from SNK to SRC
0 -3 1 -2 4 10 7 12
1 3 2
a d g j
0 5 1 0
0 -3 0 -1 6 3 12 12 15 12
0 4 3 0
SRC b f 4 k SNK
2
0 1 h 0
0 2 2 4 3 5
15 12
2 10 7
c e n
25
Now let’s see an example
• And finally, we can calculate the slack.
• And guess what – we found the critical path!
0 -3 -3 1 -2 -3 4 10 6 7 12 5
1 3 2
a d g j
0 5 1 0
0 -3 -3 0 -1 -1 6 3 -3 12 12 0 15 12 -3
0 4 3 0
SRC b f 4 k SNK
2
0 1 h 0
0 2 2 2 4 2 3 5
15 12 -3
2 10 7 -3
c e n
26
False Paths
• We saw how to find the RAT, AT and Slack at every node.
• All of this can be done very efficiently and be adapted for min timing,
sequential elements, latch-based timing, etc.
• Even better, we can quickly report the order of the critical paths.
• However, this was all done topologically (i.e., without looking at logic).
• Let’s see why this is a problem This is called a “False Path”
8 8
a d 2 8 g 2 a d 2 8 g 2
0
f 1 2 j 0
1 1 1 2 1
b e 2 h b
1
e 2 h
1 1 1 1
c i c
27
2
1 3 4
Static Timing
Sequential Clocking Design Constraints Timing Reports
Analysis
Design Constraints
Timing Constraints
• “Stupid Question”:
• How does the STA tool know what the required clock period is?
• Obvious Answer…
• We have to tell it!
• We have to define constraints for the design.
• This is usually done using the
Synopsys Design Constraints (SDC) syntax,
which is a superset of TCL.
• Three main categories of timing constraints:
• Clock definitions
• Modeling the world external to the chip
• Timing exceptions
Collections
• So you think you know TCL, right?
• Well EDA tools sometimes use a different data
structure called a “collection”
• A collection is similar to a TCL list, but:
• The value of a collection is not a string, but rather a pointer, and we need to
use special functions to access its values.
• For example, if you were to run foreach on a collection, it would just have one
element (the pointer to the collection). Instead, use foreach_in_collection.
• I won’t go into the specifics here (see SynopsysCommandsReference), but
these are some of the collection accessing functions:
foreach_in_collection filter_collection copy_collection
index_collection add_to_collection get_object_name
sizeof_collection compare_collections remove_from_collection
sort_collection
SDC helper functions
• Before starting with constraints, let’s look at some very useful built in commands:
• Note that all of these return collections and not TCL lists!
• These will only work after design elaboration!
• “get” commands:
• [get_ports string] – returns all ports that match string.
• [get_pins string] – returns all cell/macro pins that match string.
• [get_nets string] – returns all nets that match string.
• Note that adding the –hier option will search hierarchically through the design.
• “all” commands:
• [all_inputs] – returns all the primary inputs (ports) of the block.
• [all_outputs] – returns all the primary outputs (ports) of the block.
• [all_registers] – returns all the registers in the block.
Clock Definitions
• To start, we must define a clock:
• Where does the clock come from? (i.e., input port, output of PLL, etc.)
• What is the clock period? (=operating frequency)
• What is the duty-cycle of the clock?
create_clock –period 20 –name my_clock [get_ports clk]
Input and
Output Delays
1 1
c
• In this case, we would define a false path:
set_false_path –through [get_pins mux1/I0] –through [get_pins mux2/I0]
set_false_path –through [get_pins mux1/I1] –through [get_pins mux2/I1]
Timing Exceptions (2)
• Another common case of a false path is a clock
domain crossing through a synchronizer:
set_false_path –from F1/CP –to F2/D
39
Design Rule Violations (DRV)
• You can set specific design rules that should be met, for example:
• Maximum transition through a net.
set_max_transition 0.1
* Between the time I wrote this slide and presented it to you, each
EDA vendor has presented another method for timing closure that
you just must know about and have to use .
41
2
1 3 4
Static Timing
Sequential Clocking Design Constraints Timing Reports
Analysis
42
Check Types
• Throughout this lecture, we have
discussed the two primary timing checks:
• Setup (max) Delay
• Hold (min) Delay
• However, in practice, there are other
categories of timing checks that you will
encounter:
• Recovery
• Removal
• Clock Gating
• Min Pulse Width
• Data-to-Data
Recovery, Removal and MPW
• Recovery Check
• The minimum time that an asynchronous control
input pin must be stable after being deasserted and
before the next clock transition (active-edge)
• Removal Check
• The minimum time that an asynchronous control
input pin must be stable before being deasserted and
after the previous clock transition (active edge)
• Minimum Clock Pulse Width (MPW)
• The amount of time after the rising/falling edge of a
clock that the clock signal must remain stable.
44
Clock Gating Check
• Clock gating occurrences are any signals on the clock path
that block (gate) the clock from propagating.
• The enable path of the clock gate must arrive enough time before the clock
itself to ensure glitch-free functionality (and similarly hold after the edge).
Ex. 1: Gating signal should only change Ex. 2: Gating signal should only change
when the clock is in the low state when the clock is in high low state
45
Analysis Coverage
• Use report_analysis_coverage and check_timing
to ensure that you have fully constrained your design.
46
Report Timing - Terminology
47
Report Timing - Structure
48
Report Timing - Structure Data Required Section
Data Arrival Section
Slack
49
Example Hold Timing Report
50
Path Groups
• By default, all timing paths will be
separated into standard path groups:
• Reg2Reg
• In2Reg
• Reg2Out
• In2Out
• Clock Gating
52
Report Timing Syntax
• The syntax for the Innovus (Encounter) report_timing command is
partially:
report_timing [-clock_from edge_from] [-clock_to clk_signame_list]
[-early | -late] [-net]
[-check_type {setup | hold | clock_gating_setup | recovery | removal} ]
[-max_paths integer] | [-nworst integer ]
[{-from | -from_rise | -from_fall} pin_list ]
[{-through | -through_rise | -through_fall} pin_list ]
[{-not_through | -not_rise_through | -not_fall_through} object_list ]
[{-to | -to_rise | -to_fall} pin_list ]
[-point_to_point]
[-path_group groupname_list ]
[-path_type {end | summary | full | full_clock}]
[-max_slack float ] [-min_slack float ]
-unconstrained [-view { viewName }] [-format column_list ] [-collection]
[-machine_readable | -tcl_list]
53
Report Timing Syntax
• The Innovus (Encounter) report_timing format options are:
• adjustment, annotation, arc, arrival, cell, delay, direction, edge,
fanin, fanout, incr_delay, instance, instance_location, load,
aocv_derate, net, phase, pin, hpin, pin_location, pin_load,
wire_load, required, retime_delay, retime_incr_delay, retime_slew,
slew, stolen, stage_count, timing_point, power_domain, user_derate,
total_derate, and aocv_weight
• For example:
report_timing –check_type setup \
–path_group Clock –path_type full_clock –max_paths 50 –net \
-format {hpin cell delay required arrival required edge} \
> timing_report.rpt
54
References
• Gil Rahav, BGU
• Gangadharan, Churiwala “Constraining Designs for Synthesis and Timing
Analysis: A Practical Guide to Synopsys Design Constraints (SDC)”, Springer,
2013
• Synopsys SourceLink (+Synthesis Quick Reference)
• Cadence Support (+Genus and Innovus Text Command References)
55