Altera Quartus Prime Lite

  • Expected users: EKT & FBF - Digital Systems
  • Responsible users: LCK1
  • Current Version: 16.0.1.211 (2016-07)
  • Licensing: BFH Students | BFH Staff (no license SRV needed → free lite-edition)
  • Supported architecture: amd64

Description

The Altera Quartus Prime Lite design tools version 16.0 supports the following device families: Arria II, Cyclone IV, Cyclone V, MAX II, MAX V, and MAX 10 FPGAs. This lite edition does not require the purchase of a license and fully supports the Cyclone IV FPGA used on the Gecko4-Education boards. The software package includes the Mentor Graphics ModelSIM 10.4d (Altera Starter Edition), a multi-language HDL simulation environment.

Download Source

The software can be downloaded for Windows and Linux from the Altera Download Center. The download may require the creation of a free Altera account.

Installation Step-by-Step guide

  1. Download QuartusLiteSetup-16.0.0.211-linux.run from the Altera Download Center.
  2. Install the external package dependencies:
    apt-get install libmotif4 libxp6
    apt-get install libstdc++5 libcurl3 libcanberra-gtk-module
    # for 64 arch, install also 32bits packets:
    dpkg --add-architecture i386
    apt-get install libstdc++5:i386 libmotif4:i386 libxp6:i386 libcurl3:i386
    apt-get install libncurses5:i386
  3. ModelSim requires the installation of further dependencies:
    apt-get install g++-multilib
    apt-get install lib32z1 libedit2:i386 libxft-dev libxml2:i386
    apt-get install libxtst6:i386 libzmq3:i386 unixodbc:i386
  4. Launch the setup script as root:
    cd Downloads
    sudo su
    ./QuartusLiteSetup-16.0.0.211-linux.run

    to install the Altera tools to /opt/altera_lite/16.0 using the GUI install wizard. Note, you may leave out device support for unnecessary FPGA architectures to save disk space.

  5. Altera Quartus II installs outdated library versions (e.g., libstdc++, liblzma). This breaks calling regularly installed external tools from the underlying Linux distribution. Therefore, replace installed old library versions with links to the Linux distribution's equivalents to ensure interoperability with other tools (e.g., the web browser):
    cd /opt/altera_lite/16.0/quartus/linux64
    mv libstdc++.so libstdc++.so_ori
    mv libstdc++.so.6 libstdc++.so.6_ori
    ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so
    mv liblzma.so.5 liblzma.so.5_ori
    ln -s /lib/x86_64-linux-gnu/liblzma.so.5
    ln -s /lib/x86_64-linux-gnu/liblzma.so.5 liblzma.so
     
    mv libccl_curl_drl.so libccl_curl_drl.so_bkp
  6. Install the command wrapper script altera described below to /usr/local/bin.
  7. Set up the udev rules and make sure that jtagd finds libudev.so.0 as described below.
  8. Install further package dependencies to make ModelSim ASE work (see section below for details).

Command Wrapper to Launch the Altera Tools

The Altera tools require the setting of some environment variables to work properly:

ALTERAPATH=/opt/altera_lite/16.0
ALTERAOCLSDKROOT=${ALTERAPATH}/hld
QSYS_ROOTDIR="${ALTERAPATH}/quartus/sopc_builder/bin"
QUARTUS_ROOTDIR=${ALTERAPATH}/quartus
QUARTUS_ROOTDIR_OVERRIDE=$QUARTUS_ROOTDIR
PATH=$PATH:${ALTERAPATH}/quartus/bin
PATH=$PATH:${ALTERAPATH}/nios2eds/bin
PATH=$PATH:${ALTERAPATH}/modelsim_ase/bin

Setting these permanently in your .bashrc may lead to surprises when using other tools. Therefore, it is better to launch the Altera tools through a wrapper script:

altera
#!/bin/sh
########################################################################
# Altera Quartus Prime Lite FPGA tools command wrapper
########################################################################
# Author:       Torsten Maehne <torsten.maehne@bfh.ch
# Organization: BFH-TI, Burgdorf, Switzerland
# Created:      2015-07-22
# Modified	:
#                2016-07-20 lck1 (??)
#                2016-10-07 hga3 (added new ref to export nios2 obj tool)
########################################################################
 
