Documente Academic
Documente Profesional
Documente Cultură
Lab Workbook
fpga-vdes1-2018.1-wkb-lab-rev1
Table of Contents
www.xilinx.com i
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
Abstract
This lab provides a basic overview of the project-based design flow supported by, as well as the
simulation environment in, the Vivado® Integrated Design Environment (IDE).
This lab supports both Verilog and VHDL design files. However, the lab instructions and figures
show only Verilog usage.
This lab should take approximately 30 minutes.
Objectives
After completing this lab, you will be able to:
Create a new project by using the New Project Wizard from the Vivado IDE
Add design source files to the Vivado IDE project
Add simulation source files to the Vivado IDE project
Explore various Vivado IDE views and layouts
Evaluate the project settings
Simulate a design by using the Vivado simulator
Introduction
This lab guides you through the process of creating a new project and simulating it by using
existing RTL source files that describe a UART-based design called uart_led. The uart_led design
implements the RS-232 protocol, which receives serial data and displays its equivalent binary
value on LEDs.
www.xilinx.com 3
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
In order to get their design to work properly, many designers would say that they need to
backtrack in this process and repeat certain steps. Many designers would also lock their pins
earlier in the design flow. This flow is to illustrate the steps you will follow in this lab.
This lab explains how to create a new project, add existing design source files and design
constraints, add simulation source files (test benches) and simulate the design using the Vivado
simulator.
General Flow
Step 1: Step 2: Step 3: Step 4:
Creating Adding Exploring Simulating
a New Simulation the the
Project Source Files Vivado IDE Design
4 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
Figure 1-1: Launching the Vivado Design Suite from the Start Menu
For Windows 10: Select Start > Xilinx Design Tools > Vivado 2018.1.
-- OR --
www.xilinx.com 5
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
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.
o Create Project opens the New Project Wizard to guide you through creating various
supported project types.
o Open Project opens Windows Explorer, allowing you to browse to an existing project
location and then open the project.
o Open Example Project allows you to open any of the provided example projects.
o Manage IP opens the IP catalog for customizing and managing IP.
o Open Hardware Manager opens the Vivado Design Suite hardware manager for
programming a design into a device. The Vivado logic analyzer and Vivado serial I/O
analyzer features of the tool enable users to debug a design.
6 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
o Xilinx Tcl Store provides access to multiple scripts and utilities contributed from
different sources, which solve various issues and improve productivity. You can install
Tcl scripts and also contribute Tcl scripts to share your expertise with others.
o Documentation and Tutorials, Quick Take Videos, and Release Notes Guide in
the Information Center section open the Documentation Navigator. The
Documentation Navigator is integrated with the Vivado Design Suite, and it provides
a catalog of Xilinx documentation and videos. The Release Notes Guide link opens
the Release Notes, Installation documentation, and Licensing user guide. The Release
Notes provides information about what's new in this version of the Vivado Design
Suite.
Question 1
What are the different types of example projects provided by the Vivado Design Suite?
www.xilinx.com 7
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
1-3. You will now encounter a series of dialog boxes asking you to enter
different pieces of information describing the project.
1-3-1. Enter uart_led in the Project name field.
1-3-2. Enter C:\training\Project_Flow\lab\[KCU105 | KC705]\[verilog | vhdl] in the Project
location field.
Alternatively, you can use the browse feature to navigate to where you want the project
to reside.
Note: If you prefer to use Verilog source files for creating the project, select Verilog in
the Project location directory. If you prefer to use VHDL source files, select VHDL. The
source files for creating the new project are provided in both Verilog and VHDL.
1-3-3. Deselect the Create Project Subdirectory option as leaving this checked will create an
unnecessary level of hierarchy for the lab.
1-3-4. Click Next to accept the selections and advance to selecting a type of project.
The Project type dialog box invites you to choose between different project types that
can be created.
Question 2
What are the various types of projects that can be made with the New Project Wizard?
Question 3
What is the purpose of the Do not specify sources at this time option?
8 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
1-3-5. Select RTL Project since this project will be based on source code (rather than a netlist)
(1).
This enables you to add or create new HDL files and synthesize them, whereas a post-
synthesis project requires pre-synthesized files.
1-3-6. Since you will be adding RTL files in the next instruction, deselect the Do not specify
sources at this time option (2).
1-3-7. Click Next to accept the selection and advance to the adding sources stage (3).
www.xilinx.com 9
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
1-4-2. Select Add Files from the pop-up menu to begin adding your source files to the project.
After you add all the necessary files, the remainder of this dialog box will be addressed.
The Add Source Files dialog box opens.
1-4-3. Browse to the C:\training\Project_Flow\lab\[KCU105 | KC705]\[verilog | vhdl] directory (1).
10 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
The Add Source Files dialog box closes and brings you back to the Add Sources dialog
box.
1-5. Add any existing IP modules to the Vivado Design Suite project.
KCU105 users: Since there are no IP modules required for this design, click Next
and skip to the instruction that begins with "Add any existing constraints files to
the Vivado Design Project".
KC705 users: Add the clk_core IP in this design by using the steps below.
The clock_core IP is a clock management block (HDL code) that takes an input
clock of a certain frequency and generates output clock(s) with the desired
frequency using certain FPGA resources (MMCM and PLL). In the uart_led design
targeting the KC705, the clock core IP has been added so that the design meets
the timing requirements. When the design is targeting the KCU105, this IP is not
required to meet the timing requirements.
1-5-1. Click the Plus icon ( ) again to select the IP files.
1-5-2. Select Add Files to open the Add Source Files dialog box.
1-5-3. Select clk_core.xci.
1-5-4. Click OK to accept the selected files and add them as sources to the project.
If you have additional files located in other directories, you can repeat this instruction for
each directory.
1-5-5. Confirm that the Scan and add RTL include files into project option is selected (used
for Verilog only; it has no effect for VHDL) in the Add Sources dialog box (1).
This will automatically pull in any include files used by Verilog sources.
www.xilinx.com 11
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
1-5-6. Confirm that the Copy sources into project option is selected (1).
This will make a local copy of the source in the project space. Selecting this option
enables you to make changes to the local copy without affecting the original source file.
1-5-7. Make sure that your preferred language is selected from the Target Language drop-
down list (2).
This choice only affects which language is used for the generation of templates and
wrappers. You can add files in any language regardless of which target language is
selected. If you do not generate or use any templates or wrappers, this step is irrelevant
and you can select any language.
This will make a local copy of the sources in the project space. Selecting this option
enables you to make changes to the local copy without affecting the original source file.
1-5-8. Click Next to complete the adding of RTL sources and advance to adding any constraint
files (3).
1-6. Add any existing constraint files to the Vivado Design Suite project.
You will add uart_led.xdc to the project in the following instructions.
1-6-1. Click the Plus icon ( ) to select the type of object you want to import (1).
1-6-2. Select Add Files to open the Add Constraint Files dialog box.
If you have additional files located in other directories, you can repeat this instruction for
each directory.
12 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
1-6-6. Confirm that the Copy constraints files into project option is selected (2).
This will make a local copy of the source in the project space. Selecting this option
enables you to make changes to the local copy without affecting the original source file.
Question 4
What are the different constraint types supported by the Vivado Design Suite?
1-7. Select the target part by first filtering by board and then by family. If you
are not using a supported board, you will need to filter by part.
1-7-1. Select Boards from the Select area (1).
1-7-2. Select All from the Vendor drop-down list in the Filter area (2).
This filters the available boards to those that are populated with any member of the
selected library.
1-7-3. Select Kintex UltraScale KCU105 Evaluation Platform | Kintex -7 KC705 Evaluation
platform from the board list.
Alternatively, you can select the board directly from the list at any time while in this
dialog box.
www.xilinx.com 13
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
Question 5
What are the device part numbers corresponding to the KCU105 and KC705 evaluation platform
boards?
A summary of your project is displayed. If you want to change any of the information
that you entered, you can do that now by clicking Back until you reach the correct dialog
box and making the correction, or you can create the project now and edit the project
properties and add or remove files later.
1-7-5. Click Finish.
Your project is constructed and you are presented with the Vivado Design Suite main
workspace environment.
14 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
2-1-4. Click the Plus ( ) icon and select Add Files to open the Add Source Files dialog box,
which allows you to browse to the desired directory.
2-1-5. Browse to the C:\training\Project_Flow\lab\[KCU105 | KC705]\<language> directory.
2-1-6. Verilog users: Select the following simulation source files:
o tb_fifo.v
o tb_resetgen.v
o tb_resp_checker.v
o tb_uart_driver.v
o tb_uart_rx.v
o test_uart_rx.v
VHDL users: Select the following simulation source files:
o string_utilities_sim_pkg.vhd
o string_utilities_synth_pkg.vhd
o tb_fifo_pkg.vhd
o tb_resp_checker.vhd
o tb_uart_driver.vhd
o test_uart_rx.vhd
o time_utilities_pkg.vhd
2-1-7. Click OK.
www.xilinx.com 15
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
2-1-8. VHDL users only: Associate the VHDL package files to their corresponding libraries.
2-1-9. Double-click in the Library column in front of each VHDL file and type the library name
as given below.
The utilities_lib library should have the following package files:
o string_utilities_sim_pkg.vhd
o string_utilities_synth_pkg.vhd
o time_utilities_pkg.vhd
The specific_support_lib library should have the following package files:
o tb_fifo_pkg.vhd
The remaining files go into the default sim library (xil_defaultlib):
o tb_resp_checker.vhd
o tb_uart_driver.vhd
o test_uart_rx.vhd
16 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
2-2. Analyze the hierarchy of the design using the Hierarchy tab of the Sources
window.
The Sources window displays the design sources, constraint files, simulation
sources, and IP cores of the project.
The Design Sources folder helps you keep track of Verilog and VHDL design
source files and libraries. The Constraints folder helps you manage constraint
files. The Simulation Sources folder helps you organize Verilog and VHDL
simulation source files and libraries.
Notice that the design hierarchy is shown by default.
The Hierarchy tab of the Sources window displays the hierarchy of the design
modules and instances. The top module defines the hierarchy of the design for
compilation, synthesis, and implementation. The Vivado IDE automatically detects
the top module.
2-2-1. Select the Hierarchy tab in the Sources window.
2-2-2. Click the Expand All ( ) icon to view all the files.
Question 6
What is the name of the top module in the design?
In the Libraries tab, sources are grouped by file type, while the Compile Order tab shows the
compile order used for synthesis.
www.xilinx.com 17
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
2-3. VHDL users only: Make sure that you see the correct VHDL package files
available under the utilities_lib and specific_support_lib libraries.
You should see the following structure in the Libraries tab.
18 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
The vertical toolbar present on the left of the Vivado IDE is the Flow Navigator. The
Flow Navigator view provides control over the major design process tasks, such as
project configuration, synthesis, implementation, and bitstream creation.
Note that the Flow Navigator reflects the typical FPGA design flow of design entry >
behavioral simulation > synthesis > implementation > static timing analysis >
bitstream generation. The Flow Navigator takes you from design construction (top) all
the way through implementation (middle) and ends with programming the FPGA
(bottom).
The Sources window displays the list of source files that have been added to the project.
The Sources window will automatically recognize your design’s hierarchy based on the
instantiation of components in your HDL. It also references your design constraints files
that store timing objectives and pin assignment information.
www.xilinx.com 19
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
The Compile Order tab in the Sources window displays the source files in the order in
which they will be compiled and the processing order for constraints.
The Project Summary view provides a brief overview of the status of different processes
executed in the Vivado IDE. It also provides access to the most common design reports,
such as DRC violations and timing and design information, including estimated power
consumption, design performance, device utilization, and power.
The Properties window provides the properties of a selected object. Every time you
select an element/instance from the design netlist, its information can be found here.
The Project Status (top-right corner) displays the current status of the active design.
Question 7
What is the current status of the project?
20 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
3-3. Expand the layout selector drop-down list to see if any layouts are available.
Even though there is no layout available at this stage, the Vivado IDE provides
predefined window layouts to facilitate various tasks in the design process. The
layout selector enables you to easily change window layouts.
During the later stages of this lab, when these layouts will be available to you, the
Layout Selector drop-down menu will show the following selections:
o Default Layout: Analyze your design with a minimum set of windows.
o I/O Planning: Define I/O placement constraints and place ports.
o Clock Planning: Cross-probe between the Clock Resources window, Device window,
and I/O Port window to plan and place clock resources in the design.
o Floorplanning: Define Pblocks, manage partitions, and perform hierarchical
floorplanning.
o Debug: Define debug nets and configure debug cores.
o Timing Analysis: Run timing reports and analyze timing.
Question 8
Why are layouts not available at this stage?
3-4. Briefly explore the Project Summary view for the design.
The Vivado IDE includes an interactive project summary that updates dynamically
as design commands are run and as the design progresses through the design
flow. It provides project and design information, such as the project part, project
status, and state of synthesis and implementation.
www.xilinx.com 21
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
It also provides links to detailed information, such as links to the Messages, Log,
and Reports windows as well as the Settings dialog box. As synthesis and
implementation complete, DRC violations, timing values, utilization percentages,
and power estimates are also populated.
22 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
Question 9
What settings can you configure in the Settings dialog box?
Question 10
What are the project name, project device, and target language for the design?
www.xilinx.com 23
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
Question 11
What is the target simulator for the design? What third-party simulators are supported?
24 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
Question 12
What is the synthesis strategy for this design?
www.xilinx.com 25
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
Question 13
What is the implementation strategy for this design?
26 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
3-10. Explore the Design Runs window at the bottom of the GUI.
The Design Runs window allows you to view, configure, launch, and analyze
synthesis and implementation runs.
Note: If you do not see any particular columns in the Design runs window or
would like to see more columns, right-click any column header and select the
column name you would like to add.
Each column in the Design Runs tab is used to track information as described
below:
o Name: Displays run name.
o Constraints: Displays the constraint set used for the run.
o Status: Indicates run status as not started, running, complete, or error.
o Progress: Displays the percentage complete (0 to 100%).
o Start: Reports the start time for the run.
o Elapsed: Reports the elapsed time for the run.
o Strategy: Displays the strategy assigned to the run.
o Part: Indicates the target part selected for the run.
Timing Summary Data:
o WNS: Displays worst negative slack.
o TNS: Displays total negative slack.
o WHS: Displays worst hold slack.
o THS: Displays total hold slack.
o TPWS: Displays total pulse width negative slack.
o Failed Routes: Displays the number of nets that failed to route, are partially routed,
or have conflicts.
o Description: Displays the description associated with the run. This description is set
initially to a strategy description when that strategy is applied to the run.
The Create New Runs Wizard (select Flow > Create Runs) allows you to create multiple
runs for synthesis, implementation, or both with different synthesis and implementation
strategies and constraints sets.
www.xilinx.com 27
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
Question 14
How many synthesis and implementation runs have been created for this design?
28 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
Question 15
What is the current name of the simulation top module? Why does it have to be changed?
4-1. Set the testbench (test_uart_rx.v/vhd) as the top module for simulation.
4-1-1. Select the Hierarchy tab in the Sources window.
4-1-2. Right-click test_uart_rx .v under Simulation Sources > sim_1 and select Set as Top.
www.xilinx.com 29
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
The signals in the uart_rx_i0 module that you will add to the waveform window are
displayed in the Objects window.
30 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
4-3-3. Select clk_rx, and while pressing the <Shift> key, click baud_x16_en to select all of the
signals at this level of the hierarchy.
4-3-4. Right-click and select Add to Wave Window.
Alternatively, you can drag-and-drop the signals into the waveform window.
The signals are added to the bottom of the waveform window, but no values are
displayed because the simulator only saves signal values for signals that are displayed
when the simulation is run. The simulation must be restarted for the values on the new
signals to be seen.
Question 16
How do you display an analog-style waveform in the waveform viewer?
www.xilinx.com 31
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
4-5. Restart and run simulation to see the results on the newly added signal in
the waveform window.
4-5-1. Click the Restart toolbar icon ( ) in the horizontal toolbar at the top (not the Go to
Time 0 icon) to restart the simulation.
4-5-2. Click the Run All toolbar icon ( ) to rerun the simulation.
The simulation terminates when the simulator reaches $stop in the Verilog testbench
code or in VHDL, severity failure.
32 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 1: Vivado Design Suite Project-Based Flow
4-6-3. Zoom in to the waveform window to visually inspect the received characters.
4-6-4. Verify that rx_data[7:0] has the same value as char_to_send[7:0] (or data_to_send[7:0]
for VHDL) whenever rx_data_rdy is high.
Hint: Select the rx_data_rdy signal in the waveform window and examine whether the
char_to_send[7:0] (or data_to_send[7:0] for VHDL) and rx_data[7:0] signals have the
same value at each rising edge of the rx_data_rdy signal as shown in the figure below.
www.xilinx.com 33
© Copyright 2018 Xilinx
Lab 1: Vivado Design Suite Project-Based Flow Lab Workbook
Summary
In the lab, you created a project using the New Project Wizard. You added design and
simulation source files to complete the project. The various views in the Vivado IDE were
observed. You also explored and evaluated the project settings provided by the Vivado Design
Suite. Finally, you performed behavioral simulation of the design using the Vivado simulator.
34 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Abstract
This lab reviews the process of synthesizing, implementing, and generating a bitstream.
This lab supports both Verilog and VHDL design files. However, the lab instructions and figures
show only VHDL usage.
This lab should take approximately 45 minutes.
Objectives
After completing this lab, you will be able to:
Synthesize a design by using the Vivado® IDE or Tcl Console
Implement the design by using the Vivado IDE
Generate the bitstream
Program a Kintex® UltraScale™ or a Kintex-7 FPGA (optional)
Introduction
In this lab, you will explore synthesis, implementation settings and optionally download the
uart_led design onto a Kintex UltraScale FPGA KCU105 evaluation board or a Kintex-7 FPGA
KC705 evaluation board to verify that the design works correctly.
www.xilinx.com 35
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
The uart_led design receives data on a serial RX port and displays its binary equivalent value on
LEDs.
This design implements an RS-232 protocol that receives serial data at 115200 baud rate (no
parity, 8 data bits, no handshaking). When a character is successfully received, its binary
equivalent displays on the LEDs. The eight significant bits are shown by default. Pressing a
button (btn_pin) on the board shows the swapping of the four most and least significant bits.
In this lab, the input serial data will be the ASCII characters you will enter using a Tera Term
terminal. The binary equivalent of all ASCII characters is provided in
C:\training\Synth_Impl\support\ascii_table.pdf. The eight LEDs on the evaluation board will be
used to show the binary equivalent of the ASCII character entered by you.
General Flow
Step 1: Step 2: Step 3: Step 4:
Opening an Synthesizing Implement- [Optional]
Existing the ing the Downloading
Project Design Design Bitstream
36 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Figure 2-2: Launching the Vivado Design Suite from the Start Menu
For Windows 10: Select Start > Xilinx Design Tools > Vivado 2018.1.
-- OR --
www.xilinx.com 37
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
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.
38 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
www.xilinx.com 39
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
Alternatively, you can select Flow > Settings > Synthesis Settings.
The Settings dialog box opens, allowing you to set options such as -
flatten_hierarchy, -fanout_limit, -fsm_extraction, etc., to meet specific
needs of the design.
40 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
The tcl.pre and tcl.post options allow you to provide pre-synthesis and post-
synthesis Tcl files. For example, a post-synthesis Tcl file may have Tcl commands for
generating various reports.
The options available in the Synthesis settings dialog box are listed below:
–flatten_hierarchy: Determines how Vivado synthesis controls hierarchy.
–gated_clock_conversion: Turns on and off the synthesis tool's ability to convert the
clocked logic with enables.
–bufg: Controls how many BUFGs the tool infers in the design.
–fanout_limit: Specifies the number of loads a signal must drive before it starts
replicating logic.
–directive: Replaces the effort_level option. When specified, this option runs Vivado
synthesis with different optimizations. Values are Default and RuntimeOptimized,
which run synthesis quickly and with less optimization.
–fsm_extraction: Controls how synthesis extracts and maps finite state machines.
You can choose from the following options to encode the state machine in a specific
encoding type: off, one_hot, sequential, johnson, gray, or auto.
-keep_equivalent_registers: Prevents merging of registers with the same input logic.
www.xilinx.com 41
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
Question 1
What are the values available for -flatten_hierarchy?
2-2. Select the rebuilt value for the -flatten_hierarchy option, if not already set.
Selecting this option is recommended because this allows the design hierarchy to
be flattened for optimizing combinatorial logic, then rebuilt, making it more
useful for design analysis since many logical references will be maintained.
2-3. Click OK in the Settings dialog box and click No in the Create New Run
dialog box.
Question 2
What are the available synthesis strategies?
42 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Question 3
What are the assigned values of -flatten_hierarchy, -directive, and -
fsm_extraction for the Flow_RuntimeOptimized strategy?
Question 4
How do you create a user-defined synthesis strategy?
Note: Leaving this user-defined strategy as active will make it the default strategy
whenever you run synthesis the next time.
2-5-3. Close the Settings dialog box without saving any changes.
This constraint creates the primary clock clk_pin_p with a frequency 125 MHz (KCU105)
or 200 MHz (KC705).
www.xilinx.com 43
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
2-6-3. Uncomment the set_input_delay and set_output_delay constraints to apply input and
output delays to the design.
These will constrain the design I/O ports with specified input and output delay values.
The delay value specified in the set_input_delay and set_output_delay constraints
corresponds to the delays outside the FPGA, such as board trace delay and clk-to-out
delay.
2-6-4. Select File > Save File.
2-6-5. Close the uart_led.xdc file.
Alternatively, you can also select Flow > Run Synthesis or press <F11>.
44 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
After the synthesis process completes, the Synthesis Completed dialog box opens. The
dialog box prompts you to run implementation, open the synthesized design, or view
reports.
The Vivado IDE opens the synthesized netlist, the active constraint set, and the target
device in the Synthesized Design environment, which allows you to perform I/O pin
planning, design analysis, and floorplanning.
2-8-2. Open the Utilization Report from the Reports tab at the bottom of the Vivado IDE.
Question 5
Fill in the following table with the total number of FPGA resources used by the design.
BUFGCTRL
CLB/Slice LUTs
CLB/Slice Registers
Bonded IOBs
2-8-3. Select Report Utilization under Open Synthesized Design from the flow navigator.
2-8-4. Select Summary from the Utilization tab at the bottom of the Vivado IDE.
Question 6
What is the utilization percentage of LUTs, flip-flops, and I/O for the design?
www.xilinx.com 45
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
2-9. Verify the constraint coverage in the design by using the report generated
by the check_timing command.
Hint: Select Reports > Timing > Check Timing.
The check_timing report identifies the missing timing checks in the design.
Some of the supported timing checks are the following:
o no_clock: Number of clock pins reached by a zero timing clock.
o constant_clock: Number of register/latch pins with constant_clock.
o pulse_width_clock: Number of register/latch pins which need pulse_width check.
o unconstrained_internal_endpoints: Number of path endpoints without a timing
requirement.
o no_input_delay: Number of input ports without at least one input delay constraint.
o no_output_delay: Number of output ports without at least one output delay
constraint.
o multiple_clock: Number of clock pins reached by more than one timing clock.
o generated_clocks: Number of missing generated clock definitions.
o loops: Number of timing loops found in the design.
o partial_input_delay: Number of input ports with partially defined input delay
constraints.
o partial_output_delay: Number of output ports with partially defined output delay
constraints.
o latch_loops: Number of combinatorial latch loops in the design.
The check_timing report provides the summary of any missing timing constraints
according to the timing engine.
Question 7
Why is the check_timing report important for complete sign-off?
46 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
2-10-2. Click OK to close the synthesized design if the Confirm Close dialog box opens.
Alternatively, you can also close the synthesized design by clicking the X in the
Synthesized Design status bar at the top, or entering the Tcl command close_design
in the Tcl Console.
www.xilinx.com 47
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
48 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Question 8
What are the implementation sub-processes? What does each sub-process do?
Question 9
What are the implementation strategies available for the Vivado Design Suite?
Question 10
What is the assigned value of -directive for opt_design, place_design, and
route_design?
www.xilinx.com 49
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
Question 11
How do you create a user-defined implementation strategy?
Question 12
Does the Flow_RuntimeOptimized strategy have the same options as that of the user-defined
My_Implementation_Strategy strategy?
50 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Question 13
What is the phys_opt_design stage?
3-4-4. Delete the user-defined implementation strategy as this strategy is not needed.
3-4-5. Close the Options dialog box without saving any changes.
www.xilinx.com 51
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
3-7. Examine the options available under Open Implemented Design in the Flow
Navigator.
The Flow Navigator points to the most important reports, such as Timing
Summary Report, Utilization Report, etc.
3-8. Examine the reports available in the Reports tab at the bottom of the
Vivado IDE.
The Reports tab contains several useful reports, including log files for synthesis
and implementation runs.
3-9. Open the Control Sets Report from the Reports tab within Place Design at
the bottom of the Vivado IDE.
This report describes the number of unique control sets in the design and also
provides information about how control signals are grouped.
Question 14
How many unique control sets are there in the design?
52 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Question 15
How many registers sites are lost due to control set restrictions?
The report determines the ability of the tools to reach high device utilization. The number of
controls signals in the design is determined by the designer's inference of sets, resets, and
clock enable signals. The number of control signals can be reduced if the designer attempts
to share controls signals throughout the design as much as possible.
Note: Xilinx recommends using synchronous sets/resets whenever possible and that
designers reduce the number of control signals in their design to improve device utilization.
A .bit file will be generated in the working project under the uart_led.runs\impl_1
directory.
The status indicator in the upper right-hand corner of the workspace, as well as in the
design runs console, will indicate when bitstream generation is complete.
www.xilinx.com 53
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
Note: You may be prompted to install drivers when the board is first connected. Do not allow
the driver installation to search the Web, but allow it to search for the drivers on your
computer.
54 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
4-3. Ensure that all DIP switches are in the off position.
4-4. Program the FPGA on the evaluation board using the Vivado hardware
manager.
4-4-1. Click Open Hardware Manager in the Bitstream Completed dialog box and select OK.
4-4-2. Click Open Target > Open New Target.
4-4-3. Click Next in the Open Hardware Target window after reading how to connect to a
remote hardware target.
4-4-4. Select the server type you are connecting to in the Hardware Server Settings dialog box
and click Next.
4-4-5. Keep the default selection in the Select Hardware Target dialog box to choose your
device and click Next.
4-4-6. Click Finish after reviewing the Hardware Target Summary.
4-4-7. KCU105 users: Right-click xcku040_0 and select Program Device.
www.xilinx.com 55
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
A progress bar appears, and when FPGA programming is complete, the dialog box
closes.
Note: The COM port setting is specific to the computer being used and may need to be
different than shown.
56 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
4-6. Enter data into the terminal and observe the pattern of the LEDs on the
board.
4-6-1. Type any characters into the Tera Term window.
On the evaluation board, all eight bits of the character will appear on the LEDs.
For a list of ASCII characters and their hexadecimal representation, see the ascii_table.pdf
file in the C:\training\Synth_Impl\support directory.
www.xilinx.com 57
© Copyright 2018 Xilinx
Lab 2: Vivado Synthesis and Implementation Lab Workbook
58 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 2: Vivado Synthesis and Implementation
Summary
In this lab, you learned how to synthesize the design with the default settings, implement the
design with default settings, and finally download the bitstream onto the evaluation board.
www.xilinx.com 59
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
Abstract
This lab provides an introduction to analysis features of the Vivado® IDE such as the Schematic
viewer and Hierarchy viewer. This will enable you to analyze the design and cross-probe the
timing path back to the RTL source.
This lab supports both Verilog and VHDL design files. However, the lab instructions and figures
show only Verilog usage.
This lab should take approximately 30 minutes.
Objectives
After completing this lab, you will be able to:
Use the Schematic viewer to analyze a design
Use the Hierarchy viewer to show the design netlist hierarchy
Cross-probe timing-critical paths by using the Schematic viewer
Use the Device viewer to display the placement and routing resources of the design
Introduction
The Vivado IDE enables you to analyze, verify, and modify the design at each stage of the design
process. You can improve circuit performance by analyzing the interim results in the design
process. This analysis can be run after RTL elaboration, synthesis, and implementation.
The design used in this lab is a programmable waveform generator, also known as a signal
generator.
The waveform generator in this design is intended to be a “standalone” device that is controlled
via a PC (or other terminal device) using RS-232 serial communication. The design described
here implements the RS-232 communication 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 design can be downloaded to any FPGA development
board with a DAC, either on the board or on a daughter card.
www.xilinx.com 61
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
General Flow
Step 2: Step 3:
Step 1:
Analyzing Analyzing
Opening an
the the
Existing
Synthesized Implemented
Project
Design Design
62 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
1-2. Open the Vivado Design Suite project named wave_gen.xpr located in the
C:\training\Basic_Dsgn_Analysis\lab\[KCU105 | KC7xx]\verilog directory.
If you do not recall how to perform this task, refer to the "Opening a Vivado
Design Suite Project" section under Vivado Design Suite Operations in the Lab
Reference Guide.
www.xilinx.com 63
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
2-1. Examine the HDL hierarchy of the design by using the Hierarchy viewer.
Hint: Select the Hierarchy tab of the Sources window to see the HDL hierarchy of
the design.
Note: The constraints files, schematic, and hierarchical views will vary a little based on
the target devices. The figures used in this lab correspond to the Kintex® UltraScale™
device. The same steps are applicable to users of the Kintex-7 device. The instructions
will focus on describing the different views available in the Vivado IDE and how to use
them.
64 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
The Netlist window includes the Leaf Cells folder and Nets folder at the top
hierarchy and each level of hierarchy.
o Leaf Cells: Displays primitive logic for each level of the hierarchy. This folder
condenses the display of logic content and hierarchical modules in the Netlist
window.
o Nets: Displays nets, or wires, for each level of the hierarchy. All of the bits of a bus
are collapsed under the bus by default, but you can expand buses to show each
individual bit.
Question 1
How many nets and leaf cells are there at the top-level of the design hierarchy?
www.xilinx.com 65
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
2-5. Select the most timing-critical path from the Timing Summary report.
Hint: Clicking the Worst Hold Slack (WHS) value in Design Timing Summary will
display the most timing critical paths.
2-6-2. Enable "Select Clock Paths" icon ( ) in the Timing Summary window.
2-6-3. Right-click and select Schematic or press <F4>.
Question 2
What does the schematic look like for the timing-critical path?
66 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
2-8. Generate the hierarchy of the design netlist by using the Hierarchy viewer.
Hint: Select Tools > Show Hierarchy or right-click and select Show Hierarchy.
The Hierarchy viewer displays a graphical representation of the logic hierarchy for
the current design, based on the current top module. Viewing the design from
top to bottom, you can identify the relationship among hierarchical modules,
approximate module sizes, and module location within the design.
Question 3
How many hierarchy levels are there in the design? Hint: Switch to the Tree view by clicking the
icon for easy viewing.
www.xilinx.com 67
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
2-9. Select the samp_gen instance in the Netlist window and display the
hierarchy level of the instance in the design.
Question 4
What is the hierarchy level of the samp_gen instance in the design?
Question 5
What are the primitive counts in the cell?
Question 6
What are the names of the carry chains in the cell? Hint: Use the Children tab in Properties view
after selecting the cell in the Netlist window.
2-13. Select any instance in the Hierarchy window and notice that the same object
is selected in the Netlist window.
This feature is called cross-selection of objects.
Question 7
How would the cross-selection feature be useful during design analysis?
www.xilinx.com 69
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
70 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
Question 8
What does the Auto Fit Selection icon do?
Question 9
What does the Show Cell Connections icon do?
www.xilinx.com 71
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
Question 10
When would viewing Routing Resources be useful?
3-5. Zoom into the Device view so that device resources such as LUTs, FFs, and
block RAM tiles are visible.
72 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
3-6. Select any LUT resource in the Device view to observe that the same object
is cross-selected in the Netlist window.
This is the cross-selection feature in the Vivado IDE.
Figure 3-9: Cross Selection of Objects in the Device View and Netlist Window
Question 11
What is the LUT equation for the selected LUT?
www.xilinx.com 73
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
Question 12
What are the Site, Tile, and BEL values of the selected LUT?
Question 13
Which clock region is the LUT located in?
74 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
3-10. Select the Worst Negative Slack (WNS) timing-critical path from the Timing
Summary report.
Question 14
What does the timing path look like in the Device view?
www.xilinx.com 75
© Copyright 2018 Xilinx
Lab 3: Basic Design Analysis in the Vivado IDE Lab Workbook
Question 15
What is the schematic for the timing-critical path?
3-13. Click the Settings icon ( ) in the horizontal toolbar to enable the Slack and
Fanout values on each pin of the cell.
76 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 3: Basic Design Analysis in the Vivado IDE
Question 16
When would the Schematic options be useful?
You can also cross-probe the timing-critical path to the RTL source.
This will highlight the logic-level instance of the selected timing path in the Netlist
window.
This will open the corresponding HDL file, enabling you to cross-probe the source of the
timing-critical path.
Summary
In this lab, you learned how to use the Schematic viewer, Hierarchy viewer, and Device viewer to
analyze the design. You also used the cross-probing feature of the Vivado IDE to cross-probe
the timing-critical path.
www.xilinx.com 77
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Abstract
This lab guides you through the process of generating a Design Rule Check (DRC) report at the
elaboration stage and fixing some of the DRC violations early in the flow.
This lab supports only Verilog design files for a Kintex®-7 FPGA.
This lab should take approximately 60 minutes.
Objectives
After completing this lab, you will be able to:
Run a DRC report to detect design issues
Fix the DRC violations early in the flow
Introduction
DRC checks are run to detect common design issues and errors. DRC rules will vary depending
on stages of the design process.
Elaborated Design
Checks for DRCs related to I/O and clock placement.
The RTL netlist does not typically have all the I/O buffers, clock buffers, and other primitives that
post-synthesis designs have. Elaborated design DRCs do not check for as many errors as
subsequent DRCs.
Synthesized Design and Implemented Design
Checks for DRCs related to the post-synthesis netlist
Checks for I/O, BUFG, and other placements
Basic checks on the attribute wiring on MGTs, IODELAYs, and other primitives
For implementation, the same DRCs run, taking into account any available placement and
routing
DRCs have four severities: Informational, warning, critical warning, and error. Critical
warnings and errors do not block the design flow at this point
Certain messages have a lower severity depending on the stage. These are DRC-flagging
conditions that do not stop opt_design, place_design, or route_design from
completing, but which can lead to issues on the board.
www.xilinx.com 79
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
place_design
Before starting placement, Vivado® implementation runs DRCs, including user-selected DRCs
from report_drc, and built-in DRCs internal to the Vivado placer engine. Internal DRCs report
many issues, including memory interface generator (MIG) cells without LOC constraints and I/O
banks with conflicting I/O standards.
route_design
Before starting routing, the Vivado tools runs DRCs, user-selected DRCs from report_drc, and
built-in DRCs internal to the Vivado router engine.
Bitstream Generation
Writing the bitstream file includes a final DRC to ensure that the design does not violate any
hardware rules.
General Flow
Step 1: Step 2: Step 3:
Opening an Examining Analyzing
Example the the Modified
Design Design Design
80 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Figure 4-1: Launching the Vivado Design Suite from the Start Menu
For Windows 10: Select Start > Xilinx Design Tools > Vivado 2018.1.
-- OR --
www.xilinx.com 81
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
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.
1-2. Use the Open Example Project link in the Getting Started page to create a
large RTL project.
1-2-1. Click the Open Example Project in the Getting Started page.
1-2-2. Click Next in the Open Example Project window after reading how the Example Project
Wizard should be used.
1-2-3. Select CPU (HDL) to use the template for creating a large RTL project.
1-2-4. Click Next.
1-2-5. Enter project_cpu as the project name and locate the project in the
C:\training\Dsgn_Rule_Check\lab\KC7xx\project_cpu directory.
1-2-6. Click Select.
Note: The CPU example in the Vivado Design Suite 2018.1 is provided only in Verilog
RTL for a Kintex-7 FPGA. It does not have a version for UltraScale™ devices or VHDL.
82 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
www.xilinx.com 83
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
The RTL design allows to analyze your design for logic correctness. You can make sure
that there are no logic compilation issues, missing modules, or interface mismatches.
2-2. Explore the options available in the horizontal toolbar of the RTL Schematic
window.
The horizontal toolbar provides one-click options for various actions, such as
Select Area, Regenerate the Schematic, etc.
84 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Question 1
What DRC rules are checked at the elaborated design stage?
2-3-2. Click OK in the Report DRC window to run the default DRC checks.
www.xilinx.com 85
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
Question 2
Summarize the violations in the DRC report.
Question 3
Summarize the pin planning violations in the DRC report.
2-6. Select the UCIO-1 > UCIO #1 violation from the IOB violations.
Question 4
What is the UCIO #1 violation?
Question 5
Which ports are creating the violations?
From the answers to the above question, it is clear that the problem ports do not have
the pin location and I/O standard assignments. To fix these DRC violations, you will need
to assign these attributes to these ports.
The package pin location and I/O standard assignments can be made in two ways: using
the I/O Planning layout or writing XDC constraints to the XDC file.
86 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
2-7. Change the Default Layout to I/O Planning Layout and notice that the
Vivado IDE layout changed from the Default layout to the I/O Planning
layout in the horizontal toolbar.
2-7-1. Select Layout > I/O Planning.
When the Vivado IDE layout changed to I/O Planning, the Package window and I/O
Ports tab open in the main workspace area and Results window, respectively.
The colored areas between the pins display the I/O banks and show differential pairs,
clock-capable pins ( ), VCC ( ), GND ( ), or no connection ( ).
www.xilinx.com 87
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
The display of each pin in the Package window includes the pin name (signal name, if
assigned), pin number (found by dragging over), site type (I/O), differential pair type (P
or N), and bank number (26, 12, etc.).
2-9. Explore the options in the I/O Ports tab at the bottom.
2-9-1. Expand Scalar Ports in the I/O ports tab to view the ports shown in the figure below.
2-9-2. Observe how selecting a port in the I/O Ports tab (like TermSel_pad_1_o, for example)
will highlight the corresponding pin in the Package and Device views of the Vivado IDE.
88 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
2-10. Assign the package pin location for the ports using the I/O Ports tab.
2-10-1. Assign the K6 package pin location for TILE0_REFCLK_PAD_P_IN.
Hint: Enter K6 in the Package Pin column of the TILE0_REFCLK_PAD_P_IN port in the
I/O Ports tab.
Observe that this will also assign the pin location for the corresponding differential pair
(i.e. for TILE0_REFCLK_PAD_N_IN).
2-10-2. Assign the H6 package pin location for TILE1_REFCLK_PAD_P_IN.
2-10-3. Assign the F6 package pin location for TILE2_REFCLK_PAD_P_IN.
2-10-4. Assign the D6 package pin location for TILE3_REFCLK_PAD_P_IN.
2-11. Select File > Constraints > Save to save the modified top_full.xdc file.
2-11-1. Click Yes if prompted to save the elaborated design.
2-13. Verify that UCIO pin planning violations are no longer reported.
This is expected because the site has been specified for each of the eight ports
reported previously. This in turn sets the I/O standards and LOC constraints for
those ports.
To fix the violation, you will need to know about CFGBVS and CONFIG_VOLTAGE.
Information on CFGBVS and CONFIG_VOLTAGE can be found in the 7 Series FPGAs
Configuration User Guide (UG470), which is available in the C:\training\Dsgn_Rule_Check\
support directory.
Question 6
What is CFGBVS?
www.xilinx.com 89
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
Question 7
What is the CFGBVS #1 violation?
2-16. Enter the following XDC constraints in the Tcl Console to fix this DRC
violation.
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 1.8 [current_design]
2-17. Select File > Constraints > Save to save the constraints to the top_full.xdc
file.
2-19. Verify that CFGBVS pin planning violations are no longer reported.
This is expected because the configuration bank voltage select (CFGBVS) has
been set to GND, and CONFIG_VOLTAGE has been set to 1.8V via Tcl.
90 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Alternatively, you can also select Flow > Run Synthesis or press <F11>.
After the synthesis process completes, the Synthesis Completed dialog box opens. The
dialog box prompts you to run implementation, open the synthesized design, or view
reports.
2-20-4. Click OK to continue with your preferred choice or Cancel to simply close the dialog box
and return to the normal view of the Vivado Design Suite.
2-23. Expand All Violations > Netlist > Instance > Pipeline > DSP48E1 to view the
pipelining violations.
Question 8
How many DSP inputs are not pipelined?
Question 9
How many DSP outputs are not pipelined?
2-24. Expand All Violations > Netlist > Instance > Synchronous controls >
DSP48E1 to view the violations due to registers with asynchronous resets.
Question 10
How many DSP outputs are connected to registers with asynchronous resets?
Question 11
What are appropriate design changes for improving the reset structure?
92 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Question 12
What does the RMOR #1 violation say?
2-27-6. Select RMOR #1 violation and click p00_i in the Methodology window.
Question 13
What source file has been opened?
Question 14
Is there an asynchronous reset in the code snippet? What is the signal name?
www.xilinx.com 93
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
Question 15
Is there an asynchronous reset violation now?
2-30. Select RTL > Fanout and Replication > RFFH-1 violation under All Violations.
Question 16
What does the RFFH #1 advisory say? How it can be solved?
94 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Question 17
How many XDC violations are reported in the DRC report? What do these violations indicate?
Can they be ignored?
Alternatively, you can also select Flow > Run Synthesis or press <F11>.
www.xilinx.com 95
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
After the synthesis process completes, the Synthesis Completed dialog box opens. The
dialog box prompts you to run implementation, open the synthesized design, or view
reports.
2-33-4. Click OK to continue with your preferred choice or Cancel to simply close the dialog box
and return to the normal view of the Vivado Design Suite.
2-36. Expand All Violations > Netlist > Instance > Synchronous controls >
DSP48E1 to view the violations due to registers with asynchronous resets.
Notice that the violations due to registers with asynchronous reset has been
fixed (Now this violation is fixed. All Violations > Netlist > Instance >
Synchronous controls > DSP48E1).
96 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Question 18
What is the purpose of the reset bridge module (reset_bridge.v)?
www.xilinx.com 97
© Copyright 2018 Xilinx
Lab 4: Vivado Design Rule Checks Lab Workbook
Question 19
What does the schematic look like?
The modified project_cpu_hdl design includes a RESET_BRIDGE module at the top level
for each clock domain.
The following is a list of reset changes that were made to the design:
o mgtTop.v: Removed wb_reset because it is only used to initialize registers (INITs by
default are set to 0).
o fftTop.v: Removed asynchronous resets and replaced with INITs.
o bft.vhd: fftClk used for bft; reset_fftClk used for the few remaining resets in bft;
resets changed to INITs.
o Wb_conmax_top.v: Left the rst port but removed all asynchronous resets in all
modules.
o Wb_conmax_arb.v: For the FSM, change it to a synchronous reset.
o Or1200_top.v: Changed rst_i to reset_wbClk and reset_cpuClk; per clock domain
used.
There are many occurrences like this in other modules for removing asynchronous resets
in the design.
98 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 4: Vivado Design Rule Checks
Summary
In this lab, you utilized Report DRC and Report Methodology to identify issues in the HDL early
in the design flow. You then fixed the I/O ports by assigning pins and changed an asynchronous
reset to synchronous, allowing the DSP48E1 output to be registered in the DSP48E1 block. You
examined the DRC report to identify the remaining issues and fixed them. Finally, you ran a
Report DRC on a version of the code that fixed these issues to confirm that these issues were
indeed fixed.
www.xilinx.com 99
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
Abstract
This lab introduces the I/O planning capabilities of the Vivado® Design Suite for FPGA devices.
The lab supports both Verilog and VHDL design files. However, the lab instructions and figures
show only Verilog usage.
This lab should take approximately 30 minutes.
Objectives
After completing this lab, you will be able to:
Use the basic design analysis features of the Vivado IDE to explore your design
Step through the I/O pin planning process using the GUI
Assign configured I/O ports to the physical package pins
Introduction
The Vivado IDE provides an I/O planning environment that enables I/O ports assignment to
package pins. In this environment, you can assign I/O locations, specify I/O banks and I/O
standards, or create legal pin assignments by reporting Design Rule Checks (DRC).
I/O planning can be performed at any stage of the design flow with any type of project. Some of
the most common methods are:
Pre-RTL I/O planning
RTL I/O planning
Netlist I/O planning
I/O validation with an Implemented design
You can also use the I/O planning layout view to see the relationship of the physical package
pins and banks with the corresponding I/O pads.
General Flow
Step 1: Step 2: Step 3:
Creating Analyzing Placing
a the I/O
Project Design Pins
www.xilinx.com 101
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
Figure 5-1: Launching the Vivado Design Suite from the Start Menu
For Windows 10: Select Start > Xilinx Design Tools > Vivado 2018.1.
-- OR --
102 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
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.
www.xilinx.com 103
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
Projects begin with the creation of a new project. The project contains sources,
settings, graphics, IP, and other elements that are used to build a final bitstream.
1-3. You will now encounter a series of dialog boxes asking you to enter
different pieces of information describing the project.
1-3-1. Enter uart_led in the Project name field(1).
1-3-2. Enter C:\training\IO_PinPlanning\lab\[KCU105 | KC705]\verilog in the Project
location field(2).
Select your preferred language to be either Verilog or VHDL.
Alternatively, you can use the browse feature to navigate to where you want the project
to reside.
104 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
1-3-3. Deselect the Create Project Subdirectory option, as leaving this checked will create an
additional level of hierarchy in the lab (3).
1-3-4. Click Next to accept the selections and advance to selecting a type of project (4).
The Project Type dialog box invites you to choose between an RTL project or a post-
synthesis project. Simply put, an RTL project enables you to add or create new HDL files
and synthesize them, whereas a post-synthesis project requires pre-synthesized files.
1-3-5. Select RTL Project since this project will be based on source code (rather than a netlist)
(1).
1-3-6. Deselect the Do not specify sources at this time option (2), since you will be adding
RTL files in the next instruction.
1-3-7. Click Next to accept the selection and advance to the adding sources stage (3).
www.xilinx.com 105
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
1-4. Now that the project name, type, and location have been entered, the
wizard invites you to add source files to the project. You can add entire
directories where the sources are located, add specific files, or create new
sources.
Begin by adding the sources to your project.
1-4-1. Click the Plus icon ( ) to begin adding objects to the project.
1-4-2. Select Add Files from the pop-up menu to begin adding your source files to the project.
After you add all the necessary files, the remainder of this dialog box will be addressed.
The Add Source Files dialog box opens.
1-4-3. Browse to the C:\training\IO_PinPlanning\lab\[KCU105 | KC705]\verilog directory (1).
106 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
The Add Source Files dialog box closes and returns you to the Add Sources dialog box.
1-5. In the Add Sources window, add any existing IP modules to the Vivado
Design Suite project.
KCU105 users: No IP is required for this design. Click Next and skip to the
step that begins with "Add any existing constraint files". KC705 users: Add
the clk_core IP to the design by using steps below.
1-5-1. Click the Plus icon ( ) again to select the IP files.
1-5-2. Select Add Files to open the Add Source Files dialog box.
1-5-3. Select clk_core.xci.
1-5-4. Click OK to accept the selected files and add them as sources to the project.
If you have additional files located in other directories, you can repeat this instruction for
each directory.
1-5-5. Confirm that the Scan and Add RTL Include Files into Project option is selected (used
for Verilog, no effect for VHDL) in the Add Sources dialog box (1).
This will automatically pull in any include files used by Verilog sources.
1-5-6. Confirm that the Copy Sources into Project option is selected (1).
This will make a local copy of the source in the project space. Selecting this option
enables you to make changes to the local copy without affecting the original source file.
1-5-7. Select your preferred language from the Target Language drop-down list (2).
This choice only affects which language is used for the generation of templates and
wrappers. You can add files in any language regardless of which target language is
www.xilinx.com 107
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
selected. If you do not generate or use any templates or wrappers, this step is irrelevant
and you can select any language.
1-5-8. Click Next to complete the adding of RTL sources and advance to adding any XDC files.
1-6. Add any existing constraint files to the Vivado Design Suite project.
You will add uart_led.xdc to the project in the following instructions.
1-6-1. Click the Plus icon ( ) to select the type of object you want to import (1).
1-6-2. Select Add Files to open the Add Constraints Files dialog box.
1-6-3. Browse to the C:\training\IO_PinPlanning\lab\[KCU105 | KC705]\verilog directory.
If you have additional files located in other directories you can repeat this instruction for
each directory.
1-6-6. Confirm that the Copy constraints files into Project option is selected (2).
This will make a local copy of the source in the project space. Selecting this option
enables you to make changes to the local copy without affecting the original source file.
1-6-7. Click Next to advance to selecting a target device (3).
108 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
1-7. Select the target part by first filtering by board and then by family. If you
are not using a supported board, you will need to filter by part.
1-7-1. Select Boards from the Select area (1).
1-7-2. Select All from the Vendor drop-down list in the Filter area (2).
This filters the available boards to those that are populated with any member of the
selected library.
1-7-3. Select Kintex UltraScale KCU105 Evaluation Platform | Kintex -7 KC705 Evaluation
Platform from the board list.
Alternatively you can select the board directly from the list at any time while in this
dialog box.
A summary of your project is displayed. If you want to change any of the information
that you entered, you can do so now by clicking Back until you reach the correct dialog
box and making the correction, or you can create the project now and edit the project
properties, add or remove files, etc. later.
1-7-5. Click Finish.
Your project is constructed and you are presented with the Vivado Design Suite main
workspace environment.
www.xilinx.com 109
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
Analyzing the Design Using the Schematic and Hierarchy Views Step 2
You will open the elaborated design and briefly explore the design with the RTL
Netlist, Schematic, and Hierarchy viewers.
110 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
Notice that the RTL source file is opened in the text editor with the logic instance
highlighted.
Also notice that the logic instance is also highlighted in the RTL Netlist window.
2-2-3. Double-click the uart_rx_i0 logic instance in the Schematic view.
2-2-4. Explore the RTL Schematic view by expanding each of the submodules and viewing the
lowest level of the RTL schematic.
The RTL hierarchy window opens, displaying the hierarchical block structure of the
selected uart_baud_gen_rx_i0 instance.
2-3-3. Enable the Show Tree View icon from the Hierarchy window horizontal toolbar.
This displays and highlights the structure of the uart_baud_gen_rx_i0 logic instance until
the bottom leaf cells are present in the hierarchy.
www.xilinx.com 111
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
2-3-4. Click the Go Up One Level icon until you are at the top level of the
uart_baud_gen_rx_i0 instance.
Figureb 5-14: RTL Hierarchy View with uart_baud_gen_rx_i0 Highlighted (KCU105) (Numbers
May Vary)
Figure 5-15: RTL Hierarchy View with uart_baud_gen_rx_i0 Highlighted (KC705) (Numbers May
Vary)
2-3-5. Explore the RTL Hierarchy view and see how the component selection in this view
automatically highlight the same module in other views (Schematic view or Netlist
window).
112 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
Question 1
From the top level, how many levels of hierarchy did you go through before reaching the lowest
level? What you understood from the design tree?
Question 2
What are all the critical warnings reported by DRC? If so, what could be the reason(s)?
2-5-6. Right-click the DRC tab after reviewing the violations and select Close.
www.xilinx.com 113
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
3-1. Use the I/O Planning view to identify pins that do not have an assigned
location.
3-1-1. Select Layout > I/O Planning from the layout selector, if it is in any other layout view.
3-1-2. Select the Package view, if it is not already opened.
The main window of the I/O Planning view displays the Package view of the Kintex®
UltraScale™ or Kintex 7-series device.
3-1-3. Observe the I/O Ports tab, which displays the list of I/O ports of the design, and the
Package Pins tab, which displays the list of package pins available on the device
package.
114 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
www.xilinx.com 115
© Copyright 2018 Xilinx
Lab 5: Vivado Design Suite I/O Pin Planning Lab Workbook
3-4. Assign the location (using the Package view) and I/O standard for rst_pin.
3-4-1. Select rst_pin in the I/O Ports view.
3-4-2. Select LVCMOS18 (KCU105) or LVCMOS15 (KC705) from the I/O Standard drop-down
list and press <Enter>.
Rather than entering the package pin in the I/O Ports view, you can use the Package view
to assign the package pin for this pin.
3-4-3. Drag the rst_pin from the I/O ports view onto location AN8 (KCU105) or AK4 (KC705) in
the Package view.
3-5. Save the I/O pin assignments to the targeted XDC file.
3-5-1. Select File > Constraints > Save to save the constraints.
All these placement constraints will be saved to the existing uart_led.xdc file.
3-6. Open the uart_led.xdc file to confirm that your new pin assignments have
been saved in the XDC file.
3-6-1. Select the Hierarchy tab of the Sources window.
3-6-2. Double-click the uart_led.xdc under Constraints > constrs_1 to open the file in the text
editor.
3-6-3. Scroll to the bottom of the file and validate the changes that you made in the Vivado
IDE.
116 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 5: Vivado Design Suite I/O Pin Planning
Summary
In this lab, you checked DRC for violations and fixed the violations by using the I/O planning
capability of the Vivado IDE to assign ports to package pins.
www.xilinx.com 117
© Copyright 2018 Xilinx
Lab Workbook Lab 6: Vivado IP Flow
Abstract
In this lab, you will add the Xilinx Clocking Wizard IP using the IP flow, allowing you to configure
a clocking subsystem to provide various clock outputs and clock buffers to connect clock signals
to global clock networks.
This lab supports both Verilog and VHDL design files. However, the lab instructions and graphics
are limited to VHDL usage.
This lab should take approximately 30 minutes.
Objectives
After completing this lab, you will be able to:
Create a clocking subsystem consisting of an MMCM and some internal buffers by using the
Clocking Wizard
Instantiate the generated cores in a design
Introduction
The LogiCORE™ IP Clocking Wizard core simplifies the creation of HDL source code wrappers for
clock circuits customized to your clocking requirements. The wizard guides you in setting the
appropriate attributes for your clocking primitive, and allows you to override any wizard-
calculated parameter. In addition to providing an HDL wrapper for implementing the desired
clocking circuit, the Clocking Wizard also delivers a timing parameter summary generated by the
Xilinx timing tools for the circuit.
General Flow
Step 1: Step 2: Step 3:
Opening an Building and Implement-
Existing Instantiating ing the
Project the Core Design
www.xilinx.com 119
© Copyright 2018 Xilinx
Lab 6: Vivado IP Flow Lab Workbook
1-2. Open the Vivado Design Suite project named wave_gen.xpr located in the
C:\training\IP_Flow\lab\[KCU105 | KC7xx]\vhdl directory.
If you do not recall how to perform this task, refer to the "Opening a Vivado Design Suite
Project" section under Vivado Design Suite Operations in the Lab Reference Guide.
2-1. Launch the Clocking Wizard from the IP catalog in the Vivado IDE.
2-1-1. Click IP Catalog under Project Manager in the Flow Navigator.
Question 1
Why use the Clocking Wizard to create the core? That is, why not just instantiate the MMCM
primitive?
120 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 6: Vivado IP Flow
Note: The Primary Input Clock Frequency option specified for the core is used so that
the wizard can calculate the correct modes and parameters for the core to generate the
outputs specified in the following stages. If this frequency does not match the frequency
of the clock source of the board, then the outputs will not match the requested output
frequencies.
www.xilinx.com 121
© Copyright 2018 Xilinx
Lab 6: Vivado IP Flow Lab Workbook
2-3. Generate two output clocks (clk_out1 and clk_out2) from the MMCM
module with an output frequency of 200 MHz each.
2-3-1. Select the Output Clocks tab in the Customize IP dialog box.
2-3-2. Enter 200 as the value in the Output Freq (MHz) Requested field of the clk_out1 output
clock.
2-3-3. Enable the clk_out2 output clock by using the check box.
2-3-4. Enter 200 as the value in the Output Freq (MHz) Requested field of the clk_out2 output
clock.
2-3-5. Ensure that the Duty Cycle field is set to 50% for both output clocks.
122 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 6: Vivado IP Flow
2-4. Leave all the other tabs in the Clocking Wizard at their default settings.
Review the clock summary and generate the core.
2-4-1. Select the Summary tab and review the settings.
2-4-2. Click OK in the Customize IP dialog box.
Note: In the OOC flow, the IP is synthesized alone and an OOC DCP is produced. The
produced DCP is a container file, and includes a netlist as well as constraints.
Notice that a new file is added to the Sources > Hierarchy view: clk_core.xci. This source
file will not be included in the design hierarchy until the component has been
instantiated into one of the HDL source files.
2-5. View the HDL functional model for clk_core and confirm that the core
implemented by the core generator has the expected architecture.
2-5-1. Select the IP Sources tab in the Sources view.
2-5-2. Expand IP > clk_core > Synthesis.
2-5-3. Double-click clk_core_clk_wiz.v to view the HDL functional model.
2-5-4. Examine the source code generated by the Clocking Wizard.
KCU105 users:
This file contains the following instantiated components: an IBUFDS, an MMCME3_ADV,
and three BUFGs.
The input clock clk_in1_p/n drives an IBUFDS, which in turn drives the CLKIN1 port of
MMCME3_ADV. The CLKOUT0 and CLKOUT1 output of MMCME3_ADV drives the BUFGs,
which connects to the clk_out1 and clk_out2 output port of the module.
The MMCM attributes are passed via in-line parameter assignments.
The functional model of this core is not solely a simulation model, but is, in fact, the
instantiation and interconnection of the required hardware primitives. The Clocking
Wizard does not generate a separate netlist file.
KC7xx users:
This file contains the following instantiated components: an IBUFDS, an MMCME2_ADV,
and three BUFGs.
The input clock clk_in1_p/n drives an IBUFDS, which in turn drives the CLKIN1 port of
MMCME2_ADV. The CLKOUT0 and CLKOUT1 output of MMCME2_ADV drives the BUFGs,
which connects to the clk_out1 and clk_out2 output port of the module.
The MMCM attributes are passed via in-line parameter assignments.
www.xilinx.com 123
© Copyright 2018 Xilinx
Lab 6: Vivado IP Flow Lab Workbook
The functional model of this core is not solely a simulation model, but is, in fact, the
instantiation and interconnection of the required hardware primitives. The Clocking
Wizard does not generate a separate netlist file.
Question 2
If the core is already created, is the MMCM already connected to the design? Why must the
MMCM core be instantiated into this design?
2-5-5. Right-click the clk_core_clk_wiz.v tab and select Close to close the source file when you
are finished viewing the HDL source.
Note: The design files for this IP are delivered in Verilog only.
124 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 6: Vivado IP Flow
2-7. Complete the instantiation by changing the instance name and filling in the
port connections.
2-7-1. Complete the instantiation by changing the instance name and filling in the port
connections as follows:
VHDL
clk_core_i0: clk_core
port Map
(
clk_in1_p => clk_pin_p,
clk_in1_n => clk_pin_n,
clk_out1 => clk_rx_internal,
clk_out2 => clk_tx_internal,
reset => rst_i,
locked => clock_locked
);
Verilog
clk_core clk_core_i0 (
.clk_out1 (clk_rx),
.clk_out2 (clk_tx),
.reset (rst_i),
.locked (clock_locked),
.clk_in1_p (clk_pin_p),
.clk_in1_n (clk_pin_n)
);
2-7-2. Select File > Save File to save clk_gen.vhd/v.
Note: In order to make sure that the clk_core IP is included in the wave_gen design,
refresh the Hierarchy from the Sources window before running the next proc in order to
use the Tcl completer script.
www.xilinx.com 125
© Copyright 2018 Xilinx
Lab 6: Vivado IP Flow Lab Workbook
126 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 6: Vivado IP Flow
After making sure that the clk_core IP is instantiated properly, you will now
implement the design to view the clocking resources used by the Clocking
Wizard.
www.xilinx.com 127
© Copyright 2018 Xilinx
Lab 6: Vivado IP Flow Lab Workbook
3-3. Use the Utilization report to verify the number of clock resources used.
3-3-1. Click Implemented Design > Report Utilization under Implementation in the Flow
Navigator.
3-3-2. Click OK in the Report Utilization dialog box to accept the default results name.
Question 3
How many MMCMs and global clock buffer resources were used in the finished design?
Summary
In this lab you explored a mechanism for accessing FPGA resources. You created the clock core
IP and instantiated it into the design. You also manually instantiated several device primitives in
order to access specific global clocking resources within the FPGA.
The final mechanism of accessing FPGA resources is through inference. This, of course, is the
primary mechanism used. It is used extensively throughout the rest of the wave_gen design.
128 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: 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 129
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
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
communication 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
design. This lab will also review the process of generating and reading static timing analysis
reports.
The diagram below shows the systematic approach recommended for applying timing
constraints and incrementally progressing towards closure. There are three broad stages in the
Performance Baselining procedure recommended by Xilinx, which enables the designer to
achieve timing closure progressively.
130 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: 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
(period, 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
analyzed using these derived requirements. To avoid this redundant timing analysis and
reporting of timing failure, asynchronous clock groups need to be specified. When there
are such asynchronous inter-clock paths specified, the design must use appropriate
synchronization 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 131
© Copyright 2018 Xilinx
Lab 7: 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
Figure 7-3: Launching the Vivado Design Suite from the Start Menu
For Windows 10: Select Start > Xilinx Design Tools > Vivado 2018.1.
-- OR --
132 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
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.
www.xilinx.com 133
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
134 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
Question 1
Are there are any constraints currently in the design?
1-3-3. Click X in the text editor window to close the opened XDC file.
Alternatively, you can select Reports > Timing > Report Clock Networks.
The Report Clock Networks dialog box opens.
2-1-2. Click OK.
Clock Networks report gives the network fanout of each clock net in the open design
and provides a hierarchical tree view of the clock network.
www.xilinx.com 135
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
None of the clocks in the design has been constrained at this time and all clocks appear
as Unconstrained. If there were already constrained clocks, they will appear outside the
Unconstrained group.
2-2-2. Expand clk_pin_p.
136 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
Note: For 7 series users, the graphic will be slightly different with respect to the mmcm
primitive name, clock buffer names, and fanouts.
2-2-6. Click the Restore icon in the Clock Networks -report_1 window.
2-2-7. Close the Clock Networks tab.
The Timing Constraints window can also be opened by clicking Edit Timing Constraints
under Synthesized Design in the Flow Navigator.
The Timing Constraints window opens in the main workspace area.
www.xilinx.com 137
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
The number in the parentheses represents the number of similar constraints in the
design. In this case, this is zero because there are no objects defined as clock objects in
the design provided; i.e., there are zero create_clock constraints in the design.
The Create Clock dialog box opens.
3-2-2. Click Reference to read the command reference about the selected command, i.e.,
create_clock.
3-2-3. Click Close in the Command Reference: create_clock dialog box.
3-2-4. Enter clk_pin_p in Clock name field.
138 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
www.xilinx.com 139
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
3-4. Describe the period property and review the waveform details of the clock
object.
3-4-1. 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.
3-4-2. 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
140 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
After the clock is created, the Timing Constraints window should look like the figure
below.
Notice the create_clock XDC command for the created clock in the All Constraints
section of the Timing Constraints window.
3-5. Assume the clock is ideal and enter the clock input jitter information.
3-5-1. Double-click Clocks (1) > Set Input Jitter using the Timing Constraints window.
Note: 0 is the default value for jitter; therefore, this specification is redundant. It is shown
here for completeness.
www.xilinx.com 141
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
Figure 7-13: Specify the Clock for Input Jitter Dialog Box
142 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
www.xilinx.com 143
© Copyright 2018 Xilinx
Lab 7: 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?
4-1. Launch the Create Generated Clock dialog box and associate the clock name
as clk_samp.
4-1-1. Double-click Clocks (2) > Create Generated Clock in the Timing Constraints Window.
144 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
4-2-1. Click the icon next to the Master pin (source) field.
The Specify Master Pin dialog box opens.
4-2-2. Ensure that Cell pins is selected from the Find names of type drop-down list.
4-2-3. Specify the search option as NAME CONTAINS BUF*CE_clk_samp_i0/* to search for the
pins of the clock buffer.
4-2-4. Enable the Search hierarchically option.
4-2-5. Click Find to initiate the search.
4-2-6. Select the input pin of the buffer from the Results > Found section.
www.xilinx.com 145
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
4-3. Specify clk_samp as a derived waveform with 1/32 frequency of the source
clock.
4-3-1. Select the By clock frequency option under the Derive from Source Clock Waveform
section, if it is not already selected.
4-3-2. Enter 32 as the division factor in the Divide source clock frequency by option.
146 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
4-5. 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 147
© Copyright 2018 Xilinx
Lab 7: 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?
Note that wave_gen_timing.xdc is the only XDC file in this project; hence, it was selected
by default.
4-6-8. Click OK.
4-6-9. Reopen the wave_gen_timing.xdc file.
Notice that the constraints are now written to the XDC file.
148 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
www.xilinx.com 149
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
Question 5
How many clock paths are constrained in this design?
Question 6
Are these timing errors expected? Why or why not?
150 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
5-2-2. 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
understanding.
5-2-3. Double-click the selected path in the Timing Summary window to view the detailed path
report.
5-2-4. Maximize or float the Path Report to look at the path details.
www.xilinx.com 151
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
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)
152 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 7: Introduction to Clock Constraints
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
selected 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.
www.xilinx.com 153
© Copyright 2018 Xilinx
Lab 7: Introduction to Clock Constraints Lab Workbook
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.
5-2-5. Extract the information required for the table below.
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.
5-2-8. 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.
154 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
Abstract
This lab will guide you through creating input and output XDC timing constraints by using the
Timing Constraints Editor. You will also utilize timing reports to verify the timing results.
This lab should take approximately 25 minutes.
Objectives
After completing this lab, you will be able to:
Specify input delay requirements with respect to real and virtual clocks
Define a virtual clock in a design
Specify output delay requirements in a design
Verify the timing reports to check that an implemented design has met timing
Introduction
The wave_gen design used in this lab is a programmable waveform generator.
www.xilinx.com 155
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
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
communication 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 apply input and output delay requirements for an FPGA. This lab
will also review the process of generating and reading timing reports.
The diagram below shows the systematic approach recommended for applying timing
constraints and incrementally progressing towards closure. There are three broad stages in the
Performance Baselining procedure recommended by Xilinx, which enables the designer to
achieve timing closure progressively.
This lab will focus on second stage of the Performance Baselining flow (optimizing the entire
chip) as explained in the below figure.
156 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
General Flow
Step 1: Step 2: Step 3: Step 4:
Opening Specifying Specifying Implement-
the the Input the Output ing the
Project Delays Delays Design
1-2. Open the Vivado Design Suite project named wave_gen.xpr located in the
C:\training\IOConstr_Intro\lab\[KCU105 | KC7xx]\netlist directory.
If you do not recall how to perform this task, refer to the "Opening a Vivado Design Suite
Project" section under Vivado Design Suite Operations in the Lab Reference Guide.
www.xilinx.com 157
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
Note: The timing constraints will vary based on the chosen FPGA device. The
following table lists the delay values for both the KCU105 and KC705 boards.
There are three input pins in the design. You will apply an input max delay
constraint of 1.25 ns and input min delay of 1 ns for the input pins. Details on
each input are listed below:
158 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
Similarly, identify the system-synchronous output pins and specify an output max
delay of 1.25 ns and min delay 0.5 ns constraints for all the output pins clocked
by the system clock.
Since the design clocks an external DAC, identify the source-synchronous output
pins clocked by spi_clk_pin and specify output max delay constraint of 1 ns and
min delay of -1 ns for all the output pins clocked by spi_clk_pin. spi_clk_pin is
already defined in the XDC.
The set input delay value for the maximum delay (setup analysis) = tco_max +
maximum board trace delay (trce_dly_max).
The set input delay value for the minimum delay (hold analysis) = tco_min +
minimum board trace delay (trce_dly_min).
The set output delay value for the maximum delay (setup analysis) = maximum
board trace delay (trce_dly_max) + setup requirement of the destination flip-flop
(tsu).
www.xilinx.com 159
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
The set output delay value for the minimum delay (hold analysis) = minimum
board trace delay (trce_dly_min) - hold requirement of the destination flip-flop
(thd).
1-4. Examine the tables above and answer the following questions.
Question 1
The data from the upstream device arrives at the FPGA pin with a maximum delay value
specified in the table above (upstream clock to out delay and trace delay), and the device has a
setup requirement. The data arrives at the FPGA with a minimum delay value, and the device has
a hold requirement.
How will you specify the input timing requirements at the FPGA for setup and hold analysis?
Assume an ideal system-synchronous interface with 0 skew.
Hint: Enter set_input_delay -help in the Tcl Console to view information on how to apply
an input delay constraint.
Question 2
The data output from the FPGA arrives at the downstream device with a maximum delay value
specified in the table above, and the device has setup requirement. FPGA data arrives at the
downstream device with a minimum delay value, and the downstream device has a hold
requirement value.
How will you specify the output delay requirements for the FPGA? Assume an ideal system-
synchronous interface with 0 skew.
Hint: Enter set_output_delay -help in the Tcl Console to view information on how to
apply an output delay constraint.
160 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
This window can also be opened by clicking Edit Timing Constraints under Synthesized
Design in the Flow Navigator.
The Timing Constraints window opens in the main workspace area.
2-2. Launch the Set Input Delay dialog box from the Timing Constraints window
to specify delay requirements on the input ports.
2-2-1. Double-click Set Input Delay (0) under the Inputs category in the Timing Constraints
window.
The Set Input Delay dialog box opens.
www.xilinx.com 161
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
162 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
www.xilinx.com 163
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
Note the set_input_delay XDC command at the bottom of the Set Input Delay
dialog box. This will create a set_input_delay with a 1.25 ns setup time requirement
on the rst_pin port in relationship to clk_pin_p.
2-4-5. Click OK.
164 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
The Timing Constraints window should look like the figure below with the newly created
command.
2-5. Specify 1 ns min delay requirement on the rst_pin port with respect to
clk_pin_p.
2-5-1. Double-click Set Input Delay (1) in the Timing Constraints window under the Inputs
category.
The Set Input Delay dialog box opens with the recently entered data.
If the fields in the dialog box are different from the above figure, repeat the instructions
that you completed at the beginning in which you found and specified clk_pin_p.
2-5-2. Enter 1 in the Delay value field of the Set Input Delay dialog box.
2-5-3. Enable the Delay value specifies <min/max> delay option.
www.xilinx.com 165
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
2-5-4. Select min from the Delay value specifies drop-down list.
This will create a set_input_delay with a 1 ns min delay requirement on the input
ports rst_pin.
2-5-6. Enter the following reporting command using the Tcl Console:
check_timing -verbose -override_defaults no_input_delay
This will check whether all input ports in the design are specified with the
set_input_delay constraint.
Note that lb_sel_pin and rxd_pin do not have input delay specifications.
166 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
You are creating a virtual clock; i.e., there is no source object (port/pin/net) with the
constraint.
2-6-5. Enter 5.161 in the Period field.
www.xilinx.com 167
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
2-7. Specify 1.25 ns max delay requirement on the lb_sel_pin port relative to
clk_tx_virtual.
2-7-1. Double-click Set Input Delay (2) under the Inputs category using the Timing Constraints
Window.
Figure 8-13: Specifying the Input Delay Requirement on the Virtual Clock
168 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
Figure 8-14: Specifying the Ports to the Input Delay Specification for the Virtual Clock
www.xilinx.com 169
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
2-10. KCU105 users only: Create a virtual clock named clk_rx_virtual with a period
property of [get_clocks clk_out1_clk_core].
2-10-1. Repeat the steps that you had previously followed to create the clk_tx_virtual virtual
clock to now create a virtual clock with the name clk_rx_virtual and a period of 5.00 ns.
170 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
This specifies a 1 ns min delay requirement on the rxd_pin port with respect to
clk_rx_virtual/clk_pin_p.
The unsaved constraints section of the Timing Constraints window should look like the
figure below.
Figure 8-15: Unsaved Constraints Section of the Timing Constraints Window (KCU105)
2-13-6. Enter the following reporting command using the Tcl Console:
check_timing -verbose -override_defaults no_input_delay
This will check whether all input ports in the design are specified with the
set_input_delay constraint.
Question 3
Were all the input ports specified with input delay requirements?
2-14. The All Constraints Section of the Timing Constraints window displays the
timing commands that have been run and that are applied to the design
that is loaded in the memory.
Commit the constraints to the design so that they are applied to the design. The
applied constraints can be saved by writing them to a Xilinx design constraints
(XDC) file.
2-14-1. Select File > Constraints > Save.
www.xilinx.com 171
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
2-14-2. Make sure that Select an existing file with wave_gen_timing.xdc is selected.
2-14-3. Click OK.
172 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
3-2. Associate the led_pins[*] and txd_pin objects to the output delay
specification.
www.xilinx.com 173
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
3-3. Specify the delay value to the set output delay command.
3-3-1. Enter 1.25 ns in the Delay value field.
3-3-2. Leave the other fields at their defaults.
Figure 8-19: Specifying the Delay Value to the Set Output Delay Command
3-4. Specify the minimum delay value to the set output delay command.
3-4-1. Double-click Set Output Delay (1) in the Timing Constraints window under the Outputs
category.
The Set Output Delay dialog box opens with the recently entered data.
If the fields in the dialog box are different from the above figure, repeat the instructions
that you completed at the beginning in which you found and specified clk_tx_virtual.
3-4-2. Enter 0.5 ns in the Delay value field of the Set Output Delay dialog box.
3-4-3. Enable the Delay value specifies <min/max> delay option.
3-4-4. Select min from the Delay value specifies drop-down list.
3-4-5. Click OK.
This will create a set_output_delay with a 0.5 ns min delay requirement on the
output ports led_pins[*] and txd_pin.
174 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
3-5. Specify the output delay for spi_mosi_pin, dac_cs_n_pin, and dac_clr_n_pin
with a max delay requirement of 1 ns with respect to spi_clk.
3-5-1. Double-click Set Output Delay (2) under the Outputs category in the Timing Constraints
window.
3-5-2. Enter [get_clocks {spi_clk}] in the Clock field.
3-5-3. Enter [get_ports {dac_clr_n_pin dac_cs_n_pin spi_mosi_pin}] in the
Objects (ports) field.
3-5-4. Enter 1 ns in the Delay value field.
3-5-5. Enable the Delay value specifies <min/max> delay option.
3-5-6. Select max from the Delay value specifies <min/max> delay list.
www.xilinx.com 175
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
3-7. Confirm that all output ports in the design were specified with output delay
requirements.
3-7-1. Enter the following command in the Tcl Console:
check_timing -verbose -override_defaults no_output_delay
spi_clk_pin is not constrained with the set_output_delay command because it is a
source-synchronous pin that goes to the clk pin of any sequential element in the
downstream device.
Notice that all other output ports were specified with output delay requirements.
176 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
The paths in Intra-Clock Paths section and Other Path Groups section have failed to meet
timing.
Note: Click OK in the Critical Messages dialog box.
4-4-2. Click OK to generate the timing report with the default options.
The generated timing report opens in the Timing tab at the bottom.
4-4-4. Click to also select clock paths when the timing path is selected.
www.xilinx.com 177
© Copyright 2018 Xilinx
Lab 8: I/O Constraints and Virtual Clocks Lab Workbook
Note: The timing values generated by the Timing Report may vary slightly.
Notice that there are timing errors in the design.
4-4-5. Enter the report_timing_summary command in the Tcl console.
4-4-6. Select the first path under the clk_out1_clk_core group and press <F4>.
Figure 8-23: Schematic of the Timing Path with Data Path and Clock Path (KCU105)
Question 4
Are these timing errors expected? Why or why not?
178 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 8: I/O Constraints and Virtual Clocks
With the I/O timing specifications added, timing analysis has accounted for the FPGA's
interface level and internal timing. The few paths that are failing for I/O timing are
related to asynchronous reset input. The timing failures in the clk_out1_clk_core domain
are multicycle paths. These timings will be closed in the Fine Tuning stage of timing
specification and analysis.
Summary
This lab illustrated how the input and output delay requirements are specified to the design by
using the Timing Constraints window.
www.xilinx.com 179
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
Abstract
This lab introduces you to the Timing Constraints Wizard in the Vivado® IDE. The Timing
Constraints Wizard helps you create timing constraints in a design, such as clock and I/O
constraints.
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 20 minutes.
Objectives
After completing this lab, you will be able to:
Use the Timing Constraints Wizard in the Vivado IDE to enter timing constraints
Review the timing report to determine if the constraints are attainable
www.xilinx.com 181
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
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
communication 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.
Prior to implementation, there are timing and physical constraints that need to be
defined. The Vivado IDE enables you to interactively enter these timing and
physical constraints to the design.
The wave_gen design has a 300-MHz clock (KCU105 users) or 200-MHz clock
(KC7xx) supplied through differential clock input ports on the FPGA. You will first
define the primary clock object for the design and define a create_clock
constraint for the clock object.
182 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
In addition to differential clock input ports, there are three more input signals in
the wave_gen design:
o rst_pin: Asynchronous reset input for MMCM
o rxd_pin: Serial receiver port
o lb_sel_pin: Loopback switch input that generates the lb_sel net, which is the
debounced output of the switch using tx_clk
You will specify input delay requirements on rst_pin, rxd_pin, and lb_sel_pin.
An input_delay constraint for the above pins needs to be specified. Later an
output_delay constraint needs to be specified from the output flip-flops to the
led_pins ports, which are the outputs for the design.
You will use the Timing Constraints Wizard to apply timing constraints to the
design.
General Flow
Step 2: Step 3:
Step 1: Step 4:
Entering Entering
Opening Implement-
Timing Timing
an Existing ing and
Constraints Constraints
Project Analyzing
[UltraScale] [7 Series]
www.xilinx.com 183
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
1-2. Open the Vivado Design Suite project named wave_gen.xpr located in the
C:\training\Constr_Wizard\lab\[KCU105 | KC7xx]\verilog directory.
If you do not recall how to perform this task, refer to the "Opening a Vivado
Design Suite Project" section under Vivado Design Suite Operations in the Lab
Reference Guide.
In order to apply the constraints to the design, the synthesized design has to be
opened. Therefore, you will start the lab by opening the synthesized design.
1-5. Generate the timing summary report to view any missing constraints in the
design.
1-5-1. Click Report Timing Summary under Synthesis > Open Synthesized Design.
1-5-2. Click OK to run the default Timing Summary report.
1-5-3. Review the Check Timing section of the Timing Summary report.
Notice that there are warnings under the no_clock, no_input_delay, and no_output_delay
section of the report.
This means that there are no clocks defined and that no input and output delay
constraints are applied to the design.
184 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
Figure 9-2: Identify and Recommend Missing Timing Constraints Dialog Box
www.xilinx.com 185
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
Question 1
What effect do timing constraints have on the implementation tools? What do the tools do if
there are no constraints applied?
KCU105 users: Continue with the "UltraScale Users Only: Entering Timing Constraints"
step.
KC7xx users: Proceed to the "7 Series Users Only: Entering Timing Constraints" step.
186 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
This will open the Quick Help dialog box and more information is provided on the
Primary Clocks page.
2-1-3. Review the information in the Quick Help dialog box.
2-1-4. Click X to close the Quick Help dialog box and get back to the Primary Clocks page.
2-1-5. Enter 300 in the Frequency (MHz) column.
2-1-6. Observe that the Frequency, Rise At, and Fall At values are automatically generated
based on Period.
Note: The create_clock XDC command is also displayed under the Tcl Command
Preview tab.
www.xilinx.com 187
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
You can also view existing create clock constraints (if any) in the design under the
Existing Create Clock Constraints tab.
188 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
You will now specify the input delay requirements on rst_pin, rxd_pin, and
lb_sel_pin with respect to the virtual clock by using the Set Input Delay command
in the Timing Constraints Wizard.
In the Input Delays dialog box of the Timing Constraints Wizard, notice that a
constraint on rxd_pin, rst_pin, and lb_sel_pin is recommended.
2-2. Specify 1.25 ns as the input delay value for maximum (setup) analysis on the
rxd_pin ports with respect to the virtual clock.
2-2-1. Select rxd_pin and on the right side under Delay Parameters so that you can find various
parameters to define the setup and hold requirements.
2-2-2. Enter 0.35 (ns) in the tco_max field.
2-2-3. Enter 0.9 (ns) and trce_dly_max field.
This specifies an input delay value of 1.25 ns (i.e., tco_max + trce_dly_max) on rxd_pin for
setup (maximum delay) analysis.
Note: The virtual clock, in this case VIRTUAL_clock_out2_clk_core, is used for I/O timing
and is automatically generated in the Input Delays window of the Timing Constraints
Wizard.
Figure 9-5: Specifying Input Delay Value on rxd_pin for Setup Analysis
www.xilinx.com 189
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
2-3. Specify a 1 ns input delay value for minimum (hold) analysis on the rxd_pin
port with respect to the virtual clock.
2-3-1. Enter 0.2 (ns) in the tco_min column.
2-3-2. Enter 0.8 (ns) in the trce_dly_min column.
Figure 9-6: Specifying Input Delay Value on rxd_pin for Hold Analysis
This specifies an input delay value of 1 ns (i.e., tco_min and trce_dly_min) on the rxd_pin
port for hold analysis.
190 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
2-4. Specify the input delay values 1.25 ns and 1 ns for maximum (setup) and
minimum (hold) analysis respectively on the rst_pin and lb_sel_pin ports
with respect to the virtual clock.
2-4-1. Repeat the above steps for rst_pin and lb_sel_pin.
Note: The XDC command set_input_delay under the Tcl Command Preview tab can
also be run from the Tcl Console to create a set_input_delay constraint with a 1 ns
input delay value for hold analysis and 1.25 ns input delay value for setup analysis on the
rst_pin, rxd_pin, and lb_sel_pin ports.
2-4-2. Click Apply.
www.xilinx.com 191
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
2-5. Specify the output delay value of 1.25 ns for setup and 0.5 ns for hold
analysis on the following with respect to the virtual clock by using the Set
Output Delay command in the Timing Constraints Wizard
o led_pins[*]
o spi_mosi_pin
o txd_pin
o dac_clr_n_pin
o dac_cs_n_pin
2-5-1. Uncheck the spi_clk_pin in the Output Delays dialog box of the Timing Constraints
Wizard.
spi_clk_pin is not constrained with the set_output_delay command because it is a
source-synchronous pin that goes to the clk pin of any sequential element in the
downstream device.
2-5-2. Select the led_pins[*] in the Output Delays Dialog box.
2-5-3. Enter 0.9 ns in the trce_dly_max column.
2-5-4. Enter 0.35 ns in the tsu column.
192 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
www.xilinx.com 193
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
194 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
2-7. Verify that the timing constraints have been applied to the
wave_gen_timing.xdc file.
2-7-1. Observe the constraints applied in the Timing Constraints window that is opened.
2-7-2. Select the Sources > Hierarchy view.
2-7-3. Expand the Constraints folder.
2-7-4. Double-click the wave_gen_timing.xdc file to open the file.
You should see that the timing constraints were saved to the XDC file.
2-7-5. Close the wave_gen_timing.xdc file.
2-7-6. Close the Timing Constraints window.
www.xilinx.com 195
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
196 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
You will now specify the input delay requirements on rst_pin, rxd_pin, and
lb_sel_pin with respect to clk_pin_p by using the Set Input Delay command in the
Timing Constraints Wizard.
In the Input Delays dialog box of the Timing Constraints Wizard, notice that a
constraint on rxd_pin, rst_pin, and lb_sel_pin is recommended.
3-2. Specify 1.25 ns as the input delay value for maximum (setup) analysis on the
rxd_pin port with respect to clk_pin_p.
3-2-1. Select rxd_pin on left side and on the right side under Delay Parameters, you can find
various parameters to define the setup and hold requirements.
3-2-2. Enter 0.35 (ns) in the tco_max field.
3-2-3. Enter 0.9 (ns) and trce_dly_max field.
This specifies an input delay value of 1.25 ns (i.e., tco_max and trce_dly_max) on rxd_pin
for setup analysis.
Figure 9-13: Specifying Input Delay Value on rxd_pin for Setup Analysis
www.xilinx.com 197
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
3-3. Specify 1 ns as input delay value for minimum (hold) analysis on the rxd_pin
port with respect to clk_pin_p.
3-3-1. Enter 0.2 (ns) in the tco_min column.
3-3-2. Enter 0.8 (ns) in the trce_dly_min column.
Figure 9-14: Specifying Input Delay Value on rxd_pin for Hold Time Analysis
This specifies an input delay of 1 ns (i.e., tco_min and trce_dly_min) on the rxd_pin port
for hold analysis.
198 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
3-4. Specify the input delay values 1.25 ns and 1 ns for maximum (setup) and
minimum (hold) analysis on the rst_pin and lb_sel_pin ports with respect to
clk_pin_p.
3-4-1. Repeat the above steps for rst_pin and lb_sel_pin.
Note: The XDC command set_input_delay under the Tcl Command Preview tab can
also be run from the Tcl Console to create a set_input_delay constraint with a 1 ns
input delay for hold analysis and 1.25 ns input delay for setup analysis on the rst_pin,
rxd_pin, and lb_sel_pin ports.
3-4-2. Click Apply.
www.xilinx.com 199
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
3-5. Specify the output delay of 1.25 ns on the following with respect to
clk_pin_p by using the Set Output Delay command in the Timing Constraints
Wizard:
led_pins[*]
spi_mosi_pin
txd_pin
dac_clr_n_pin
dac_cs_n_pin
3-5-1. Uncheck the spi_clk_pin in the Output Delays dialog box of the Timing Constraints
Wizard.
spi_clk_pin is not constrained with the set_output_delay command because it is a
source-synchronous pin that goes to the clk pin of any sequential element in the
downstream device.
3-5-2. Select led_pins[*] in the Output Delays dialog box.
3-5-3. Enter 0.9 ns in the trce_dly_max column.
3-5-4. Enter 0.35 ns in the tsu column.
200 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
www.xilinx.com 201
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
3-7. Verify that the timing constraints have been applied to the
wave_gen_timing.xdc file.
3-7-1. Observe the constraints applied in the Timing Constraints window that is opened.
3-7-2. Select the Sources > Hierarchy view.
3-7-3. Expand the Constraints folder.
202 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
You should see that the timing constraints were saved to the XDC file.
3-7-5. Close the wave_gen_timing.xdc file.
3-7-6. Close the Timing Constraints window.
This section shows that spi_clk_pin is the port with no output delay. All other ports are
constrained.
spi_clk_pin is a source-synchronous pin that goes to the clk pin of any sequential element
in the downstream device. Hence it is not constrained with set_output_delay.
4-1-3. Close the Timing Summary report.
www.xilinx.com 203
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
Question 2
Are these timing errors expected?
Question 3
If timing was not met after the timing constraints were applied, what could be done?
204 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 9: Timing Constraints Wizard
Question 4
Are the worst paths the same in the estimated timing report and implemented timing reports? If
not, why?
Question 5
What information can you obtain from the timing report?
www.xilinx.com 205
© Copyright 2018 Xilinx
Lab 9: Timing Constraints Wizard Lab Workbook
Summary
In this lab, you used the Timing Constraints Wizard in the Vivado Design Suite to enter
create_clock, set_input_delay, and set_output_delay constraints. You also reviewed
the estimated and final timing reports.
Timing constraints are the best way to communicate your performance expectations to the
implementation tools. However, do not forget about pin placement. Good placement can make
it easier for the tools to meet timing.
206 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
Abstract
This lab introduces the Xilinx Power Estimator (XPE) spreadsheet, which is power estimation tool
typically used in the pre-design and pre-implementation phases of the project.
This lab should take approximately 40 minutes.
Objectives
After completing this lab, you will be able to:
Estimate the resources required for a design, based on the high-level design description
Enter the amount of resources required for the design into the XPE
Enter the default activity rates for the components used
Evaluate the estimated power calculated by the XPE
Introduction
The Xilinx Power Estimator (XPE) assists with architecture evaluation, device selection,
appropriate power supply components, and thermal management components specific to your
application.
The XPE considers your design resource usage, toggle rates, I/O loading, and many other factors
which it combines with the device models to calculate the estimated power distribution. The
device models are extracted from measurements, simulation, and/or extrapolation.
The accuracy of the XPE is dependent on two primary sets of inputs:
Device utilization, component configuration, clock, enable, and toggle rates, and other
information you enter into the tool
Device data models integrated into the tool
For accurate estimates of your application, enter realistic information that is as complete as
possible. Modeling a certain aspect of the design conservatively or without sufficient knowledge
of the design can result in unrealistic estimates.
www.xilinx.com 207
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
The design used in this lab will communicate with the UCD9248 power supply controller chip
(which monitors and controls the voltage rails) available on the KC705 board.
208 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
The design also has power consuming modules instantiated 128 times and a UART module that
sends/receive commands with the host PC at a 115200 baud rate.
clk_gen module: This modules generates two clocks: 100 MHz and 50 MHz. The input clock to
this module is from the clk200_p and clk200_n differential clock pair on the KC705 board. The
differential clock inputs are supplied to the MMCM, which generates clk100 and clk50 using the
MMCM. The clk100 is used by the Power Consuming Module (PCM) while the remaining
modules in design are driven by clk50.
uart_control module: This module consists of UART_RX, UART_TX, and the PicoBlaze processor.
UART_RX is used to receive the command from the host. UART_TX will send the information
corresponding to the host command decoded by the processor.
Power Consuming Module (power_sink): This module consists of a pseudo-random number
generator, 16-bit accumulator, 16-bit toggle shift register and another PicoBlaze processor. The
program executed by the PicoBlaze processor (KCPSM6) can therefore be written to emphasize
the use of certain features at different times either to adjust power consumption in general or to
evaluate the relative power consumption of different resources.
power_test_control module: The PicoBlaze processor (KCPSM6) implements a PMBus protocol
to communicate with the UCD9248 power supply controller (Texas Instruments) on the KC705
board. This will be used to read the die temperature, power consumed by the device, and supply
voltages.
www.xilinx.com 209
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
General Flow
Step 1: Step 2: Step 3: Step 4:
Opening Estimating Entering Evaluating
the XPE Required Each the Power
Spreadsheet Resources Resource Estimates
1-1. Open the spreadsheet targeted for the Kintex-7 device and make sure that
your Microsoft Excel settings allow macro extensions.
1-1-1. Open the 7_Series_XPE_2018_1.xls XPE spreadsheet located in the C:\training\
XPE\lab\KC705 directory.
The latest updated spreadsheets for various FPGAs will be available at
www.xilinx.com/products/technology/power/xpe.html.
In Excel, the macro security level is set to High by default, which disables macros.
1-1-2. Change the macro security level if needed:
210 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
Question 1
What information is provided in the Clock, Logic, IO, BRAM, DSP, CLKMGR, and GTX worksheets?
www.xilinx.com 211
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
212 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
o Environment
Ambient Temp: 30° C
Airflow: 250 LFM
Heat Sink: Medium Profile
# of Board Layers: 16 or more
The power optimization option in the Implementation setting minimizes the core
dynamic power.
2-2-2. Save the file.
www.xilinx.com 213
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
Question 2
Based on the Device characterization under settings (Production, Advance, and Preliminary),
what are your expectations about the quality of power estimation?
214 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
www.xilinx.com 215
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
second bit you would enter 50% because this bit toggles every other rising
edge of the clock.
o For non-periodic or event-driven portions of designs, toggle rates cannot be
easily predicted. An effective method of estimating average toggle rates for a
given design is to segregate the different sections of the design based on
their functionality or hierarchy and estimate the toggle rates for each of the
sub-blocks. An average toggle rate can then be arrived at by calculating the
average for the entire design or hierarchy. Most logic-intensive designs work
at around 12.5% average toggle rate, which is the default toggle rate setting
in XPE.
o It has been observed that designs with random data patterns as input
generally have toggle rates between 10%–30%. However, designs with a lot of
glitch logic can have toggle rates as high as or even higher than 50%. Glitch
logic is generally classified as combinatorial functions which have a high
probability of the output changing when any one input changes, such as XOR
gates or unregistered arithmetic logic (i.e., adders). Functions that use large
amounts of such logic, such as error detection/correction circuitry, might
exhibit higher toggle rates due to this. Designs with large amounts of control
path logic, such as embedded designs, on average have lower toggle rates
due to large sections of logic being inactive at any given time during
operation.
The details entered here are the default values for the LOGIC, I/O, BRAM, DSP, and other
worksheets.
216 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
3-1-2. Set the Toggle rate to 20% in the Logic field (for worst-case analysis). Set the rate to 100
MHz in the All Clock Nets field.
3-1-3. Enter the default toggle rates for others as shown in the figure below and click OK.
3-1-4. Review the Logic page after changing these parameters and verify that the toggle rate
has changed from 12.5% to 20%. Update the clock in the E13 cell to 50 Mhz.
3-1-5. Record the changes in On-Chip Power and Junction Temperature in the Summary
worksheet.
The Total On-Chip Power has been increased to 0.426W from 0.332W
3-1-6. Alter the toggle rate value to see the impact on power consumption.
Note: Typically, logic-intensive designs work at around 12.5% of the synchronizing clock
(12.5% is the default value used in XPE). For a worst-case estimate, a toggle rate of 20%
can be used. Average toggle rates greater than 20% are not very common. Arithmetic-
intensive modules of a design seem to take toggle rates of up to 50%, which is
representative of the absolute worst case. An example of this would be a multiply-
accumulate operation. It is also common to model toggle rate for random input data at
50%. To appreciate what 100% toggle rate means, think of a constantly enabled toggle
flip-flop (TFF) whose data input is tied High. The T-output of this flip-flop toggles every
clock edge. Very few designs could have an average rate that high (100%).
www.xilinx.com 217
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
3-2-4. Review the Total On-Chip Power and Junction Temperature in the Summary worksheet
after adding clock information.
218 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
fan_tach In 1 LVCMOS25
The table does not include all the information like I/O Bank, I/O Settings, and
Clock Frequency. Fill the data in spreadsheet as shown in the figure below.
3-3-1. Select the IO worksheet.
3-3-2. Enter the number of input pins, output pins, and I/O standards from the Top-Level
Input/Output ports table.
3-3-3. Enter the clock as 200 MHz for clk200.
3-3-4. Save the file.
www.xilinx.com 219
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
The On-Chip power and Junction Temperature increases again by applying the I/O Pin
details.
Note: Since there are no DSP resources in the design, skip the DSP sheet.
220 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
There is no need to add any IPs now. Just review the worksheet to create IP and close the
XPE IP Manager tab.
www.xilinx.com 221
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
Question 3
Enter the data in the following tables:
Summary XPE
Summary of XPE
CLOCK
LOGIC
BRAM
DSP
MMCM
IO
Device Static
You should note that the logic (CLB) resources use the highest percentage of total
power. Remember that their power consumption can be altered by redesigning so that
more resources map to dedicated hardware (which uses less power) instead of logic.
You should also remember that this example provides only a rough estimate. The
estimation improves with every step, as shown below.
o As the actual system is built and the amount of logic resources is actually known, the
power estimate will get more accurate.
o Likewise, after the design has been routed, the power estimate will be more accurate.
o Finally, after implementation has been done and simulation data has been loaded (to
estimate dynamic power consumption with an SAIF file) the power estimate will be
the best.
222 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
You should also be able to verify (from the Summary) that dynamic power consumes a
lot more power than static power. So if the clock frequencies used were slower, power
consumption would decrease.
Vccint
Vccbram
Vccaux
Vcco2.5v
Vcco1.8v
Vccadc
www.xilinx.com 223
© Copyright 2018 Xilinx
Lab 10: Xilinx Power Estimator Spreadsheet Lab Workbook
This helps with more easily comparing the different configuration results.
224 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 10: Xilinx Power Estimator Spreadsheet
Question 4
The project manager decides to add additional logic and make other changes to the design.
How will you make the changes outlined below? Determine if there is sufficient thermal margin.
The design needs to be estimated as more DSP-like and the effective clock rates have to
double.
More block RAMs will be needed (30) and they will be clocked at 200 MHz.
DSP slice resources will need to be added as well (40) and they will be clocked at 200 MHz.
Increase the Logic and Registers to 150000 and fanout to 160000 for the clock with 200MHz.
If all options are assumed to run in the worst-case scenario (except the ambient temperature
can be 50 degrees Celsius).
Question 5
Modify the environment (heat sink use and airflow) so that the FPGA can operate as the project
manager needs.
Summary
You entered the estimated resources for the design by using the outline of the design in the
Xilinx Power Estimator (XPE) spreadsheet and reviewed the estimated power of the design.
www.xilinx.com 225
© Copyright 2018 Xilinx
Lab Workbook Lab 11: Introduction to Tcl
Abstract
In this lab, you will learn some basic ways of interfacing with the operating system so that you
can perform file and directory management, and you will explore a number of commonly used
Tcl commands.
This lab should take approximately 20 minutes.
Objectives
After exercising this lab, you will be able to:
Maneuver through a file system
Use three very commonly accessed Tcl commands: puts, set, and source
Create variables using set
Use the created variables
Introduction
Tcl interfaces natively with the C language due to the way it was originally written. However, the
Tcl shell enables common operating system (OS) commands (like cd, pwd, dir, etc.) to be
handled successfully.
If the Tcl interpreter is unable to handle an OS command, it will pass the command to the OS
shell for execution. On such occasions, a warning message will be issued, indicating that the
command is an unknown Tcl command and that it has been sent to the OS shell for execution.
The common OS commands are essential for file and directory management and for interfacing
with other languages.
General Flow
Step 1: Step 2: Step 3:
Accessing Working Intro to
the with the Tcl Program-
Tcl Shell OS ming
www.xilinx.com 227
© Copyright 2018 Xilinx
Lab 11: Introduction to Tcl Lab Workbook
OR
For Windows 10: Select Start > Xilinx Design Tools > Vivado 2018.1 Tcl Shell.
This opens the Tcl interactive shell.
228 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 11: Introduction to Tcl
dir [<path>] Lists the files and directories under <path>. Note that
backslashes are used with this command, which is a Tcl
keyword; therefore, when specifying a path you must
use two backslashes. Example:
dir\\training\\Tcl_Intro\\lab
pwd Prints the working directory; displays the full path of the
current location in the file system hierarchy of the OS
www.xilinx.com 229
© Copyright 2018 Xilinx
Lab 11: Introduction to Tcl Lab Workbook
2-2. Determine the current directory when the Tcl shell opens.
2-2-1. Enter pwd (1).
2-3. The working files for this lab are located in C:\training\Tcl_Intro\lab. Move
to this directory so that you are not required to enter the full path for every
file access.
2-3-1. Enter cd c:/training/Tcl_Intro/lab (2).
2-3-2. Enter pwd again, or press the Up Arrow key twice (2).
230 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 11: Introduction to Tcl
2-4. Create a new directory to work from for this lab named Intro_Tcl.
2-4-1. Enter file mkdir Intro_Tcl (5).
2-4-2. Enter dir to confirm that the Intro_Tcl directory was created (6).
www.xilinx.com 231
© Copyright 2018 Xilinx
Lab 11: Introduction to Tcl Lab Workbook
232 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 11: Introduction to Tcl
3-1. The first step is to provide the name and location of the count_to_10.tcl
script.
3-1-1. Clear the window with the cls command in the Tcl shell.
3-1-2. Display a message to the user asking for the name of the Tcl function to time.
3-2. Get the current system time (before the script is run) and save it for later.
3-2-1. Enter set TIME_start [clock milliseconds] (3).
Note that count_to_10.tcl is executed and that its output is visible on the console.
The source command is useful for running existing scripts.
3-4. Get the current system time (after the script is run) and save it for later.
3-4-1. Enter set TIME_end [clock milliseconds] (5).
Note that first the clock command is executed, then the result is assigned to TIME_end.
www.xilinx.com 233
© Copyright 2018 Xilinx
Lab 11: Introduction to Tcl Lab Workbook
3-5. Compute the amount of time elapsed and inform the user.
3-5-1. Enter set TIME_taken [expr $TIME_end - $TIME_start] (6).
3-5-2. Enter puts "Script $tcl_script_name took $TIME_taken milliseconds
to run" (7).
Question 1
Is this amount of time reasonable for a Tcl script to count to 10? Why or why not?
Question 2
How can we make the measurement of time for the script to run more accurate?
3-6. These commands have been collected for you in a script file so that there is
no typing delay time when running the script. Run the timer.tcl script file.
3-6-1. Open and observe the timer.tcl file located at C:\training\Tcl_Intro\support using your
preferred text editor.
Observe how the commands above have been included in a file to eliminate delays
caused by user interaction.
3-6-2. Enter source c:/training/Tcl_Intro/support/timer.tcl (8).
3-6-3. Enter c:/training/Tcl_Intro/support/count_to_10.tcl when the script asks
for a Tcl script to time.
Note the output from count_to_10.tcl as well as the displayed comments (lines beginning
with '#').
Question 3
Is the amount of time reasonable for a Tcl script to count to 10? Why or why not?
234 www.xilinx.com
© Copyright 2018 Xilinx
Lab Workbook Lab 11: Introduction to Tcl
Question 4
If you were looking to count to 10 as fast as possible, is Tcl a good choice? Why or why not?
Note: Your timing values may vary slightly, but they should be in the range of 10-100
ms.
www.xilinx.com 235
© Copyright 2018 Xilinx
Lab 11: Introduction to Tcl Lab Workbook
Summary
You have just completed two important steps in the process of becoming familiar with Tcl and
the Vivado Design Suite Tcl shell: talking to the operating system (for file and directory
management), and seeing how the puts, set, and source commands can be used. While far
from the only list, or even the most important, these capabilities are used frequently for both
debugging and increasing productivity.
236 www.xilinx.com
© Copyright 2018 Xilinx