Lab 1
Lab 1
Objectives
After completing this lab, you will be able to:
Create a Vivado project sourcing HDL model(s) and targeting the ZYNQ device located on the
ZedBoard and the Zybo
Use the provided Xilinx Design Constraint (XDC) file to constrain the pin locations
Simulate the design using the Vivado simulator
Synthesize and implement the design
Generate the bitstream
Configure ZYNQ using the generated bitstream and verify the functionality
Procedure
This lab is broken into steps that consist of general overview statements providing information on the
detailed instructions that follow. Follow these detailed instructions to progress through the lab.
Note: You will notice certain procedures have different variations depending on development
board being ZedBoard or Zybo. It will be explicitly mentioned in notes when such variation is
encountered
Design Description
The design consists of some inputs that are logically operated on before the results are output on the
LEDs as shown in Figure 1. Other inputs are directly connected to the corresponding output LEDs.
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-1
Lab Workbook
Note: SW4 SW7 and LD4 LD7 do not exist on Zybo and hence will be routed to PMOD pins
instead. ZedBoard will use the completed design in Figure 1 as is. HDL source files will remain
common for both ZedBoard and Zybo. Zybo routing changes to external PMOD for pins SW4
SW7 and LD4 LD7 will be made through their respective XDC files.
General Flow
Step 1:
Create a
Vivado
Project using
IDE
Step 2:
Simulate the
Design using
Vivado
Simulator
Step 5:
Perform the
Timing
Simulation
Step 6:
Step 3:
Step 4:
Synthesize
the Design
Implement
the Design
Verify
Functionality
in Hardware
Step 1
1-1-1. Open Vivado by selecting Start > All Programs > Xilinx Design Tools > Vivado 2016.2 >
Vivado 2016.2
1-1-2. Click Create New Project to start the wizard. You will see Create A New Vivado Project dialog
box. Click Next.
1-1-3. Click the Browse button of the Project location field of the New Project form, browse to
c:\xup\fpga_flow\2016_2_ZYNQ_labs, and click Select.
1-1-4. Enter lab1 in the Project name field. Make sure that the Create Project Subdirectory box is
checked. Click Next.
ZYNQ 1-2
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-3
Lab Workbook
If it isnt already checked, check Copy sources into project and then click Next to get to the Add
Existing IP form.
1-1-8. Since we do not have any IP to add, click Next to get to the Add Constraints form.
1-1-9. Click on the Green Plus button, then Add Files and browse to the
c:\xup\fpga_flow\2016_2_ZYNQ_sources\lab1 directory (if necessary), select
lab1_ZedBoard.xdc, or lab1_Zybo.xdc and click OK (if necessary), and then click Next.
This Xilinx Design Constraints file assigns the physical IO locations on FPGA to the switches and
LEDs located on the board. This information can be obtained either through the boards
schematic or the boards user guide.
1-1-10. In the Default Part form, use the Parts option and various drop-down fields of the Filter section. If
using the ZedBoard, select the XC7Z020clg484-1 part. If using the Zybo, select the
XC7Z010clg400-1.
ZYNQ 1-4
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-5
Lab Workbook
ZYNQ 1-6
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
1-2.
1-2-1. In the Sources pane, double-click the lab1.v entry to open the file in text mode.
1-3.
1-3-1. In the Sources pane, expand the Constraints folder and double-click the lab1_<board>.xdc entry
to open the file in text mode.
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-7
Lab Workbook
1-4.
1-4-1. Expand the Open Elaborated Design entry under the RTL Analysis tasks of the Flow Navigator
pane and click on Schematic.
The model (design) will be elaborated and a logic view of the design is displayed.
2-1-1. Click Add Sources under the Project Manager tasks of the Flow Navigator pane.
ZYNQ 1-8
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Step 2
Lab Workbook
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-9
Lab Workbook
2-2.
2-2-1. Select Simulation Settings under the Project Manager tasks of the Flow Navigator pane.
A Project Settings form will appear showing the Simulation properties form.
2-2-2. Select the Simulation tab, and set the Simulation Run Time value to 200 ns and click OK.
ZYNQ 1-10
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
ZYNQ 1-11
Lab Workbook
You will see four main views: (i) Scopes, where the testbench hierarchy as well as glbl instances
are displayed, (ii) Objects, where top-level signals are displayed, (iii) the waveform window, and
(iv) Tcl Console where the simulation activities are displayed. Notice that since the testbench
used is self-checking, the results are displayed as the simulation is run.
Notice that the lab1.sim directory is created under the lab1 directory, along with several lowerlevel directories.
Waveform options
Save the waveform
Zoom In
Zoom Out
Zoom Fit
Zoom to cursor
Go to Time 0
Go to Last Time
Previous Transition
Next Transition
Add Marker
Previous Marker
Next Marker
Swap Cursors
Snap to Transition
Floating Ruler
ZYNQ 1-12
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
2-3.
2-4.
Add more signals to monitor the lower-level signals and continue to run the
simulation for 500 ns.
2-4-1. Expand the lab1_tb instance, if necessary, in the Scopes window and select the dut instance.
The swt[7:0] and led[7:0] signals will be displayed in the Objects window.
) since we
) button.
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-13
Lab Workbook
2-4-4. Click on the Zoom Fit button and observe the output.
Figure 21. Tcl Console output after running the simulation for additional 500 ns
2-4-5. Close the simulator by selecting File > Close Simulation.
2-4-6. Click OK and then click Discard to close it without saving the waveform.
Step 3
Synthesize the design with the Vivado synthesis tool and analyze the
Project Summary output.
3-1-1. Click on Run Synthesis under the Synthesis tasks of the Flow Navigator pane.
The synthesis process will be run on the lab1.v file (and all its hierarchical files if they exist).
When the process is completed a Synthesis Completed dialog box with three options will be
displayed.
3-1-2. Select the Open Synthesized Design option and click OK as we want to look at the synthesis
output before progressing to the implementation stage.
Click Yes to close the elaborated design if the dialog box is displayed.
3-1-3. Select the Project Summary tab and understand the various windows.
If you dont see the Project Summary tab then select Layout > Default Layout, or click the
Project Summary icon
ZYNQ 1-14
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-15
Lab Workbook
ZYNQ 1-16
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
Step 4
4-1-1. Click on Run Implementation under the Implementation tasks of the Flow Navigator pane.
The implementation process will be run on the synthesized design. When the process is
completed an Implementation Completed dialog box with three options will be displayed.
4-1-2. Select Open implemented design and click OK as we want to look at the implemented design in
a Device view tab.
4-1-3. Click Yes, if prompted, to close the synthesized design.
The implemented design will be opened.
4-1-4. In the Netlist pane, select one of the nets (e.g. led_OBUF[1]) and notice that the net displayed in
the X1Y1 (ZedBoard), or X1Y1 (Zybo) clock region in the Device view tab (you may have to zoom
in to see it).
ZYNQ 1-17
Lab Workbook
ZYNQ 1-18
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
ZYNQ 1-19
Lab Workbook
Using the Windows Explorer, verify that impl_1 directory is created at the same level as synth_1
under the lab1.runs directory. The impl_1 directory contains several files including the
implementation report files.
4-1-7. In Vivado, select the Reports tab in the bottom panel (if not visible, click Window in the menu bar
and select Reports), and double-click on the Utilization Report entry under the Place Design
section. The report will be displayed in the auxiliary view pane showing resource utilization. Note
that since the design is combinatorial no registers are used.
Step 5
5-1-1. Select Run Simulation > Run Post-Implementation Timing Simulation process under the
Simulation tasks of the Flow Navigator pane.
ZYNQ 1-20
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
The Vivado simulator will be launched using the implemented design and lab1_tb as the top-level
module.
Using the Windows Explorer, verify that timing directory is created under the lab1.sim > sim_1 >
impl directory. The timing directory contains generated files to run the timing simulation.
5-1-2. Click on the Zoom Fit button to see the waveform window from 0 to 200 ns.
5-1-3. Right-click at 50 ns (where the switch input is set to 0000000b) and select Markers > Add
Marker.
5-1-4. Similarly, right-click and add a marker at around 58.000 ns where the leds changes.
5-1-5. You can also add a marker by clicking on the Add Marker button (
button and left-click at around 60 ns where e_led changes.
Step 6
Connect the board and power it ON. Generate the bitstream, open a
hardware session, and program the FPGA.
6-1-1. Make sure that the Micro-USB cable is connected to the JTAG PROG connector next to the
power supply connector for the Zedboard. The Zybo JTAG PROG connector is located next to the
power supply switch).
6-1-2. The Zedboard requires a separate power source, connected via J20, located next to the POWER
switch. The Zybo is powered through USB power via the JTAG PROG.
Make sure that the board is set to use USB power for the Zybo (via the Power Select jumper JP7)
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
ZYNQ 1-21
Lab Workbook
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx
Lab Workbook
This process will have generated a lab1.bit file under impl_1 directory in the lab1.runs directory.
6-1-5. Select the Open Hardware Manager option and click OK.
The Hardware Manager window will open indicating unconnected status.
6-1-6. Click on the Open target link.
ZYNQ 1-23
Lab Workbook
Another way is to right click on the device and select Program Device
Conclusion
The Vivado software tool can be used to perform a complete HDL based design flow. The project was
created using the supplied source files (HDL model and user constraint file). A behavioral simulation
using the provided testbench was done to verify the model functionality. The model was then synthesized,
implemented, and a bitstream was generated. The timing simulation was run on the implemented design
using the same testbench. The functionality was verified in hardware using the generated bitstream.
ZYNQ 1-24
www.xilinx.com/support/university
[email protected]
copyright 2016 Xilinx