FPGA

FPGA = Field Programmable Gate Array

As an electrical engineer, you should try to learn "How to build a digital circuit on FPGA". FPGA are compact chip, that have millions of gates on it. You can build any custom digital logic with FPGA. FPGA are an essential device for any Electrical Engineer to have fun with.

If you are a VLSI designer, you probably know how to write RTL in Verilog. In an FPGA too, we write RTL, and then the tools that come with FPGA, build a custom digital circuit based off that RTL. This allows us to quickly test our digital circuit, as well as build prototypes, without going thru expensive time consuming process of having a fab fabricate your digital design. FPGA also allow you to learn how to code in Verilog, and test your logic without writing any testbenches. Nowadays, FPGA have millions of gates on them, which you can use to make a full blown microprocessor on an FPGA.

One good video series on FPGA by DigiKey (total 12 videos): https://www.youtube.com/playlist?list=PLEBQazB0HUyT1WmMONxRZn9NmQ_9CIKhb

Early FPGA started in 1983 with Altera and then with Xilinx in 1985. Later Actel and Lattice Semiconductor joined the FPGA race. Xilinx was later bought by AMD, Altera was bought by Intel while Actel was bought by Microsemi, which was itself bought by MicroChip Tech. By 2015, Xilinx (50%), Altera (35%) and Actel (10%) and Lattice (3%) captured almost all of the FPGA market. As of 2020, 100's of millions of gates are being put on a single FPGA chip in 5nm nodes, with FPGA revenue exceeding $8B. FPGA are being increasingly used in low end embedded devices, and expected to grow at a CAGR of 10%.

Main FPGA product lines of these 3 companies are:

  1. Xilinx: They provide low cost Spartan family (made in higher nm tech as 28nm), as well as high perf Virtex family (made in lower nm tech as 16nm as of 2020). They have multiple generations, with Xilinx 7 series introduced in 2010, which is the most popular one.
    1. Spartan: Spartan family is the oldest and lowest cost FPGA. Spartan 7 intoduced in 2017 lacks high BW transceivers.
    2. Artix: Artix family is similar to Spartan, as it's low cost. However, Artix-7 have high BW transceivers, and that's what we'll be using for our training.
    3. Kinetx: Kinetix family delivers mid range performance at much lower cost than Virtex.
    4. Virtex: Virtex family is most advanced and highest performance. Several gen from Virtex-E to Virtex UltraScale+. It has lot of prebuilt logic for commonly used functions as multiplication, etc to improve performance.
    5. Zynq: Zynq 7000 were developed as SoC (System on chip). Zynq-7000 integrate a complete ARM Cortex A9 MPCore-processor-based 28 nm system. It made FPGA processor centric, which could boot at start up, and load OS.
  2. Altera:
    1. Startix: Startix series were Alter'a highest BW devices with up to 1 Million logic elements.
  3. Altec: Actel's portfolio of FPGAs is based on two types of technologies:
    1. Antifuse-based FPGAs: Axcelerator, SX-A, eX, and MX families
    2. Flash-based FPGAs:  Fusion, PolarFire, IGLOO, and ProASIC3 families

 


 

Training on Digilent BASYS3 Board with Artix 7 FPGA using Xilinx Vivado Tools:

"Digilent BASYS3 Board" is the recommended Board for Introductory users wanting to learn FPGA basics. It has Xilinx "Artix 7 FPGA" chip on it. I have this Board, and all my tutorials are based off it.

Buying the Board. ouple of options:

