Skip to content

Digital Logic: Environment Setup and Engineering Practice

Objectives

  • Become familiar with the laboratory platform used in this course: the EDA tool and FPGA development board.
  • Understand the key requirements for installing and configuring Vivado.
  • Become familiar with the hardware components and basic architecture of the EGO1 development board.
  • Master the complete Vivado project development flow: creating a project, adding files, functional simulation, synthesis and implementation, bitstream generation, and on-board verification.
  • Understand the basic principles of FPGAs and how they differ from conventional CPUs.

1. Experimental Platform

This course uses a combination of an EDA tool and an FPGA development board for hardware experiments.

1.1 EDA Tool: Vivado 2018.3

  • Purpose: Vivado is the development environment designed by Xilinx for its FPGA products. It enables developers to synthesize (compile) hardware designs, perform timing analysis, inspect RTL schematics, simulate circuit responses to different stimuli, and configure target devices through a programmer.
  • Version: This course standardizes on Vivado 2018.3.

1.2 FPGA Development Board: EGO1

  • Main device: A Xilinx Artix-7 FPGA, part number xc7a35tcsg324-1.

  • Main on-board peripherals:

  • Power switch

  • Potentiometer
  • Five push buttons
  • Sixteen slide switches
  • Reset button
  • Eight seven-segment displays
  • Sixteen LEDs
  • Other interfaces: VGA, audio, USB-UART/JTAG (for connecting the board to a computer and programming it), and USB-PS/2

image-20260609090907086

2. Installing Vivado

2.1 Important Notes

Vivado requires substantial disk space and imposes strict requirements on paths. Observe the following points:

  • Disk space: Reserve at least 20 GB of free space on the target drive.
  • Path naming: The operating-system username, the folder containing the installation package, and the final Vivado installation path must not contain Chinese characters or spaces.
  • Download link: Refer to 'resources' on top of the website.
  • Installer and license: Download the installer archive Xilinx_Vivado_SDK_2018.3_1207_2324.tar.gz and the license archive Vivado2018.3_licence.zip, then extract both archives.
  • Edition: Select Vivado HL Design Edition in the installer.
  • Custom installation (to save space): On the component-selection screen, it is strongly recommended that you select only the components required for this course:
  • Expand 7 Series devices and select only Artix-7. Clear the selections for other devices such as Kintex-7 and Spartan-7.
  • Import the license: After installation, open Vivado License Manager, select Load License -> Copy License..., and import the downloaded .lic file.

2.2 Installation Procedure

  • Extract the installer package and double-click xsetup.exe:

image-20260609091925734

  • Skip the software update and click Continue:

image-20260609091940618

  • On this screen, select I Agree:

image-20260609092403302

  • Select the second option, Vivado HL Design Edition:

image-20260609092426605

  • To save disk space, select only the component required for this course, Artix-7:

image-20260609092247803

  • You may change the installation directory. Ensure that its path contains no Chinese characters, then click Next:

image-20260609092641053

  • After installation, open the license manager and click Load License -> Copy License:

image-20260609092744838

  • Locate the license file and click Open:

image-20260609093222134

  • Click View License Status to inspect the license status:

image-20260609093026495

  • Double-click the desktop shortcut to start Vivado.

3. Standard Vivado Project Development Flow

The complete flow for hardware verification with Vivado and an FPGA development board consists of the following six steps:

image-20260609093858464

Step 1: Create or Open a Vivado Project

  • Start Vivado. On the start screen, click Create Project; alternatively, select File -> Create Project in the upper-left corner.

image-20260609095107287

  • Set the project name and path. Neither the project name nor its file path may contain Chinese characters or spaces.

Create project subdirectory: This option is selected by default. It creates a subfolder with the project name under the specified path.

image-20260609100435393

  • Select RTL Project as the project type.

image-20260609095524239

  • The next screens add source and constraint files. Click Next to skip them for now; the files will be created separately later.

image-20260609100720362

  • Under Default Part, search for and select the device used on the EGO1 development board: xc7a35tcsg324-1.

image-20260609093744297

Step 2: Add or Create Source Files

  • Three types of files must be added to the project: design sources, simulation sources, and constraints.
  • They can be added while creating the project (this method is not used here) or after the project has been created by clicking Add Sources (or the + icon).

image-20260609094006099

  • Create a circuit design file (Design Source) named lab1_design.v. Enter lab1_design in File name.

image-20260609101002075

  • Keep the default options, then click Finish -> OK.

image-20260609101110016

  • The design file has now been created. The project view and the initial contents displayed after double-clicking the source file are shown below.

image-20260609101252344

  • Complete the source file and save it.
module lab1_design(
    input [7:0] sw,
    output [7:0] led
);
    assign led = sw;
endmodule
  • In the same way, create the simulation file (Simulation Source) lab1_sim.v. Complete the simulation code and save it.

image-20260609105542693

