Académique Documents
Professionnel Documents
Culture Documents
Digital Design II
Spring 2008
Lecture 20:
Timing Analysis and
Timed Simulation
A Tools/Methods Lecture
Patrick Schaumont
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
Topics
Static
Static
Timing Analysis
Delay Model
Path Delay
False Paths
Timing Constraints
FPGA Design Flow & STA: Sorter Example
Dynamic
Timing Analysis
Patrick Schaumont
Spring 2008
Input
Digital
Synchronous
Design
Output
fCLK
Patrick Schaumont
Spring 2008
Patrick Schaumont
Spring 2008
chip
Delay from
input to
register
IN
Combinational
Logic
Delay from
register to
register
Combinational
Logic
Delay from
register to
output
Combinational
Logic
OUT
Patrick Schaumont
Spring 2008
Combinational
Logic
CLK
Property of
the netlist
Property of
the component
(flipflop)
Patrick Schaumont
Spring 2008
The
CLK
Tskew
Patrick Schaumont
Spring 2008
The
Patrick Schaumont
Spring 2008
The
The
Patrick Schaumont
Spring 2008
Path
15 ns
12 ns
9 ns
Patrick Schaumont
Spring 2008
delay =
Intrinsic Gate Delay + Fan-out Delay + Wire Delay
Intrinsic
Delay:
1 ns
In
intrinsic delay = 1ns
(delay of each gate
when not connected)
Out
Patrick Schaumont
Spring 2008
Delay of a path
Gate
1 ns
In
Out
Ci
Fan-out = 4
Each gate input represents a unit load
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
Fan-out Delay:
V
1 ns
Vi,H
V
Vinput
1 load
Ci
t
Fan-out
Delay
RC-delay
R ~ drive capability of
inverter output stage
C ~ loading of output
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
Fan-out Delay:
1 load
3 load
Vi,H
V
Vinput
Ci
Delay
Patrick Schaumont
Spring 2008
4 x 0.5 ns
2 ns
After
Patrick Schaumont
Spring 2008
Select
Comb
Logic
1
0
1
Comb
Logic
Patrick Schaumont
Spring 2008
Designers
Logic
1
0
1
Logic
Patrick Schaumont
Spring 2008
Timing Constraints
Timing
The
Patrick Schaumont
Spring 2008
Constraints
(ucf)
RTL Verilog
No timing information known
(apart from cycle boundaries)
Synthesis
(+translate)
Mapper
Timing estimated based on components only
(only fan-out and intrinsic delay)
Place and
Route
Timing estimated based on final
netlist (fan-out, intrinsic, and wire delay)
Bitstream
Generation
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
a2
a3
a4
registers
sort4_stage
b
sort2
sort2
min(a,b)
max(a,b)
sort2
sort4_stage
registers
q1
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
q2
q3
q4
Patrick Schaumont
Spring 2008
As
Some
a2
a3
a4
examples:
registers
sort4_stage
b
sort2
sort2
min(a,b)
max(a,b)
sort2
sort4_stage
registers
q1
q2
q3
q4
Patrick Schaumont
Spring 2008
sort2
sort4_stage
register stage
top cell
Patrick Schaumont
Spring 2008
Sort2 cell
module sorter2c(qa, qb, a, b);
output [3:0] qa, qb;
input [3:0] a, b;
assign qa = (a > b) ? a : b;
assign qb = (a > b) ? b : a;
endmodule
Patrick Schaumont
Spring 2008
Sort4_stage
module sort4_stage(q1, q2, q3, q4, a1, a2, a3, a4);
output [3:0] q1, q2, q3, q4;
input [3:0] a1, a2, a3, a4;
wire
[3:0] w1, w2, w3, w4;
sorter2 S1 (w1, w2, a1, a2);
sorter2 S2 (w3, w4, a3, a4);
sorter2 S3 (q2, q3, w2, w3);
assign q1 = w1;
assign q4 = w4;
a1
sort4_stage
a2
a3
a4
endmodule
sort2
sort2
min(a,b)
max(a,b)
sort2
Patrick Schaumont
Spring 2008
Register stage
module regblock(q1, q2, q3, q4, a1, a2, a3, a4, clk);
output [3:0] q1, q2, q3, q4;
reg
[3:0] q1, q2, q3, q4;
input [3:0] a1, a2, a3, a4;
input clk;
always @(posedge clk) begin
q1 <= a1;
q2 <= a2;
q3 <= a3;
q4 <= a4;
end
endmodule
Patrick Schaumont
Spring 2008
Toplevel
module fullsorter(q1, q2, q3, q4, a1, a2, a3, a4, clk);
output [3:0] q1, q2, q3, q4;
input [3:0] a1, a2, a3, a4;
input clk;
wire
wire
wire
regblock
sort4_stage
sort4_stage
regblock
R0(w1,
S0(v1,
S1(u1,
R1(q1,
w2,
v2,
u2,
q2,
w3,
v3,
u3,
q3,
w4,
v4,
u4,
q4,
a1,
w1,
v1,
u1,
a2,
w2,
v2,
u2,
a3,
w3,
v3,
u3,
a4, clk);
w4);
v4);
u4, clk);
endmodule
Patrick Schaumont
Spring 2008
Timing Constraints
We
This
sorter.ucf
sorter.v
(sort2,
sort4_stage,
register stage,
toplevel)
Synthesis
(+translate)
Patrick Schaumont
Spring 2008
Patrick Schaumont
Spring 2008
Timing Analyzer
Delay Summary
Nets +
Components
in
Longest
Path
Patrick Schaumont
Spring 2008
R0/q4_3
q4, bit 3
12 levels of logic
(includes setup)
9.739 ns
R1/q3_2
Patrick Schaumont
Spring 2008
a2
a3
a4
R0/q4_3
registers
sort4_stage
b
sort2
sort2
9.739 ns
min(a,b)
max(a,b)
sort2
sort4_stage
R1/q3_2
registers
q1
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
q2
q3
q4
Patrick Schaumont
Spring 2008
Logical Resource(s)
------------------Starting Point
R0/q4_3
w4<3>
S0/S2/q1_cmp_gt0000121
S0/S2/q1_cmp_gt00001_map7
S1/w3<1>
S1/S3/q1_cmp_gt0000145
S1/S3/q1_cmp_gt0000145/O
S1/S3/q1_cmp_gt0000173
S1/S3/q1_cmp_gt0000
S1/S3/q2<2>1
u3<2>
Ending Point
R1/q3_2
--------------------------(8.439ns logic, 1.300ns route)
(86.7% logic, 13.3% route)
Patrick Schaumont
Spring 2008
Logic
Logical Resource(s)
Delays
------------------R0/q4_3
(LUTs)
w4<3>
S0/S2/q1_cmp_gt0000121
S0/S2/q1_cmp_gt00001_map7
S1/w3<1>
S1/S3/q1_cmp_gt0000145
S1/S3/q1_cmp_gt0000145/O
S1/S3/q1_cmp_gt0000173
S1/S3/q1_cmp_gt0000
S1/S3/q2<2>1
u3<2>
R1/q3_2
--------------------------(8.439ns logic, 1.300ns route)
(86.7% logic, 13.3% route)
Patrick Schaumont
Spring 2008
Logical Resource(s)
Net
------------------Delays
R0/q4_3
(estimated)
w4<3>
S0/S2/q1_cmp_gt0000121
S0/S2/q1_cmp_gt00001_map7
S1/w3<1>
S1/S3/q1_cmp_gt0000145
S1/S3/q1_cmp_gt0000145/O
S1/S3/q1_cmp_gt0000173
S1/S3/q1_cmp_gt0000
S1/S3/q2<2>1
u3<2>
R1/q3_2
--------------------------(8.439ns logic, 1.300ns route)
(86.7% logic, 13.3% route)
Patrick Schaumont
Spring 2008
Patrick Schaumont
Spring 2008
We
This is not only the case for this example. In modern logic
design, routing delay is typically as large as logic delay !!
========================================================================
Timing constraint: NET "clk_BUFGP/IBUFG" PERIOD = 20 ns HIGH 50%;
30002 items analyzed, 0 timing errors detected. (0 setup errors, 0 hold
errors)
Minimum period is 19.000ns.
---------------------------------------------------------------------Slack:
1.000ns (requirement - (data path - clock path
skew + uncertainty))
Source:
R0/q1_3 (FF)
Destination:
R1/q3_1 (FF)
Requirement:
20.000ns
Data Path Delay:
18.979ns (Levels of Logic = 12)
Clock Path Skew:
-0.021ns
Source Clock:
clk_BUFGP rising at 0.000ns
Destination Clock:
clk_BUFGP rising at 20.000ns
Clock Uncertainty:
0.000ns
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
Logical Resource(s)
------------------R0/q1_3
w1<3>
S1/S3/q1_cmp_gt0000145
S1/S3/q1_cmp_gt0000145/O
S1/S3/q1_cmp_gt0000173
S1/S3/q1_cmp_gt0000
S1/S3/q2<1>1
u3<1>
R1/q3_1
--------------------------(8.631ns logic, 10.348ns route)
(45.5% logic, 54.5% route)
Patrick Schaumont
Spring 2008
STA
Analyzing
Patrick Schaumont
Spring 2008
Since
Constraint-checking
designer
The designer needs to verify if the result of the timed
simulation is still corresponding to the results of the RTL
simulation
Patrick Schaumont
Spring 2008
RTL Verilog
Testbench
Synthesis
(+translate)
Post Synthesis
Netlist
Testbench
Mapper
Post Map
Netlist
Testbench
Post P&R
Netlist
Testbench
Place and
Route
Bitstream
Generation
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
RTL Verilog
Post Synthesis
Netlist
Post Map
Netlist
Post P&R
Netlist
Patrick Schaumont
Spring 2008
external
simulator
Patrick Schaumont
Spring 2008
This is a component
from an FPGA
simulation library.
The component has an
parameter called INIT.
In this case, the parameter
captures the configuration
of a LUT lookup table.
The LUT contains an OR.
q1[3]
a2[3]
a1[3]
= 4'hE
ECE 4514 Digital Design II
Lecture 20: Timing Analysis
Patrick Schaumont
Spring 2008
|| (s[1]^s[0] ==0))
== INIT[1]) &&
== INIT[3]) &&
== INIT[2]))
0) && (INIT[0] == INIT[1]))
1) && (INIT[2] == INIT[3]))
0) && (INIT[0] == INIT[2]))
1) && (INIT[1] == INIT[3]))
Patrick Schaumont
Spring 2008
LUT configuration
Placement
information
Patrick Schaumont
Spring 2008
The
Testbench
Modelsim
Post-PAR
Simulation
Patrick Schaumont
Spring 2008
Demonstration
(this
Include
Choices
Patrick Schaumont
Spring 2008
Demonstration (2)
Simulate
Post-PAR Model
netlist
Post-synthesis
Isolate one component (LUT)
Verify LUT location in simulation library
Post-PAR
Compare Post-PAR component with post-synthesis
Patrick Schaumont
Spring 2008
Dynamic
Performance
Patrick Schaumont
Spring 2008