Quartus Tutorial

Overview

Quartus is a programmable logic device design software, similar to Vivado. While Vivado is used for Xilinx/AMD boards, Quartus is used for development on Altera/Intel boards. As such, Quartus will be a necessary tool for anyone using boards by Altera.

Installation

Download Quartus Prime Lite here

Follow their “Download and Install instructions”

To start Quartus, run the quartus file inside of its “bin” folder. Here’s what that command might look like if Quartus were installed in the home directory ~/altera_lite/25.1std/quartus/bin/quartus

Creating a Simple First Project

This tutorial will walk you through creating a project in Quartus. I would recommend following this once, and then creating a second project on your own.

Creating the Project

After launching Quartus follow these steps to create the project:

  1. Under the Start menu, select New Project Wizard….
  2. Click past the introduction, then give your project a working directory and a name..
    • I’d recommend creating a folder to act as your working directory so that generated files don’t clutter your home directory.
  3. Leave the project as an “Empty Project”.
  4. We won’t need to add any files just yet.
  5. On this page you will be asked to select your device/board. Click Boards at the top and selet the name matching your board(ie. DE1-SoC Board). Click Finish to create your project.

Next Create a simple program:

  • Use the Page icon in the top left to create a new file.
  • Under the Design Files drop down select SystemVerilog HDL File.
  • Write a simple program such as making the switches turn on the LEDs.
    • System Verilog is the same in Quartus as anywhere else, a simple module with input, output, and assigned logic will do.
  • Compile the design(Blue Play Button)

The .qsf file

Similar to the .xdc file in Vivado, Quartus uses a .qsf file to associate the pins on the chip with your named inputs and outputs. This file is automatically generated when you first compile the program but needs to be added manually in order for you to make changes.

  1. In the Project tab in the top left, select Add/Remove Files in Project…
  2. Use the three dots to browse for a file to add, and then change Files of Type at the bottom to display text files.
  3. Select the file that matches your project name and ends in .qsf
  4. Use OK or Apply to add the file to your project.
  5. Find a master .qsf for your board online, it should look similar to this one for the DE1-SoC board.
  6. For each pin you are using add the instance assignment and location assignment lines to the end of your .qsf(In Vivado these are on the same line, Quartus wants both lines seperate)
    • Make sure the names in the .qsf match the input and output names in your module.
  7. Once the .qsf and .sv files are saved, recompile the project.

Before programming the board for the first time

If this is your first time programming an Altera board there are a couple things we need to do first so that your Quartus will recognize the board.

  1. Make sure the board is plugged in, turned on, and connected to your machine with the USB-B port on the board.
  2. Run lsusb and make sure that output includes an Altera device, the ID should start with “09fb”.
    • If the Altera device is not listed double check step 1.
  3. In the terminal run this command sudo nano /etc/udev/rules.d/51-altera-usb-blaster.rules
  4. Copy and paste the following two lines

    SUBSYSTEM==”usb”, ATTR{idVendor}==”09fb”, MODE=”0666”

    SUBSYSTEM==”usb_device”, ATTR{idVendor}==”09fb”, MODE=”0666”

  5. Save the file and exit.
  6. Run these two commands in order
    • sudo udevadm control –reload-rules
    • sudo udevadm trigger
  7. Unplug and reconnect the USB-B cable

Programming the board

Once your program is compiled and ready to go it is time to program it onto the FPGA board

  1. Make sure the board is plugged in, turned on, and connected to your machine with the USB-B port on the board.
  2. If the hardware setup bar says “No Hardware” select Hardware Setup and select your board
    • If there is no board available to select double check step 1.
    • If that does not fix the issue return to the previous section and make sure the ID from lsusb matches the value entered in 51-altera-usb-blaster.rules
  3. If there is only one device listed select the Auto Detect button on the right column, and when prompted select the device matching your board(ie. 5CSEMA5 for the DE1-SoC board)
    • This will add a second device for your boards SoC, which we will ignore.
  4. Double click <none> in the File column and navegate to the output_files folder
  5. Select the .sof file and hit Open
  6. Select Start to program the FPGA
  7. If successful the progress bar in the top right will turn green and display 100% (Successful)