Digital VLSI Design Timing Analysis: Semester A, 2018-19 Lecturer: Dr. Adam Teman
Digital VLSI Design Timing Analysis: Semester A, 2018-19 Lecturer: Dr. Adam Teman
Lecture 5:
Timing Analysis
Semester A, 2018-19
Lecturer: Dr. Adam Teman
December 7, 2018
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 adam.teman@biu.ac.il and I will address this as soon as possible.
Lecture Outline
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.
• We will assume that all sequentials are
Edge-Triggered, using D-Flip Flops as registers.
• D-Flip Flops have three critical timing parameters:
• tcq – clock to output: essentially a propagation delay
• tsetup – setup time: the time the data needs to arrive before the clock
• thold – hold time: the time the data has to be stable after the clock
clk
clk
clk
clk D Q Logic D Q
A B
D tcq
A clk
B tsetup
9 © Adam Teman, 2018
Setup (Max) Constraint
Launch Path
margin
Capture Path
B clk
thold
11 © Adam Teman, 2018
Hold (Min) Constraint
Launch Path
margin
Capture Path
0 n = SRC
AT ( n ) = max AT p + p, n n SRC
ppred( n )
( ) ( )
T n = SNK
RAT ( n ) = min RAT s − n, s n SNK
ssucc( n )
( ) ( )
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)
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
26 © Adam Teman, 2018
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
27 © Adam Teman, 2018
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
28 © Adam Teman, 2018
The Chip Hall of Fame
• Speaking about Timing, we shouldn’t forget the
source: wikipedia
2017 Inductee to the IEEE Chip Hall of Fame Photo: Hans Camenzind
1 2 3 4 5
Sequential Static Timing Design Timing Multi Mode
Clocking Analysis Constraints Reports Multi Corner
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
31 © Adam Teman, 2018
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
32 © Adam Teman, 2018
Design Objects
• Design: A circuit description that performs one or more logical functions (i.e Verilog module).
• Cell: An instantiation of a design within another design (i.e Verilog instance).
• Called an inst in Stylus Common UI.
• Reference: The original design that a cell "points to" (i.e Verilog sub-module)
• Called a module in Stylus Common UI. module foo (a,b,out);
wire n1;
• Before starting with constraints, Pin
Cell Net
let’s look at some very useful built in commands:
INVx1 U1 (.in(a),.out(n1));
• Note that all of these return collections
and not TCL lists! NANDX3 U2
Reference
(.in1(n1),.in2(b),.out(out));
• These will only work after design elaboration!
• “get” commands: endmodule
• [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.
34 © Adam Teman, 2018
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:
* 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 ☺.
44 © Adam Teman, 2018
1 2 3 4 5
Sequential Static Timing Design Timing Multi Mode
Clocking Analysis Constraints Reports Multi Corner
Timing Reports
45
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
46 © Adam Teman, 2018
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.
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
48 © Adam Teman, 2018
Checking your design
• report_analysis_coverage checks that you have fully constrained your
design.
Header
Launch path
Path Group
Start Point
Clock Edges
Source Latency
Flop Setup Time
Clock Net Latency Clock Uncertainty (Jitter)
Required Time = Arrival - Setup - Jitter
Data Path arrival time
52 © Adam Teman, 2018
Final Slack Calculation
Report Timing – Launch Path
• Standard timing report only shows the data delay of the launch path and very
basic information.
Fanout
rising/falling
Instance name
Arrival Time
Transition
Timing Arc
Clock Port
Launch Clock
Endpoint
data pin
Launch path endpoint
• To create specific path groups for your design, use the group_path command:
group_path –from ff1/CLK –to ff2/D –name my_path
Multi-Mode Multi-Corner
Or how to deal with the corner crisis!
61
More than one operating mode
• During synthesis, we (usually) target timing for a worst-case scenario.
• But, what is “worst-case”?
• Intuitively, that would be a slow corner, (i.e., SS, VDD-10%, 125C)
• No need for hold checking, since clock is ideal (No skew = No hold)
• But, what if there is an additional operating mode? Mode TEST_MODE FREQ
• For example, a test (scan) mode. Functional 0 1 GHz
• Do we have to close timing Test 1 10 MHz
at the same (high) clock speed?
• No problem, we’ll just deal with both modes separately
• Prepare an additional SDC and rerun STA/optimization.
set_case_analysis 1 [get_ports TEST_MODE]
create_clock –period [expr $TCLK/100] –name TEST_CLK [get_ports TEST_CLK]
62 © Adam Teman, 2018
Many, many, corners…
• But real SoCs are much more complex: Mode VDD1 FREQ1 VDD2 FREQ2
F1 1.2 V 2 GHz 0.8 V 500 MHz
• Many operating modes.
F2 0.8 V 400 MHz 0.8 V 400 MHz
• Many voltage domains.
F3 Off Off 0.5 V 50 MHz
• With real clock, need to check hold.
TEST 1.2 V 10 MHz 1.2 V 10 MHz
• We easily get to hundreds of corners
• Setup and hold for every mode.
• Hold can be affected by SI →
check hold for all corners
• Temperature inversion – what is the worst case?
• RC Extraction – what is the worst case?
• Leakage – what is the worst case?
• Aaaaarrrrrgggghhhh!
• A delay corner tells the tool how the delays are supposed to be calculated.
Therefore it contains timing libraries and extraction rules.
• A constraint mode is basically the relevant SDC commands/conditions for the
particular operating mode.
66 © Adam Teman, 2018
Multi-Mode, Multi-Corner
• So now, let’s define the lower levels of the MMMC hierarchy.
• A constraint mode is simply a list of relevant SDC files. When you move
between analysis views, the STA tool will automatically apply the relevant
constraints to the design.
create_constraint_mode –name turbo_mode –sdc_files {turbo.sdc}
create_constraint_mode –name low_power_mode –sdc_files {low_power.sdc}