Skip to content

vvvictor/basics-graphics-music

 
 

Repository files navigation

basics-graphics-music: A collection of portable Verilog examples for FPGA and ASIC design

YURI: This text has to be edited

These are examples to demonstrate labs sessions for systemverilog-homework which are portable SystemVerilog examples for FPGA and ASIC.

FPGA Field Programmable Gate Array is a type of integrated circuit that can be programmed multiple times. It consists of an array of programmable logic blocks and interconnects that can be configured to perform various digital functions. FPGAs are commonly used in applications where flexibility, speed, and parallel processing capabilities are required, such as in telecommunications, automotive and aerospace.

ASIC, Application Specific Integrated Circuit, this is an integrated circuit chip designed for specific use for instance, telecommunications, automotive etc.

These examples facilitate learning for beginners by:-

  1. Removing EDA and FPGA vendor complexity and restrictions.
  2. Compensating the gap between academia and industry in solving microarchitectural problems necessary for a career in ASIC design, building CPU, GPU and networking chips.
  3. Reducing the barrier of entry for them or a person who is transitioning to FPGA/ASIC design.

Getting Started

You only need a few things to get started:

  1. Get a compatible FPGA board.
  2. Install drivers and required software.
  3. Download or checkout this repository on Windows, Linux, or macOS.
  4. Run 06_choose_another_fpga_board.bash to select your board.
  5. Run 03_synthesize_for_fpga.bash to synthesize, place, and program your board all in one go.

That's it! You're now running Verilog example code on real hardware. Press buttons on the board and check for LEDs to light up accordingly.

First time setup

  1. Follow the instructions for Windows, Linux, or macOS to set up your environment.
  2. Optional: Configure VSCode:
    1. Install these extensions: 🔧 TODO: Verilog extensions configuration
    2. Recommended extensions: GitHub Pull Requests and GitHub Repositories
  3. Checkout this GitHub repository. Check out Git Cheat Sheet if you need additional help

    Optionally, switch to a new_graphics branch to get access to the bleeding edge features.

  4. Select the right board:
    cd ./labs/1_basics/1_01_and_or_not_xor_de_morgan/
    ./06_choose_another_fpga_board.bash
    Type number corresponding to your board and press Enter.
  5. Synthesize, place and program the board using a Git Bash:
    cd ./labs/1_basics/1_01_and_or_not_xor_de_morgan/
    ./03_synthesize_for_fpga.bash
    If all goes well, you should see the LEDs on your board light up according to the example.

As long as you do not change your hardware, you only need to run 03_synthesize_for_fpga.bash script after the first time setup.

Windows

Examples are not fully compatible with a WSL. You're welcome to try at your own risk and peril. See documentation.

  • Required: Download and install Git for Windows.
    • ⚠️ We recommend on the "Adjusting your PATH environment" step to select "Use Git and optional Unix tools from the Windows Command Prompt".
  • Required: Bash: Compatibility is only verified with Bash installed as part of the Git for Windows package.
  • Recommended: Download and install VScode

⚠️ Examples and scripts can only be run with a Git Bash terminal. There are mutliple different options to open it. Choose one that works best for you:

  • Open Git Bash from the Start menu or from a right-click context menu in any folder (if you enabled it during installation).
  • Alternatively, you can use VSCode:
    • Optionally: Set it as a default in Settings > Features > Terminal > Integrated > Default Profile > Windows > Git Bash.
    • Open a new Git Bash as a one-off by clikcing on the dropdown arrow next to the plus icon in the terminal panel and selecting Git Bash.

You can tell that it's a Git Bash terminal if you see a prompt that looks like this:

user@hostname MINGW64 /c/Users/user/Documents/basics-graphics-music/ (master)
$

Linux

You may need to install git if not alredy installed:

sudo apt-get install git

You can use any terminal including built-in.

macOS

No special stesps are required. You can use any terminal including built-in.

  • Optional: If you hit issues with bash, you may have a version older than is currently supported. If so, you can use Homebrew's bash instead:
    brew install bash

Compatible Hardware

To support educators worldwide, we support a wide variety of hardware across all manufacturers and price ranges, with several dozen different variants in total. See ./boards for more information.

If you do not know where to start:

Supported Boards

🔧 Work in progress. Please, double-check information for your board online. Your contributions are welcome.

