Timing Analysis and Timing Predictability Reinhard Wilhelm Saarbrücken.
Timing Analysis in Quartus
description
Transcript of Timing Analysis in Quartus
© 2000 Altera Corporation
1
Timing Analysis in Quartus
© 2000 Altera Corporation
2
Features
Quartus is capable of doing single clock design timing analysis and multi-clock design timing analysis
Single clock timing analysis– Fmax (maximum clocking frequency)– Tsu, Th, Tco (setup time, hold time, clock-to-out time)– Slack analysis for Fmax (incl. delays to/from pins)
Multi-clock analysis– Allows user to analyze timing for a design containing register-to-
register paths which are controlled by different clocks– Slack analysis is used
Combinatorial Loop Detection– Quartus automatically detects combinatorial loops
© 2000 Altera Corporation
3
Features
Different types of timing information (Refer to the compilation section for more information) – Timing without place & route– Timing with place & route– A mix of both for a hierarchical design
By default, timing analysis is performed automatically after compilation– Can be disabled
Timing information can be exported to other EDA tools via VHDL, Verilog and Standard Delay File (SDF)
© 2000 Altera Corporation
4
In This Section
Timing analysis for a single clock system– Register Performance– Setup Time– Hold Time– Clock-to-Out
Making Timing Assignments Timing analysis of a multi-clock system How to make multi-cycle assignments Timing Wizard
© 2000 Altera Corporation
5
Compile Design
Step 2: Investigate the type of delayin this design
Step 1:The internal fmax is 83.19 Mhz. This value is automatically given for each clock in the Message Window (Processing Tab)
© 2000 Altera Corporation
6
Timing information is part of the Compilation Report– Summary
Timing Analyses– fmax (not incl. delays to/from pins) or
fmax (incl. delays to/from pins)– Register-to-Register Table– tsu (Input Setup Times)– th (Input Hold Times)– tco (Clock to Out Delays)– tpd (Pin to Pin Delays)
All timing results are reported here
Reporting Timing Results
© 2000 Altera Corporation
7
fmax (not incl. delays to/from pins)
Clock Period = Clock-to-out + Data Delay + Setup Time - Clock Skew = tco + B + tsu - (E - C)
Fmax = 1/Clock Period
B
C
tco tsu
E
Clock Period
© 2000 Altera Corporation
8
fmax Analysis
Select fmax
Worst fmax
Destination Register
Quartus Detected Clock
fmax values are listed in ascending order. The worst fmax is listed on the top.
© 2000 Altera Corporation
9
fmax Analysis
Expand to see the source registers feeding the selected destination register
Source registers and associated fmax values
Timing Analysis By Default Lists 10 Worst Paths– Can Change in Project -> Timing Settings (discussed later)
© 2000 Altera Corporation
10
fmax Analysis
Highlight & right mouse and select List Paths
To Analyze the Path More Closely
The steps above are similar for all timing path analysis in Quartus
© 2000 Altera Corporation
11
fmax Analysis
Data Delay (B)
Source Register Clock Delay (C)
Setup Time (tsu)
B
C
tco tsu
E
Clock Period
Destination Register Clock Delay (E)
Clock to Output (tco)
1
0.33 ns + 11.257 ns + 0.45 ns + 0.00= 83.08 MHz
Messages Window (System Tab) in Quartus
© 2000 Altera Corporation
12
fmax Analysis
Interconnect Delay
Cell Delay Running Total
The convention above is similar for all timing path analysis in Quartus
This signal path consists of 11 locations
Destination Cell
© 2000 Altera Corporation
13
0.000 ns + 0.191 ns = 0.191 ns0.000 ns is the carry chain delay (interconnect delay)0.191 ns is the combinatorial delay
Note:If the delay path involves a carry chain, you can only see the delay path value in the Floorplan when the Floorplan is set to Logic Cell View. LAB View does not show that delay path.
0.191ns is equalto the carry chain delayplus combinatorial delay
Floorplan:Logic Cell View
Carry Chain in Data Delay Path
© 2000 Altera Corporation
14
Highlight path
Right click & select Locate
Locate Delay Path in Floorplan
The steps above are similar for all timing path analysis in Quartus
© 2000 Altera Corporation
15
11.257 ns is thetotal register to register delay path
Locate Delay Path in Floorplan
© 2000 Altera Corporation
16
Fmax (incl. delays to/from pins)
System Fmax = 1 / (the longest of the 3 following delays: Clock Period, Input Pin Period, Output Pin Period)
Clock Period = C + tco + B - E + tsu
Input Pin Period = External Input Delay + A - C + tsu
Output Pin Period= E + tco + Q + External Output Delay
A
C
tco tsu
EExternal
Input DelayExternal
Output Delay
Clock PeriodInput Pin Period Out Pin Period
B Q
© 2000 Altera Corporation
17
Input Pin Period
Input Pin Period = External Input Delay + A - C + tsu
A
C
tsu
ExternalInput Delay
Input Pin Period
Value entered in Quartus (shown later)
© 2000 Altera Corporation
18
External Input Delay
External Input Delay is used to model the delay between an imaginary register and a register inside an Altera device
External Input Delay = EC + tco + ET
Input Pin Period = External Input Delay + A - C + tsu
EC
ET A
C
tco tsu
Altera DeviceExternal Input Delay
Imaginary Register
© 2000 Altera Corporation
19
Output Pin Period
Output Pin Period = E + tco + Q + External Output Delay
tco
ExternalOutput Delay
Output Pin Period
Q
E
Value entered in Quartus (shown later)
© 2000 Altera Corporation
20
External Output Delay
External Output Delay is used to model the delay between a registered output from an Altera device to an imaginary register
External Output Delay = ET + tsu - EC
Output Pin Period = E + tco + Q + External Output Delay
E
Q ET
tco
dst
External Output DelayAltera Device
EC
Imaginary Register
tsu
© 2000 Altera Corporation
21
Fmax (incl. delays to/from pins)
Select fmax (incl. Delays to/from pins)
Fmax values
The worst fmax is shown at the top by default.
External Delay is shown in Messages Window after List Path
© 2000 Altera Corporation
22
Setting External Input/Output Delay
Default (Global) External Delay for all I/Os
1) Project -> Timing Settings
2) Select Default External Delays
3) Set Delay Value(s)
© 2000 Altera Corporation
23
Setting External Input/Output Delay
Individual Pin(s)
1) Tools -> Assignment Organizer
2) Locate Pin(s)
3) Select Timing from Assignment Categories
3) Set Delay Value(s) for Pin(s)
© 2000 Altera Corporation
24
Setup Time Analysis
Clock delay
tsu
Data delay
tsu = data delay - clock delay + intrinsic tsu
intrinsic tsu
© 2000 Altera Corporation
25
Setup Time Analysis
All Registers Fed by Pin
Clock NameSelect tsu
Input Pin Name
The greatest setup time is shown at the top by default.
© 2000 Altera Corporation
26
thold Analysis
Clock delay
thold
Data delay
thold = clock delay - data delay + intrinsic thold
intrinsic thold
© 2000 Altera Corporation
27
thold Analysis
Register Name
Clock NameSelect th
Input Pin (Data) Name
Negative hold times are shown as “<= 0”
The longest hold time is shown at the top by default.
© 2000 Altera Corporation
28
tco Analysis
Data delay
tco
Clock delay
clock delay + intrinsic tco + data delay = tco
intrinsic tco
© 2000 Altera Corporation
29
tco Analysis
Output Pin Name
Clock Name
Select tco
Register Name
The slowest clock-to-output time is shown at the top by default.
© 2000 Altera Corporation
30
Used to Limit Which Paths Are Displayed by Timing Analyzer
Two Ways to Set Options– Project -> Timing Settings -> Other Requirements & Options– Project -> Timing Wizard
Examples– Cut Off Feedback From I/O Pins (next slide)– Cut Off Clear and Preset Signal Paths
• If checked, Quartus Will Not Analyze Register Clear and Preset Delays
– Cut Off Read During Write Signal Paths• Turn ON if Read During Write is an Invalid Path
Timing Analysis Options
© 2000 Altera Corporation
31
Option: Cut Off Feedback from I/O Pin
clk
Q DA
Register 1 Register 2
Global Timing Option: Cut off feedback from I/O Pin Used to break I/O pin from the analysis When on, paths A and B are valid. C is not valid. When off, paths A, B, and C are valid.
I/O
Pin
C
B
© 2000 Altera Corporation
32
Timing Analysis Options
© 2000 Altera Corporation
33
Used to Limit How Many Paths Are Displayed by Timing Analyzer
How to Set Option– Project -> Timing Settings -> Timing Analysis Reporting
Examples– Show “XX” Source Nodes Per Destination Node
• Controls by Number How Many Paths Are Displayed– Exclude Paths With fmax Greater Than “XX”
• Controls by Parameter Value (fmax) How Many Paths Are Displayed
– Exclude Paths For tsu, tco, thd Also
Timing Analysis Options
© 2000 Altera Corporation
34
Timing Analysis Options
List 10 Paths
List Paths with fmax less than 50 MHz
List Paths with tsu greater than 3 ns
© 2000 Altera Corporation
35
Single Clock Timing Analysis
The timing analysis that we just went over can be classified as a single clock frequency analysis
Single clock frequency analysis is automatically done during each compile
Quartus will automatically detect clocks if no assignments are made– More information about clock assignments is coming up in multi-
clock timing analysis
Check results in Report Window
© 2000 Altera Corporation
36
Timing Assignments
Timing assignments have two impacts on designs – 1. During timing analysis, they specify required times the design
is measured against– 2. During compilation, they become timing requirements which
Quartus has to meet when performing timing driven compilation (TDC)• Note: by default, TDC is on
5 types of timing assignments exist:– fmax, tsu, thold, tco, tpd
These timing assignments can be assigned globally or locally
© 2000 Altera Corporation
37
Examples of Timing Assignments
fmax timing assignment
The values are BLACK, because Actual fmax meets the Required fmax
tsu timing assignment. The numbers are RED, because the Actual tsu does not meet the Required tsu
Timing Assignments used in Timing Analysis
© 2000 Altera Corporation
38
Timing Driven Compilation
Timing Driven Compilation (TDC) directs the compiler to synthesize and place logic to meet timing specified requirements– Critical paths will be placed closer together in the device
Optimize for I/O Timing and/or Internal Timing
Choose Normal or Extra Effort (works harder & takes longer)
© 2000 Altera Corporation
39
Global Assignment: Timing Settings
For a design with separate clocks, you can enter the required fmax. The Default required fmax will be applied to each individual clock in the design.
Global Clock Assignment for a single clock design
© 2000 Altera Corporation
40
Global Assignments - Timing Settings
Global tsu. All input or bidirectional pins are measured against this tsu requirement
Global tpd. All pin-to-pin delays are measured against this tpd requirement
Global tco. All registers driving outputs or bidirectional pins are measured against this tco requirement
Global th. All input or bidirectional pins are measured against this th requirement
© 2000 Altera Corporation
41
Individual Assignments
tsu (setup time) and th (hold time) assignments– Single point assignment– Point-to-point assignment
tco (clock-to-out) assignment– Single point assignment– Point-to-point assignment
© 2000 Altera Corporation
42
Timing Assignments
What can be tagged with a timing assignments?– Registers (all)– Clock Pins (all)– Input Pins (tsu, th)– Output Pins (tco)– Bidirectional Pins (all)
© 2000 Altera Corporation
43
Assign single point setup/hold requirement to the data pin
Setup/Hold Requirements
Assignments can be either single point or point-to-point Single point setup/hold requirements
– States that the setup/hold time is required on every register that the pin feeds
© 2000 Altera Corporation
44
Assign point-to-point setup requirement to the input pin and the destination register
Setup/Hold Requirement: Point-to-Point
The setup/hold time is required only for the specified path
Reg1
Reg2data0
© 2000 Altera Corporation
45
......
Clock To Out Requirements
Either a single point or a point-to-point assignment Same idea as setup/hold time requirements Tco requirement on a clock pin
– Means that all Tco paths that start from the specified clock must meet this requirement
© 2000 Altera Corporation
46
Clock To Out Requirements
tco requirement on an output pin– Means that all paths from clocks to the specified output pin must
meet this requirement
© 2000 Altera Corporation
47
Clock To Out Requirements
Point-to-point tco requirement– Can specify that all paths that go from a specific clock pin to a
specific output pin must meet this requirement
© 2000 Altera Corporation
48
Example: Assign Setup Requirement
Step 2: Select Timing from the Assignment Category box
Step 3: Choose tsu Requirement from the drop-down list in the Settings section
Step 1: Enter the data pin name or use the Node Finder to locate data pin name and/or register name
Menu Bar: Tools > Assignment Organizer...
© 2000 Altera Corporation
49
Example: Assign Setup Requirement
Step 4: Type in the setup requirement
Step 6: Click Add to add the assignment
Step 5: Use Fed by: to create a point-to-point requirement
© 2000 Altera Corporation
50
Multi-Clock Frequency Analysis
Allows user to analyze timing for a design containing register-to-register paths which are controlled by different clocks– Unless Specified, Quartus Treats Individual Clocks As Having the
Same Frequency and Phase
clk1
tco tsu
Combinatorial logic
clk2
capturing edge
launching edge
clk1
clk2
dataRegister 1 Register 2
© 2000 Altera Corporation
51
Slack Between Two Clock Domains
Slack is used to keep track of the delay between Register 1 and Register 2Positive Slack– If the slack is positive, then the data from Register 1 will meet the
setup time of Register 2
Negative Slack– If the slack is negative, then the data from Register 1 will violate
the setup time of Register 2
clk1
tco tsu
Combinatorial logic
clk2
dataRegister 1 Register 2
© 2000 Altera Corporation
52
Equation for Slack
Slack = Required Time - Actual TimeSlack = Slack Clock Period - ( Intrinsic tco + Data Delay + Intrinsic tsu )
launching edge
clk1
clk2
capturing edge
Slack clock period
clk1
tco tsu
Combinatorial logic
clk2
dataRegister 1 Register 2
data delay
© 2000 Altera Corporation
53
Calculating Slack in Quartus
In order for Quartus to calculate the Slack between registers, timing assignments need to be entered by the user
IMPORTANT: The slack section inside the compilation report file does not appear automatically for a multi-clock design – Timing assignments need to take place first
© 2000 Altera Corporation
54
Slack Analysis: Steps to Follow
Follow the steps below to prepare Quartus for Slack Analysis– Create Clock Settings
• Define a base clock• Define other clock/s that is/are relative to the base clock
– Assign Clock Settings to actual clocks– Recompile design– Look at result in the slack timing table
© 2000 Altera Corporation
55
Create Clock Settings
Minimum of 2 clock settings exist for a multi-clock design:– One is a base clock– Second is a derived clock referenced to a “base” clock
• Derived clocks can be any ratio (m/d) of base clock plus an added offset, if desired.
Note: If the design has more than 2 clocks, additional derived or base clocks can be created
offset
capturing edge
launching edge
base clock
derived clock
derived clock = base clock x (m/d) + offset
© 2000 Altera Corporation
56
Create Clock Setting: Base Clock
Menu Bar: Project > Timing Settings...
Step 1: Click New to Add New Setting
© 2000 Altera Corporation
57
Create Clock Setting: Base Clock
Menu Bar: Project > Timing Settings...
Step 2: Enter the name of the clock setting
Step 3: Select Independent of other clock settings
Step 4: Adjust fmax and Duty Cycle
Step 5: Click OK to Add Setting
© 2000 Altera Corporation
58
Create Clock Setting: Derived Clock
Menu Bar: Project > Timing Settings...
Step 1: Click New to Add a New Setting
© 2000 Altera Corporation
59
Create Clock Setting: Derived Clock
Menu Bar: Project > Timing Settings...
Step 2: Enter the Name of the Derived Clock Setting
Step 3: Select clock setting that this derived clock is based on
Step 4: Click on Derived Clock Requirements
© 2000 Altera Corporation
60
Create Clock Setting: Derived Clock
Step 5: Adjust ratio and offset. The derived clock duty cycle is not affected by the multiply base or the divide base. Invert base clock is also available. Click OK when done.
Step 6: Click OK to Add Setting
© 2000 Altera Corporation
61
Current Clock Settings
At this point, an absolute clock setting called base clock and a derived clock setting called derived clock have been created. The next step is to apply these clock settings to the actual clock nets.
Absolute clock settingcalled base
Derived clock settingcalled derived
© 2000 Altera Corporation
62
Slack Analysis: Steps to Follow
Follow the steps below to prepare Quartus for Slack Analysis– Create Clock Settings
• Define a base clock• Define other clock/s that is/are relative to the base clock
– Assign Clock Settings to actual clocks– Recompile design– Look at slack results in compilation report file
© 2000 Altera Corporation
63
Assign Absolute Clock Settings to Clock
Menu Bar: Tools > Assignment Organizer... Step 1: Enter the name of the clock pin. The naming convention is: |<project name>|<name> of the pin>
or click on the Node Finder to select the clock pin
Step 2: Click on Timing and select Clock Setting
Step 3: Select Base Clock Settings for this specific clock pin. Click on Add
Derived Clock Setting:Repeat Step 1 to Step 3 for the derived clock setting
© 2000 Altera Corporation
64
Slack Analysis: Steps to Follow
Follow the steps below to prepare Quartus for Slack Analysis– Create Clock Settings
• Define a base clock• Define other clock/s that is/are relative to the base clock
– Assign Clock Settings to actual clocks– Recompile design– Look at slack results in compilation report file
© 2000 Altera Corporation
65
Recompile Design & View Slack Information
Recompile design
Slack
During compilation,slack information is reported in the message window
© 2000 Altera Corporation
66
Slack Distribution
IMPORTANT: Negative Slack Timeneeds to be corrected in orderfor the design to work
Select
Determine if any and/or how many nodes receive a negative slack?
© 2000 Altera Corporation
67
Slack Time Table
Slack Time Table offers more details about the source nodes and destination nodes– Positive slack means the timing was met– Negative slack shows by how much the timing was not met– IMPORTANT: Design needs to be altered or multi-cycle timing
requirement/s is/are needed to resolve the negative slack issues
Negative slack times show up in red and are listed at the top of the table
Select
© 2000 Altera Corporation
68
Slack Analysis: Steps to Follow
Follow the steps below to prepare Quartus for Slack Analysis– Create Clock Settings
• Define a base clock• Define other clock/s that is/are relative to the base clock
– Assign Clock Settings to actual clocks– Recompile design– Look at slack results in compilation report file
© 2000 Altera Corporation
69
Multicycle Paths
Signal Paths That Intentionally Require More Than One Cycle to Become Stable– Must Be Considered in Design Implementation
Declaring a Multicycle Path Tells the Timing Analyzer to Account for Multiple Clock Edges Between Nodes or Clock Domains
launching edge
base clock
derived clock
capturing edge
© 2000 Altera Corporation
70
Assigning Multicycle Paths
Destination Register– Multi-cycle assignment is applied to all signal paths feeding
register
Register-to-Register– Point-to-point assignment that applies to one source register and
one destination register
Two Clock Domains– Assignment applies to all signals that travel from one clock
domain to another
launching edge
base clock
derived clock
capturing edge
© 2000 Altera Corporation
71
Comparable Offset vs. Clock Period
If the value of your offset is comparable to the value of the clock period, then a multi-cycle assignment on the derived clock is usually unnecessary.– ex. offset = 11ns, clock period = 20ns
offset
capturing edge
launching edge
base clock
derived clock
© 2000 Altera Corporation
72
Relatively Small Offset vs. Clock Period
If the offset value is relatively small compared to the clock period, then a multi-cycle assignment is usually necessary on the derived clock – Ex. Clock period = 10ns, offset = 2ns– The offset can be thought of as clock skew
offsetoffsetIntended capturing edge
launching edge
However, by default, Quartus assumes this is the capturing edge
base clock
derived clock
© 2000 Altera Corporation
73
launching edgetrue clock(base clock)
complement clock(derived clock)
capturing edge
Inverted Clock
If your design uses both the true and complement of the same clock signal, then a multi-cycle assignment is not necessary– You can assign the true clock as the base clock– You can assign the complement as the inverse of the base clock
© 2000 Altera Corporation
74
base clock(source)
derived clock(destination)
Non-Integer Multiples
If the design clocks are non-integer multiples of each other, then a multi-cycle assignment may be necessary– Quartus analyzes two closest edges of base & derived clocks
Ex. base clock = derived clock * 3/4
These two edges are most likely to cause a setup violation of the destination register
© 2000 Altera Corporation
75
base clock(source)
derived clock(destination)
Non-Integer Multiples
If the design clocks are non-integer multiples of each other, then a multi-cycle assignment may be necessary– Quartus analyzes two closest edges of base & derived clocks
launching edge
capturing edge
12
Ex. base clock = derived clock * 3/4
© 2000 Altera Corporation
76
Multi-Cycle Assignment
Multi-cycle assignment on the derived clock indicates the capturing edge is not the closest rising edge.
offsetoffsetcapturing edge
launching edge
Multi-cycle assignment indicates this is the capturing edge
base clock
derived clock
1) For multi-cycle assignments, the capturing edge is the reference edge
2) The base clock is the reference clock for counting the number of edges between the capturing edge and launching edge
12
© 2000 Altera Corporation
77
Making a Multi-Cycle Assignment
1) Choose Timing and Multicycle from the Assignment List
Menu Bar: Tools > Assignment Organizer...
2) Specify the number of edges
3) Use Fed by if creating two clock assignment or point-to-point
© 2000 Altera Corporation
78
Easy way to enter timing assignments Consolidates all timing assignments in one menu
– Individual clock settings OR overall circuit frequency
– Default system timing
• tsu
• th
• tco
• tpd
– Default external input/output delays
– Enable/Disable timing analysis
during compilation
– Timing driven compilation
Timing Wizard
© 2000 Altera Corporation
79
Summary
Timing analysis for a single clock system– Registered Performance– Setup Time– Hold Time– Clock-to-Out
Making Timing Assignments Multi-clock timing analysis Multi-cycle timing assignments Timing Wizard