`timescale 1ns / 1ps

module lab1_sim( );

    reg [7:0] tb_sw = 8'h0000;
    wire [7:0] tb_led;

    lab1_design dut(
    .sw(tb_sw),
    .led(tb_led)
    );

    always #10 tb_sw=tb_sw + 1'b1;
endmodule
  • Create the constraint file (Constrain Source) lab1.xdc.

image-20260609105559166

image-20260609104215961

  • Enter the following pin constraints:
set_property IOSTANDARD LVCMOS33 [get_ports {led[7]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[6]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[5]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[4]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[0]}]

set_property PACKAGE_PIN F6 [get_ports {led[7]}]
set_property PACKAGE_PIN G4 [get_ports {led[6]}]
set_property PACKAGE_PIN G3 [get_ports {led[5]}]
set_property PACKAGE_PIN J4 [get_ports {led[4]}]
set_property PACKAGE_PIN H4 [get_ports {led[3]}]
set_property PACKAGE_PIN J3 [get_ports {led[2]}]
set_property PACKAGE_PIN J2 [get_ports {led[1]}]
set_property PACKAGE_PIN K2 [get_ports {led[0]}]

set_property IOSTANDARD LVCMOS33 [get_ports {sw[7]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[6]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[5]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[4]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw[0]}]

set_property PACKAGE_PIN P5 [get_ports {sw[7]}]
set_property PACKAGE_PIN P4 [get_ports {sw[6]}]
set_property PACKAGE_PIN P3 [get_ports {sw[5]}]
set_property PACKAGE_PIN P2 [get_ports {sw[4]}]
set_property PACKAGE_PIN R2 [get_ports {sw[3]}]
set_property PACKAGE_PIN M4 [get_ports {sw[2]}]
set_property PACKAGE_PIN N4 [get_ports {sw[1]}]
set_property PACKAGE_PIN R1 [get_ports {sw[0]}]
  • Pin constraints consist of IOSTANDARD settings and PIN assignments. Set the IOSTANDARD of every port to LVCMOS33. The corresponding pins (PIN) can be found in Ego1_UserManual_v2.2.pdf or printed next to the associated peripherals on the development board.

image-20260609111803927

Step 3: Run Functional Simulation

  • In the Flow Navigator on the left, click Run Simulation.

image-20260609104731608

  • Vivado generates a waveform that records the states of the circuit's input and output signals.

image-20260609104654969

  • Important: Inspect the waveform carefully to verify the circuit's function. If the logic is incorrect, modify the design file and rerun the simulation. Proceed to on-board implementation only after the functional simulation passes. You may also experiment with the following controls and learn what each one does.

image-20260609110039890

Step 4: Synthesize, Implement, and Generate the Bitstream

After confirming correct functionality, perform the following operations in order to convert the code into a hardware netlist:

  1. Click Run Synthesis.
  2. Click Run Implementation.
  3. Click Generate Bitstream to generate the final .bit file used to program the board.

Important: If any Error or Critical Warning occurs during these steps, inspect and correct the project settings, design code, or constraint file before generating the bitstream again.

image-20260609094049611

Step 5: Connect the Development Board

  • Connect the computer to the USB-UART/JTAG port on the EGO1 development board using a data cable.

image-20260609094112800

  • Turn on the EGO1 development board.

image-20260609094128225

  • In Vivado, click Open Hardware Manager, followed by Open Target -> Auto Connect.
  • If the connection succeeds, the target device xc7a35t_0 appears in the Hardware window.

image-20260609094203751

Step 6: Program the Device and Verify It on the Board

  • In Hardware Manager, click Program Device, select the newly generated .bit file, and click Program.

image-20260609094222704

  • When programming is complete, the "Done" LED on the EGO1 board lights up, indicating that the circuit has been successfully implemented on the FPGA.
  • Toggle the input switches and observe the outputs to verify that the hardware behaves as designed.

image-20260609110238611

4. FPGA Usage Safety Instruction and Reconfiguring the Device

4.1 FPGA Usage Safety Instructions

  • After receiving the development board kit, check the data cable and the board for any damage or defects. If any damage is found, report it to the instructor promptly for registration. Otherwise, if damage is discovered upon return, the current user will be held responsible for the components.
  • Before use, connect the data cable first, then turn on the power switch.
  • While the board is powered on, hold it by the edges (as shown in the figure) to avoid causing short circuits.
  • 78886608255
  • After the experiment, power off the board in the following sequence. Hot‑plugging while powered is strictly prohibited:
  • Disconnect the software connection: In the Tcl Console window at the bottom of Vivado, type the command disconnect_hw_server and press Enter to disconnect Vivado from the FPGA chip.
  • Disconnect the hardware connection: First turn off the power of the EGO1 development board, then unplug the USB data cable.

image-20260609110335791

  • After using the development board, place it into the anti‑static bag (if available). Put both the anti‑static bag and the data cable into the kit box, and close the zipper securely.

4.2 Changing the FPGA Device in a Project

If you selected the wrong device when creating the project, use the following steps to change it:

  • Under PROJECT MANAGER in the Flow Navigator, click Settings.

  • Select General, then click the ... button next to Project device to open the device selector.

image-20260609110542003

  • Search for and select xc7a35tcsg324-1, then click OK.

  • Click Apply at the bottom of the Settings window to apply the configuration.

image-20260609110554163

  • Close the Vivado project. In the project directory, delete the entire xxx.runs directory. This removes temporary files containing information about the previous device so that the change takes effect. Then restart Vivado.

image-20260609110811089

5. Laboratory Exercise

  1. Follow the development flow in this tutorial to implement and verify a simple switch-controlled LED circuit on the EGO1 development board.

  2. Input: Eight slide switches (sw[7:0])

  3. Output: Eight LEDs (led[7:0])
  4. Function: The position of each switch directly controls whether the corresponding LED is on or off.
  5. Check-off requirement: Reproduce the simulation waveform and demonstrate the circuit on the board.

  6. To support later exercises, you may download and install Vivado 2018.3 on your personal computer (optional).

Vivado supports only Windows and Linux. Download the Linux installer from the AMD website.

Running Vivado on macOS requires a virtual machine.