Steps on Linux OS (Ubuntu Cinnamon 22.04.2 LTS) for Installing Vivado 2023.1:

  1. Once you have the Board, download and install Vivldo from Xilinx website. You will need to make an AMD a/c (as Xilinx is now part of AMD). Provide your personal details accurately for Export Control Requirements. Once you do that, you can download any of the 3 "Vivalo ML edition" provided. The self extracting option for Window/Linux are more suitable, since they don't require huge files to be downloaded in 1 go. The 3rd option of downloading tar.gz file has 110G of file to be downloaded, which errors out almost all the time after downloading part of the file. Details here => https://digilent.com/reference/programmable-logic/guides/installing-vivado-and-vitis. Steps are:
    1. Download AMD Linux bin file => https://www.xilinx.com/support/download.html. Since we are doing it on Linux, we'll choose 3rd from top which is "Linux Self Extracting Web installer" => Xilinx_Unified_2023.1_0507_1903_Lin64.bin (~265 MB)
    2. Open a Linux Terminal and Go to Dir where Installer was downloaded. Most likely in /home/<user/Downloads dir. Run these 3 cmds:
      1. sudo apt install libtinfo5 libncurses5 => We need to install these 2, else we get stuck at "Generating installed device list" later during installation. Thread: https://support.xilinx.com/s/article/63794?language=en_US
      2. chmod +x Xilinx_Unified_2023.1_0507_1903_Lin64.bin;
      3. sudo ./Xilinx_Unified_2023.1_0507_1903_Lin64.bin
    3. A new gui will appear which will guide thru installation process. Enter amd login/password. Choose "Vivado" as "Product to install" and NOT "Vitis", as "Vitis" is too large. Choose "Vivado 2023.1 ML free Edition". This takes up abot 40GB of space. It will go thru 3 step process of downloading a 20GB file, installing and then "Final processing for device". Downloading a 20GB filw will easily take an hour, installing is couple of minutes, and Final processsing is also a few minutes. It will get stuck on final processing if we haven't done step 2.1 above. If it does get stuck, cancel,then run this on any terminal (sudo apt install libtinfo5 libncurses5), and then reexecute the binary (step 2.3). Once installation is done, the software will be installed in /tools/Xilinx/Vivado dir.
  2. Once Vivado software is installed, install cable drivers (need only for Linux0 as it doesn't come with the drivers. Run below cmds on terminal
    1. cd /tools/Xilinx/Vivado/2023.1/data/xicom/cable_drivers/lin64/install_script/install_drivers
    2. ./install_drivers => This should show "INFO: Driver installation successful." at the end, along with a warning. Ignore the warning.
  3. Install Digilent's Board files.
    1. Download from github: https://github.com/Digilent/vivado-boards/archive/master.zip
    2. Go to the dir where downloaded, and Extract it by right clicking on file (in Files window, NOt on terminal). It will extract files.
    3. On terminal. run cmd => cp -rf /home/kagrawal/Downloads/vivado-boards-master/new/board_files  /tools/Xilinx/Vivado/2023.1/data/boards/board_files => This copies all files.
    4. sudo chmod -R 777 /tools/Xilinx/ => For now set all permissions to all subdir and files for Vivado.That way, we avoid getting "Permission denied' errors later. Or you can login as root as shown below in step 4.1.
  4. Launch Vivado. Follow the instructions provided here: https://digilent.com/reference/programmable-logic/guides/getting-started-with-vivado
    1. Open a terminal, and login as root (may not be needed if all permissions are set up for all vivado dir) : sudo -i => logs in as root
    2. mkdir /home/<user>/Vivado_training
    3. cd /home/<user>/Vivado_training
    4. source /tools/Xilinx/Vivado/2023.1/settings64.sh (Or can also use dot space (i.e . ) instead of source to execute)
    5. vivado => (use sudo vivado if you aren't logged in as root). This will launch Vivado. If it shows error as "permission denied", then you need to login as root. Vivado gui will open up. Choose Tasks->Open Hardware manager. It will show "Hardware Manager" as not connected on the new pop up.
    6. Now connect your FPGA to your laptop via the USB cable provided. Flip SW16 on Digilent Board (switch near the mini usb cable). It should turn lights on, and will start counting from 0000 to 9999. "Hardware Manager" will show Digilent Board name. So, everything working at this point.
  5. Now we can try a new project. Follow instructions on link above to create a new project.