# Output help message if no arguments have been passed
if [ $# -lt 1 ]; then
   echo "Altera Quartus Prime Lite FPGA tools command wrapper"
   echo "Usage: $0 <command> [args]"
   exit 0
fi
 
# Avoid problems with non-english locales
LANG=C
LANGUAGE=en_US:en
export LANG LANGUAGE
 
# External Qt plug ins may not be compatible with the Qt version
# installed by Quartus Prime.
unset QT_PLUGIN_PATH
 
# Set the necessary environment variables
ALTERAPATH=/opt/altera_lite/16.0
ALTERAOCLSDKROOT=${ALTERAPATH}/hld
QSYS_ROOTDIR="${ALTERAPATH}/quartus/sopc_builder/bin"
QUARTUS_ROOTDIR=${ALTERAPATH}/quartus
QUARTUS_ROOTDIR_OVERRIDE=$QUARTUS_ROOTDIR
PATH=$PATH:${ALTERAPATH}/quartus/bin
PATH=$PATH:${ALTERAPATH}/nios2eds/bin
PATH=$PATH:${ALTERAPATH}/modelsim_ase/bin
PATH=$PATH:${ALTERAPATH}/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin
export ALTERAPATH ALTERAOCLSDKROOT QSYS_ROOTDIR
export QUARTUS_ROOTDIR QUARTUS_ROOTDIR_OVERRIDE
export PATH
 
# Launch the tool and pass all arguments
exec "$@"

The wrapper sets the environment and then launches the command passed as first argument passing all remaining arguments to it, e.g.:

$ altera quartus    # Launches the Quartus II FPGA design environment
$ altera bash       # Launches as BASH, from which the Altera tools can be launched without a wrapper

The wrapper script should be installed to /usr/local/bin.

The launching of Quartus II and ModelSim from the shell may be further facilitated by defining the following aliases:

alias vsim="altera vsim +nowarn3116"  # see batch suggestion below
alias quartus="altera quartus --64bit"

USB-Blaster JTAG Programming Interface

The USB-Blaster requires updates of the udev rules. To this end, add /etc/udev/rules.d/51-altera-usb-blaster.rules with the following content:

51-altera-usb-blaster.rules
SUBSYSTEM=="usb",ACTION=="add",ATTRS{idVendor}=="09fb",ATTRS{idProduct}=="6001",MODE="0664",SYMLINK+="usbblaster%k",GROUP="plugdev"
SUBSYSTEM=="usb",ACTION=="add",ATTRS{idVendor}=="09fb",ATTRS{idProduct}=="6002",MODE="0664",SYMLINK+="usbblaster%k",GROUP="plugdev"
SUBSYSTEM=="usb",ACTION=="add",ATTRS{idVendor}=="09fb",ATTRS{idProduct}=="6003",MODE="0664",SYMLINK+="usbblaster%k",GROUP="plugdev"
SUBSYSTEM=="usb",ACTION=="add",ATTRS{idVendor}=="09fb",ATTRS{idProduct}=="6010",MODE="0664",SYMLINK+="usbblaster%k",GROUP="plugdev"
SUBSYSTEM=="usb",ACTION=="add",ATTRS{idVendor}=="09fb",ATTRS{idProduct}=="6810",MODE="0664",SYMLINK+="usbblaster%k",GROUP="plugdev"

and reload udev:

/etc/init.d/udev reload

Once you now connect a Altera FPGA-Board with a USB-Blaster interface, it should be automatically detected by Linux and get the right access permissions for normal user access. lsusb should give something like:

$ lsusb
...
Bus 001 Device 009: ID 09fb:6001 Altera Blaster

Still, jtagconfig might hang. This is due that jtagd doesn't find libudev.so.0. This can be resolved with a symbolic link:

cd /opt/altera/15.0/quartus/linux64
ln -sf /lib/x86_64-linux-gnu/libudev.so.1 libudev.so.0

Now, jtagconfig should succeed to detect the USB-Blaster and attached CPLD/FPGA:

$ altera jtagconfig
1) USB-Blaster [1-3]
  020F20DD   EP3C16/EP4CE15

Otherwise, try to kill jtagd and launch it in debug mode:

$ killall jtagd
$ jtagd --foreground --debug

As long as jtagd is running in the foreground, the USB-Blaster and attached CPLD/FPGA should be found by 'jtagconfig' from another terminal.

ModelSim Altera Starter Edition

When starting a simulation in vsim, it will always issue the following warning:

VSIM 3> run
# ** Warning: (vsim-3116) Problem reading symbols from linux-gate.so.1 : can not open ELF file.

This seems to be related to this GDB bug report. The warning is harmless, as linux-gate.so.1 does not really exist. It is an interface provided by the Linux kernel to load ELF files.

A better method to fix this issue batch modelsim.ini located in /opt/altera_lite/16.0/modelsim_aes. Use following commands:

vim /opt/altera_lite/16.0/modelsim_ase/modelsim.ini

And write the following to the file

[msg_system]
suppress = 3116

Meaning of this batch is suppressing system messages with message ID 3116

Desktop Environment Integration

The direct launch of Quartus II and ModelSim from a desktop environment such as KDE or GNOME requires the installation of suitable .desktop files:

altera-quartus-prime-lite.desktop
[Desktop Entry]
Type=Application
Version=1.0
Name=Quartus Prime Lite 16.0
Comment=Design environment for Altera CPLDs/FPGAs
Exec=altera quartus
Icon=altera-quartus-pl.png
Terminal=false
Categories=Development;IDE;Electronics
Keywords=CPLD;FPGA
altera-modelsim-ase.desktop
[Desktop Entry]
Type=Application
Version=1.0
Name=Modelsim 10.4d by Mentor (Altera Starter Edition)
Comment=Multi-language HDL simulation environment
Exec=altera vsim
Icon=altera-modelsim
Terminal=true
Categories=Development;IDE;Electronics
Keywords=VHDL;Verilog;SystemVerilog;SystemC

A script to install the icons and .desktop files could look something like this:

install_altera_icons.sh
#!/bin/sh
#
# Script that installs icons, menu entities and MIME-types for Altera Quartus Prime Lite
#
 
# echo "Copying icons to /usr/share/icons/"
xdg-icon-resource install --context apps --size 48 altera-modelsim.png
 
xdg-icon-resource install --context apps --size 48 altera-quartus-pl.png
 
# echo "Adding items to main menu"
 
# echo "Updating icons"
# sudo xdg-icon-resource forceupdate
 
# echo "Registering MIME types"
 
# echo "Installing icons for filetypes"
 
echo "Installing menu items"
xdg-desktop-menu install altera-quartus-prime-lite.desktop
xdg-desktop-menu install altera-modelsim-ase.desktop
 
echo "Done!"

The .desktop files, icons, and script are available in altera_quartus_prime_icons.tar.

Links to References