VLSI Digital Signal Processing (ELEG5758) Training 1 Manual
VLSI Digital Signal Processing (ELEG5758) Training 1 Manual
VLSI Digital Signal Processing (ELEG5758) Training 1 Manual
TRAINING 1 MANUAL
Contents
1
LEARNING OUTCOMES AND OBJECTIVES:
At the end of this training, students are expected to:
• Know the FPGA development boards and tools.
• Get familiar with Xilinx’s Vivado tool and FPGA systems development.
Create and implement a project in Vivado.
Simulate projects using a test bench.
Familiarise with the Vivado's block design feature.
Familiarise with the FPGA development flow including the synthesis,
implementation (placement and routing), and bitstream generation.
• Learn how to implement and simulate the basic arithmetic primitives in Vivado.
Half and full adder
Fixed-point n-bit carry propagation adder.
Fixed-point n-bit subtractor
• Learn how to implement and simulate higher arithmetic primitives in Vivado.
Fixed-point n-bit multiplier
Fixed-point n-bit divider
Arithmetic and Logical Unit (ALU)
• Learn hardware implementation using block design features and available IPs
Create block design, add, and connect the blocks (modules)
Implement, generate the bitstream, and test the hardware.
2
PART 1: FPGA DEVELOPMENT TOOLS AND BOARDS
1.0 Overview:
Field Programmable Gate Arrays (FPGAs) are semiconductor devices (ICs) that are based
around a matrix of configurable logic blocks (CLBs) connected via programmable
interconnects. FPGAs can be reprogrammed to desired application or functionality
requirements after manufacturing.
Figure 1.1 describes the architecture of FPGA consisting of the following:
- Configuration Logic Block: Used to implement the user’s logic and consists of LUT,
multiplexers, and flip-flops.
- Programmable interconnects – connects different CLBs.
- IO Blocks – Gives the input and output interfaces to the user or external devices.
- DSP blocks
- Block RAM
1.1 The FPGA Board for this Training and Other Development Boards:
In this training, we are going to use Digilent’s Zedboard as shown in Figure 1.2. The board
featured several components such as LEDs, switches, USB UART, USB JTAG, HDMI, VGA,
Gigabit Ethernet port, power, Pmods, OLED, FMC, and soon. The board also contains a Zynq
7000 FPGA and DDR3 memory.
The other FPGA development boards used in various fields include the boards from AMD
Xilinx for example, PYNQ Z1, PYNQ Z2, Virtex 7, Spartan 6, VCU108, Kria (KV260/KR260)
3
boards, Zybo boards, ZCU102, ZCU104, Alveo, and versal boards. Figure 1.3 shows the
overview of the FPGA boards produced by the AMD. Other vendors such as Intel also produce
their FPGA boards for example Cyclone V, Arria 10, Stratix, and Agilex V boards.
In this lab, students will be shown some samples of FPGA boards.
4
1.2.1 Vivado Hardware Development Environment
Vivado is the AMD i.e., Xilinx’s FPGA development tool. It is the design software for AMD
adaptive SoCs and FPGAs. It includes Design Entry, Synthesis, Place and Route, and
Verification /Simulation tools. The advanced features in Vivado design software help hardware
designers reduce compile times and design iterations, while more accurately estimating power
for AMD adaptive SoCs and FPGAs. Figure 2.1 shows the FPGA system development
process (flow). Hence, Vivado facilitates the process by providing the necessary
design, simulation/verification, and implementation tools for the hardware developments.
Tasks:
Working with the help of the lab supervisor, answer the following questions.
1. Mention any three FPGA manufacturers and vendors you may know.
2. State the FPGA development tool and some of the FPGA boards for each manufacturer.
3. Which FPGA boards are more suitable for DSP and machine learning hardware?
4. Outline the functions of the features in Zedboard, which FPGA is featured in the board.
5. Identify similar features from the other boards provided to you in the lab.
6. Briefly describe the architecture of Zynq Ultrascale. Name any two Zynq Ultrascale
FPGA boards.
7. What is the major difference between Zedboard, Virtex7 evaluation kit, Zybo board,
PYNQ-z2, Kria KV260, and ZCU104 FPGA boards.
8. Briefly describe the architecture of Zynq 7000 SoC FPGA.
5
PART 2: FPGA DEVELOPMENT USING VIVADO/VITIS
2.1 Overview
Figure 2.1 outlines the stages of FPGA hardware development (FPGA development flow). In
this lab part, we are going to get familiar with the Vivado environment and get acquainted with
the FPGA development using the Vivado tool. We will learn how to use Vivado to create and
implement an FPGA (hardware) system. We will first create and simulate a half-adder. We will
later implement and realize hardware on the board using the switches and the user LEDs on the
board.
6
2.2.1 Vitis Download
• Goto https://www.xilinx.com/support/download.html
• Select Vitis (SW developer) and 2022.2 (the version we will use in this training)
Scroll down and study the various available download options (Web and SFD). For each
installer, AMD might provide different types of packages. The web installer only downloads
essential components according to your installation requirements to speed up the download
process. On the other hand, The Single File Download (SFD) provides a self-contained package
for AMD components.
7
• If you have enough space, download the Xilinx Unified Installer 2022.2 SFD (TAR/GZIP
- 89.4 GB), else download the Xilinx Unified Web Installer depending on your OS.
3. Click Next to open the Select Install Type page of the Installer.
4. If using web installer, enter your AMD user account credentials, and select Next.
8
5. Select Download and Install Now only if using web installer.
6. Click Next to open the Accept License Agreements page of the Installer.
7. Accept the terms and conditions by clicking each I Agree check box.
8. Click Next to open the Select Product to Install page of the Installer.
9. Select Vitis and click Next to open the Vitis Unified Software Platform page of the
Installer.
10. Customize your installation by selecting design tools and devices (optional).
The default Design Tools selections are for standard Vitis Unified Software Platform
installations and include Vitis, Vivado, and Vitis HLS. You do not need to separately
install Vivado tools. You can also install Model Composer and System Generator if
needed.You can enable Vitis IP Cache to install cache files for example designs found
in the release. This is not required, but when selected, the files are installed at
<installdir>/Vitis/<release>/data/cache/xilinx. The default Devices selections are for
devices used on standard acceleration platforms supported by the Vitis tools. You can
disable some devices that might not be of interest in your installation.
11. Click Next to open the Accept License Agreements page of the Installer and accept as
appropriate.
12. Click Next to open the Select Destination Directory page of the Installer.
13. Specify the installation directory, review the location summary, review the disk space
required to ensure there is enough space, and click Next to open the Installation
Summary page of the Installer.
9
14. Click Install to begin the installation of the software.
After a successful installation of the full Vitis unified software, a confirmation message
is displayed with a prompt to run the installLibs.sh script (sudo installLibs.sh). The
command installs necessary packages for the Vitis tools based on the OS of your
system. Note that this script is not required on Windows. Hence locate the script
at:<install_dir>/Vitis/<release>/scripts/installLibs.sh
Where <install_dir> is the location of your installation, and <release> is the installation
version.
15. To launch the Vitis software platform from Windows, do one of the following:
a. Launch from a desktop button or Start menu command.
b. From a Windows command shell, use settings64.bat: C:<VITIS_ INSTALL
_DIR>\VITIS\2022.2\settings64.bat, and launch: vitis
10
2.3 Creating a New Project
• Create a folder “Vivado_projects” on the Desktop of your computer.
• Open Vivado by clicking its icon on the desktop.
• Click Create Project
• Click Next.
• Choose a location for your project and specify the project name as “Proj1_halfAdder”.
• check the “Create project subdirectory” check box.
• Click Next.
11
• Click Next to create an empty project with no source code or constraint file.
• Click Boards
• Search “Zedboard”. If the board is not found, you may need to click the Refresh button
to update the board repository. Alternatively, you may add the board files directly.
• Check the board Status. If it shows an arrow, the board files are not installed, you
should click the arrow to install the board files. The Status now changes to a minus
sign (-).
12
• Select the board and click Next, the project summary is then displayed.
Checkpoint:
Observe each of the following items in the Vivado project development environment and find
their functions.
1) Menu bar items 2) Project Manager 3) Sources Window
4) Project Summary 6) Settings 7) IP Catalogue
8) IP Integrator 9) Simulation 10) RTL Analysis
11) Synthesis 12) Implementation 12) Program and Debug
13
14
2.4 Creating/Adding a New Source File
• Click the “+” icon in the source window to add a new source.
• Click “Create File” to create a new source file. If you already have the source file(s)
that you want to add to the project, you should click the “Add Files” to add the file(s)
15
• Select “Verilog” as the File type and write “half_adder” as the File name.
• Leave “File location” as default (Local to Project). Click OK
16
• Click Finish
2.5 Opening and Writing the Hardware Description (HDL) Source File
• In the Vivado environment, open the source Verilog file (half_adder.v). The file now
opens in the Window beside.
17
2.6 Simulation of the Half-Adder Program
To simulate the hardware described in the source program (RTL), we need to write a test bench
file and describe the simulation procedure. The simulation is achieved using the XSim
simulator in Vivado.
• Same as you have done for the source file, click “Create File”.
18
• A module definition window opens, click OK.
• Click “Yes” on the pop-up menu that will appear. The testbench file will be added to the
project.
19
• Click Save tab.
• Click the “Run Behavioral Simulation” tab from the SIMULATION section in the Flow
Navigation. The Simulation Window opens and run for the first few nano seconds.
• To simulate for a specified time, enter the duration e.g., 10us, and click the right triangle.
Click the middle triangle to run the simulation to the completion. Click the left triangle
to refresh the simulation.
20
Check point:
Re-run the simulation and validate the result as shown in the message Window. Run Synthesis
and open the synthesized circuit, verify if the generated circuit looks like a half adder circuit.
21
PART 3.0: A 4-BIT CARRY PROPAGATION ADDER (CPA)
IMPLEMENTATION
In this part, we are going to implement a full adder circuit and then extend it to a 4-bit carry
propagation adder.
3.1 Overview
An n-bit carry propagation adder consists of n full adders with the carry-out of a full adder
serving as the carry-in of its proceeding full adder. The carry out of the last full adder is the
carry of the n-bit carry propagation adder. Figure 3.1 and Figure 3.2 shows a full adder and a
4-bit carry propagation adder respectively.
22
3.2 The 4-bit Carry Propagation Adder Implementation
We are going to extend the created full adder to a 4-bit carry propagation adder. We will also
simulate the adder in the XSim simulator.
23
• Double-click the created block design.
• Produce 4 duplicates of the full adder block in the block design by copying and paste.
• Right-click each pin of the block (except the CARRY pin) and select the “Make
External”.
24
• Connect the CARRY of each adder to the C_in of the next adder.
(i.e., Carry_adder0 C_in_adder1, Carry_adder1 C_in_adder2 and so on)
25
• Click the circular arrow (No. 1) menu item to regenerate the layout.
• Click the tick box (No. 2) menu item to validate the design.
• Write-click the block design and click the “Create HDL Wrapper”.
• Write-click the generated wrapper file and select the “Set as Top”.
26
• Double-click the four_bit_CPA wrapper source, read and understand the code.
27
3.1.3 Implementation, Bitstream Generation and Testing
• Before running the implementation, we need to provide the constraint file.
• From the Source window, click the “+” to add and create a constraint file.
• Open the created constraint file.
• Copy and paste the provided constraint.
28
• From the Flow Navigator window, click “Run Synthesis” under SYNTHESIS
• Open the synthesized design and observe how the LUTs are used.
• Open and check the utilization also.
29
• From the Flow Navigator window, click “Run Implementation” under
IMPLEMENTATION
• Click “Generate Bitstream” under PROGRAM AND DEBUG to generate the
bitstream file.
• The bitstream file is located in “<project folder> \Full_Adder.runs\impl_1”
• Open Target and program the device.
• Use the switches as shown in the constraint file to set the numbers, the LED displays
the addition results.
30
PART 4.0: ARITHMETIC AND LOGICAL UNIT (ALU)
In this section, we are going to create an ALU (Arithmetic and Logical Unit) on the Zedboard’s
FPGA. The ALU should be able to add, subtract, multiply, and divide as shown in the figure
below.
• Add the Adder IP by clicking the “+” in the block design window.
• Search and double-click the Adder/Subtracter IP to add to the block design.
• Double-click the added IP to configure it.
• Set the parameters in the Basic tab, as shown in the below figure.
• Make sure you select “Add” under the “Add Mode” and set the bit-width correctly (3).
31
• Go to the Control tab, unselect the “Clock Enable (CE)
• Select the Carry Out (C_OUT), click OK.
• Select the c_addsub_0 IP (the added IP) in the block design and rename it to “Adder”
from the “Property Window”.
32
• For adding a subtractor, copy and paste the adder IP.
• Double-click the pasted IP to configure it.
• Set the parameters in the Basic tab, as shown in the below figure.
• Make sure you select Subtract under the “Add Mode” and set the bit-width correctly.
• Click OK
• Search and add the Multiplier IP by clicking the “+” in the block design.
• Set the parameters in the Basic tab, as shown in the below figure.
• Check “Output and Control”, leave it as it is. Click OK
• Click OK
33
• Search and add the Divider Generator by clicking the “+” in the block design.
• Set the parameters in the Basic tab, as shown in the below figure.
• Check “Output and Control”, leave it as it is. Click OK
• Click OK
34
4.2 Connect the Various Modules/Components:
• Drag and drop the ALU module (created earlier) from the source to the block design.
• Connect the adder, subtracter, multiplier, and the divider to the dragged ALU module
as shown in the below figure.
[Note: the reset is not active low as indicated in the ALU_Controller IP].
35
• Right-click the rest of pins and click “Make external” to create the ports.\
4.3 Simulation:
• Create a test bench (ALU_tb.v).
• Copy and paste the provided test bench file to the ALU_tb.v created.
• Run the simulation and check the output.
36
4.3 Implementation, Bitstream Generation and Testing:
• From Flow Navigator, click Generate Bitstream. The tool is going to go through the
Synthesis, implementation, and the generate bitstream stages automatically.
37
• You can open the implemented design to check the utilization report and the device
placement.
• Before programming the FPGA, make sure the boot setting jumpers are set to zero
positions.
38
• Click “Open Hardware Manager”, then “Open Target” and Auto Connect.
39
4.4 Hardware Implementation Results:
1. 7+4 = 11; in binary is 100+111 = 1011
40
3. 7x4 = 28; in binary is 111*100 = 11100
41