07 Introduction To Clock Constraints
07 Introduction To Clock Constraints
Abstract
This lab reviews the process of creating and generating clocks.
This lab supports both Verilog and VHDL design files. However, the lab instructions and graphics
are limited to Verilog usage.
This lab should take approximately 25 minutes.
Objectives
After completing this lab, you will be able to:
Create clocks by using the Timing Constraints window
Associate jitter specification to a created clock
Generate a clock report (report_clock)
Implement the design
www.xilinx.com 1
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
Introduction
The wave_gen design used in this lab is a programmable waveform generator.
This design records specific information via RS-232 serial communication and stores this data in
memory. After data has been stored, it can be retrieved via the RS-232 communications channel,
or played out via a bank of LEDs or a DAC. The wave_gen design implements the RS-232 com-
munication channel, the waveform generator and connection to the external DAC, and a simple
parser to implement a small number of "commands" to control the waveform generation.
This lab will show you how to create clocks and generate clock constraints using the Timing
Constraint window. You will use report_clocks to understand the clocks that are used in the de-
sign. This lab will also review the process of generating and reading static timing analysis re-
ports.
The diagram below shows the systematic approach recommended for applying timing con-
straints and incrementally progressing towards closure. There are three broad stages in the Per-
formance Baselining procedure recommended by Xilinx, which enables the designer to achieve
timing closure progressively.
www.xilinx.com 2
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
This lab will focus on optimizing internal paths (Baseline) as explained in the below figure:
Define all primary clocks and generated clocks. Check for the clocks in the design (pe-
riod, edge relationships).
Specify asynchronous (unrelated) clock groups: All clocks are assumed to be related to
each other unless otherwise specified. The phases between any two clocks are derived
from their individual clock definitions; timing paths between such clock domains are ana-
lyzed using these derived requirements. To avoid this redundant timing analysis and re-
porting of timing failure, asynchronous clock groups need to be specified. When there
are such asynchronous inter-clock paths specified, the design must use appropriate syn-
chronization techniques to capture data reliably at the target clock domain.
Note: Specifying asynchronous clocks step is covered in "Applying Clock Groups Constraints"
topic.
With a complete clock definition as above, all FPGA internal paths (single-cycle paths)
can be analyzed for timing. The feasibility of closing timing for the single-cycle internal
paths can be assessed with reasonable confidence.
www.xilinx.com 3
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
General Flow
Step 3:
Step 1: Step 2: Step 4: Step 5:
Creating the
Opening Generating Creating a Implement-
Clock &
the a Clock Generated ing the
Specifying
Project Report Clock Design
Jitter
4 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
2-1. [Linux users]: Launch VirtualBox from the Start menu and start the
Ubuntu_VM virtual machine.
3-2. [Linux users]: Copy the files from the shared Windows folder to your
training directory using the following Linux command.
[host]$ source /media/sf_training/setup_TopicCluster.sh Clk-
Constr_Intro
If you do not recall how to perform these tasks, refer to the "Board, OS, COM,
and IP Address Tasks" section in the Lab Reference Guide.
There are a number of ways to launch the Vivado Design Suite. The two most
popular mechanisms are shown here.
4-3. This can be done in two standard ways, use your preferred method.
5-4-1. [Windows 7 users]: Select Start > All Programs > Xilinx Design Tools > Vivado
2018.3 > Vivado 2018.3.
Figure 7-3: Launching the Vivado Design Suite from the Start Menu
[Windows 10 users]: Select Start > Xilinx Design Tools > Vivado 2018.3.
You can also double-click the Vivado Design Suite shortcut icon ( ) from the Win-
dows desktop.
www.xilinx.com 5
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
[Linux users]: Press <Ctrl + Alt + T> to open a new terminal window, type vivado, and
press <Enter> to launch the Vivado Design Suite environment.
The Vivado Design Suite opens to the Welcome window. From the Welcome window you
can create a new project, open an existing project, or enter Tcl commands directly into
the Vivado Design Suite as well as access documentation and examples.
6 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
www.xilinx.com 7
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Question 1
Are there are any constraints currently in the design?
14-13-8. Click X in the text editor window to close the opened XDC file.
8 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
www.xilinx.com 9
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Note: For 7 series users, the graphic will be slightly different with respect to the MMCM
primitive name, clock buffer names, and fanouts.
27-25-17. Click the Restore icon in the Clock Networks -report_1 window.
28-26-18. Close the Clock Networks tab.
10 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
www.xilinx.com 11
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
34-31-21. Click Reference to read the command reference about the selected command,
i.e., create_clock.
35-32-22. Click Close in the Command Reference: create_clock dialog box.
36-33-23. Enter clk_pin_p in Clock name field.
12 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
www.xilinx.com 13
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
45-42. Describe the period property and review the waveform details of the clock
object.
46-43-31. Enter the period value in the Period field under the Waveform section in the
Create Clock dialog box.
KCU105 users: Enter 3.333 ns to specify a clock of 300 MHz.
KC7xx users: Enter 5.000 ns to specify a clock of 200 MHz.
47-44-32. Ensure that the Rise at field is set to '0' and Fall at field is set to half of the given
period to have 50% duty cycle.
Figure 7-11: Create Clock Dialog Box after Defining clk_pin_p Port as a Clock Object
14 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
Notice the create_clock XDC command for the created clock in the All Constraints
section of the Timing Constraints window.
49-46. Assume the clock is ideal and enter the clock input jitter information.
50-47-34. Double-click Clocks (1) > Set Input Jitter using the Timing Constraints window.
The Set Input Jitter Dialog box opens.
51-48-35. Enter 0 in the Input Jitter field assuming that the clock is ideal.
Note: 0 is the default value for jitter; therefore, this specification is redundant. It is shown
here for completeness.
www.xilinx.com 15
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Figure 7-13: Specify the Clock for Input Jitter Dialog Box
16 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
www.xilinx.com 17
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Question 2
In addition to clk_pin_p, there are three more clocks (CLKFBOUT, CLK_OUT2, and CLKOUT1) in
the report. Are these clocks expected?
67-63. Launch the Create Generated Clock dialog box and associate the clock name
as clk_samp.
68-64-48. Double-click Clocks (2) > Create Generated Clock in the Timing Constraints
Window.
The Create Generated Clock dialog box opens.
69-65-49. Enter clk_samp in the Clock name field.
71-67-50. Click the icon next to the Master pin (source) field.
18 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
79-75. Specify clk_samp as a derived waveform with 1/32 frequency of the source
clock.
80-76-58. Select the By clock frequency option under the Derive from Source Clock
Waveform section, if it is not already selected.
81-77-59. Enter 32 as the division factor in the Divide source clock frequency by option.
20 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
90-86. Create a clk_samp object and review the generated clock properties.
The Create Generated Clock dialog box should look like the figure below after
completing the above steps.
www.xilinx.com 21
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Question 3
Is the period of clk_samp what you expected? Why or why not?
Question 4
Are there constraints in the XDC file? If not, where are the constraints that you specified?
22 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
www.xilinx.com 23
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Question 5
How many clock paths are constrained in this design?
24 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
Question 6
Are these timing errors expected? Why or why not?
115-110-87. Press <F4> to create the schematic of the first timing path.
Note that the clock path is also visible, along with the data path in the schematic.
If the icon is not selected, the clock path is not shown in the schematic.
Figure 7-22: Schematic of the Timing Path (KCU105) - Example (Your Schematic May Differ)
Figure 7-23: Schematic of the Timing Path (KC7xx) - Example (Your Schematic May Differ)
The clock path and data path have been highlighted in the graphic for better under-
standing.
116-111-88. Double-click the selected path in the Timing Summary window to view the
detailed path report.
www.xilinx.com 25
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
117-112-89. Maximize or float the Path Report to look at the path details.
26 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
Note: This is an example timing summary report. Your results may very depends on
which Vivado Design Suite version you are using.
Figure 7-24: Timing Path Report for First Path of clk_out1_clk_core (KCU105)
www.xilinx.com 27
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Figure 7-25: Timing Path Report for First Path of clk_out1_clk_core (KC7xx)
Note: The timing may vary slightly in the above mentioned timing path reports.
The timing path report provides a detailed summary of the timing path covered by the
specific clock path group. When you click the links in the report, the logic objects are se-
lected in other views.
It provides the detailed information of the logic objects in the path and their associated
delays for the source clock path, data path, and the destination clock path. The details of
the timing path report are as follows.
o Summary: Provides brief information about the timing path and reports slack for the
timing path endpoints. The slack is the difference between the data required time
and the data arrival timing at the path endpoint.
o Source Clock Path: Provides the detailed information of the logic objects in the path
and their associated delays for the source clock path. This source clock path is the
path followed by the source clock from its source point to the clock pin of the
launching flip-flop.
o Data Path: Provides the detailed information of the logic objects in the path and
their associated delays for the internal circuitry, between the launching and capturing
flip-flops. The active clock pin of the launching flip-flop is called the path startpoint.
The data input pin of the capturing flip-flop is called the path endpoint.
28 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
o Destination Clock Path: Provides the detailed information of the logic objects in the
path and their associated delays for the e destination clock path. The destination
clock path is the path followed by the destination clock from its source point,
typically an input port, to the clock pin of the capturing flip-flop.
118-113-90. Extract the information required for the table below.
Hint: Look in the Summary section of the path report.
119-114-91. Repeat the steps to extract information for the path covered by the
clk_out2_clk_core clock group. Make sure you choose the first path.
120-115-92. Examine the timing results. Verify the slowest paths for the two clock groups.
Question 7
Record and verify the startpoint, endpoint, slack, and data path delay of the slowest path for the
following clock groups.
Data Path
Clock Group Source Destination Slack
Delay
clk_out1_clk_core
clk_out2_clk_core
The timing analysis at this stage is only for the internal paths of the FPGA, and I/O timing
has not yet been specified for analysis. From the timing summary report, it can be seen
that only some clk_out1_clk_core domain paths under Intra-Clock Paths are failing as of
now. From the source and destination of these paths and an understanding of the
wave_gen design, it can be seen that these long paths are designed as multicycle paths.
You will apply multicycle paths in a later lab to close this timing.
121-116-93. Click the Restore icon or Dock icon in the window banner to restore the Path
Properties window.
Summary
Through this lab, you have learned how to use the Timing Constraints window to define clocks
in the design. You also learned how to view the clocks in the design by using the
report_clocks command from the Tcl Console and how to generate a timing report through
the GUI.
www.xilinx.com 29
© Copyright 2019 Xilinx
Introduction to Clock Constraints Lab Workbook
Answers
Answers listed represent sample solutions only. Your results may differ depending on the ver-
sion of the software, service pack, or operating system that you are using.
2. In addition to clk_pin_p, there are three more clocks (CLKFBOUT, CLK_OUT2, and CLKOUT1)
in the report. Are these clocks expected?
Yes, they are the MMCM generated clocks for which clock definitions have been
automatically derived.
The reported period of clk_samp is 165, which is expected. The period clk_samp is 32 times
to its source pin, which is nothing but CLKOUT2. The period of CLKOUT2 is 5.161. The
clk_samp reported period is (5.161*32).
4. Are there constraints in the XDC file? If not, where are the constraints that you specified?
There are no constraints in the wave_gen_timing.xdc file because all the constraints created
so far were saved in memory and they have not been saved to file. You need to save the
created constraints to the XDC file before closing the database.
From the report_clock command you observed that there are five clocks in the design.
The clk_pin_p clocks and the clkfbout_clk_core clock do not have any timing paths
associated to them. Hence, the Vivado Design Suite has analyzed and generated timing
reports for all three clock paths. The Vivado Design Suite has also reported the timing paths
that are also not covered under these clock paths.
7. Record and verify the startpoint, endpoint, slack, and data path delay for the slowest path for
the following Clock Groups.
Note that there might be differences in the timing values (and hence the timing paths)
based on the OS and Vivado Design Suite version used.
30 www.xilinx.com
© Copyright 2019 Xilinx
Lab Workbook Introduction to Clock Constraints
It can be seen that only clk_out1_clk_core domain paths under the Intra-Clock Paths section
have negative slack.
KCU105 Users
Data Path
Constraint Source Destination Slack
Delay
char_fifo_i0/U0/
inst_fifo_gen/
gconvfifo.rf/gbi.bi/
v8_fifo.fblk/
cmd_parse_i0/
clk_out1_clk_core rst_val_sym.gextw_sym[1 0.336 ns 4.404 ns
send_resp_type_reg[0]/CE
].inst_extd/
gonep.inst_prim/
gf18e2_inst.sngfifo18e2/
WRCLK
clk_gen_i0/clk_div_i0/ clk_gen_i0/
clk_out2_clk_core 0.983 ns 3.187 ns
en_clk_samp_reg/C BUFGCE_clk_samp_i0/CE
KC7xx Users
Data Path
Constraint Source Destination Slack
Delay
cmd_parse_i0/
resp_gen_i0/to_bcd_i0/
clk_out1_clk_core send_resp_data_reg[11]/ -1.918 ns 6.791 ns
bcd_out_reg[6]/D
C
dac_spi_i0/
dac_spi_i0/
clk_out2_clk_core out_ddr_flop_spi_clk_i0/ 0.982 ns 1.141 ns
old_old_active_reg/C
ODDR_inst/D2
www.xilinx.com 31
© Copyright 2019 Xilinx