FPGA Chip Board Variants Software
Altera Cyclone II Terasic DE1 de1 Intel Quartus Prime Lite
Altera Cyclone II Terasic DE2 de2 Intel Quartus Prime Lite
Altera Cyclone III Terasic DE0 de0 Intel Quartus Prime Lite
Altera Cyclone III Altera DK-DEV-3C120N dk_dev_3c120n Intel Quartus Prime Lite
Altera Cyclone IV Alinx AX4010 alinx_ax4010 Intel Quartus Prime Lite
Altera Cyclone IV Terasic DE0-Nano de0_nano_vga_pmod
de0_nano_vga666
Intel Quartus Prime Lite
Altera Cyclone IV Zeowaa zeowaa
zeowaa_wo_dig_0
Altera Cyclone IV Terasic DE2-115 de2_115 Intel Quartus Prime Lite
Altera Cyclone V Terasic DE0-CV de0_cv Intel Quartus Prime Lite
Altera Cyclone V Terasic DE10-Nano de10_nano Intel Quartus Prime Lite
Altera Cyclone V SoC Terasic DE0-Nano SoC de0_nano_soc_vga_pmod
de0_nano_soc_vga666
Intel Quartus Prime Lite
Altera Cyclone V SoC Terasic DE1-SoC de1_soc Intel Quartus Prime Lite
Altera Cyclone V GX Terasic C5GX c5gx Intel Quartus Prime Lite
Altera MAX 10 Terasic DE10-Lite de10_lite Intel Quartus Prime Lite
Emooc CC emooc_cc
Gowin GW5AST-LV138 SiPeed Tang Mega 138K tang_mega_138k_lcd_480_272_tm1638
tang_mega_138k_pro_lcd_480_272_no_tm1638
tang_mega_138k_pro_lcd_480_272_tm1638
Gowin EDA
Gowin GW1NR-9 SiPeed Tang Nano 9K tang_nano_9k_lcd_480_272_no_tm1638_yosys
tang_nano_9k_lcd_480_272_tm1638
tang_nano_9k_lcd_480_272_tm1638_yosys
tang_nano_9k_lcd_800_480_no_tm1638
tang_nano_9k_lcd_800_480_no_tm1638_yosys
tang_nano_9k_lcd_800_480_tm1638
tang_nano_9k_lcd_800_480_tm1638_yosys
tang_nano_9k_lcd_ml6485_no_tm1638_yosys
tang_nano_9k_lcd_ml6485_tm1638_yosys
Gowin EDA
Yosys
Gowin GW2A-LV18 SiPeed Tang Primer 20K tang_primer_20k_dock_hdmi_no_tm1638
tang_primer_20k_dock_hdmi_tm1638
tang_primer_20k_dock_no_hdmi_no_tm1638
tang_primer_20k_dock_no_hdmi_tm1638
tang_primer_20k_lite
Gowin EDA
Gowin GW5A-LV25 SiPeed Tang Primer 25K tang_primer_25k Gowin EDA
Gowin GW12AR-18 Sipeed Tang Nano 20K tang_nano_20k_hdmi_tm1638
tang_nano_20k_lcd_800_480_tm1638
Gowin EDA
Lattice ECP5 OrangeCrab orangecrab_ecp5_yosys Yosys
Lattice ECP5 Karnix karnix_ecp5_yosys Yosys
Lattice iCE40 Lattice iCE40-HX8K ice40hx8k_evb_yosys Yosys
Altera Cyclone IV Omdazz omdazz
omdazz_pmod_mic3
Intel Quartus Prime Lite
Altera Cyclone IV Rzrd rzrd
rzrd_pmod_mic3
Intel Quartus Prime Lite
Xilinx Artix-7 Arty A7 arty_a7
arty_a7_pmod_mic3
Vivado
Xilinx Artix-7 Basys 3 basys3 Vivado
Xilinx Artix-7 Nexys 4 nexys4 Vivado
Xilinx Artix-7 Nexys 4 DDR nexys4_ddr Vivado
Xilinx Artix-7 Nexys A7 nexys_a7 Vivado
Altera Cyclone IV Pisword S6 piswords6 Intel Quartus Prime Lite
Altera Cyclone IV Saylinx saylinx
saylinx_pmod_mic3
Intel Quartus Prime Lite
Xilinx Kintex 7 QMTech Kintex 7 qmtech_kintex_7 Vivado
Xilinx Zynq-7000 Zybo Z7 zybo_z7 Vivado

External hardware

Not all boards include everything on the same board. To compensate for this we use external boards and hardware to extend input and output capabilities. The most common external hardware is:

  • All variants: INMP441 I2S microphone
  • Almost all variants: PCM5102 I2S stereo audio DAC. Some boards do not require an external DAC as they have an on-board DAC (Tang Nano 20K)
  • tm1638 or no_tm1638: with and without TM1638: 8-digit 7-segment display with 8 buttons (enabled in tm1638 variants)
  • hdmi: HDMI on-board output
  • lcd_480_272: 40-pin 480x272 LCD display
  • lcd_800_480: 40-pin 800x480 LCD display
  • yosys: The same hardware, but uses Yosys open source toolchain instead of a proprietary one.

Verilog Events Across the World

This repository was used during the following events:

Hacker Dojo in Mountain View, California in 2024

Hacker Dojo in Mountain View, California in 2024

ADA University in Baku, Azerbaijan in 2024

ADA University in Baku, Azerbaijan in 2024

LaLambda 2023 in Tbilisi, Georgia

LaLambda 2023 in Tbilisi, Georgia

AUCA & Siemens EDA seminar in Bishkek, Kyrgyzstan in 2022

AUCA & Siemens EDA seminar in Bishkek, Kyrgyzstan in 2022

Школа синтеза цифровых схем / The School of Synthesis of the Digital Circuits, 2020

Школа синтеза цифровых схем / The School of Synthesis of the Digital Circuits, 2020

About

FPGA exercise for beginners

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Verilog 44.8%
  • SystemVerilog 29.6%
  • Coq 9.7%
  • Tcl 7.9%
  • Shell 5.9%
  • HTML 1.4%
  • Other 0.7%