Altera Quartus II (Web Edition)

  • Expected users: EKT & FBF - Digital Systems
  • Responsible users: MHT1
  • Current Version: 15.0.2.153 (2015-07)
  • Licensing: BFH Students | BFH Staff (no license SRV needed → free web-edition)
  • Supported architecture: amd64
  • State: needed for teaching BTE5021 to BTE5024, BTE5211, BTE5212, BTF3220, BTF4220
  • Suggested Debian package name: altera-quartus2-<version>-web-edition

Description

The Altera Quartus II design tools version 15.0 supports the following device families: Arria II, Cyclone IV, Cyclone V, MAX II, MAX V, and MAX 10 FPGAs. Its web 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.3d (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. Attention, for a new install choose the latest complete download from the Updates tab: Quartus-web-15.0.2.153-linux.tar (8.04 GiB). The download may require the creation of a free Altera account.

Upload binary to Git and reference to the GitWeb for download

Installation Step-by-Step guide

Attention: The following installation instructions were tested on a Debian Jessie installation with bash configured as the standard shell (dpkg-reconfigure dash).

TODO: Check that installation also works using the Debian default shell dash.

  1. Download Quartus-web-15.0.2.153-linux.tar from the Altera Download Center.
  2. Install the external package dependencies:
    $ apt-get install libstdc++5 libmotif4 libxp6 libcurl3
    # 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

    Actually, the Arch Linux Wiki lists many more dependendencies:

    1. Let us first install the native versions of the required packages: expat fontconfig freetype2 glibc gtk2 libcanberra libpng libpng12AUR libice libsm util-linux ncurses tcl tcllib zlib libx11 libxau libxdmcp libxext libxft libxrender libxt libxtst.
    2. And the Multilib versions: lib32-expat lib32-fontconfig lib32-freetype2 lib32-glibc lib32-gtk2 lib32-libcanberra lib32-libpng lib32-libpng12AUR lib32-libice lib32-libsm lib32-util-linux lib32-ncurses lib32-zlib lib32-libx11 lib32-libxau lib32-libxdmcp lib32-libxext lib32-libxft lib32-libxrender lib32-libxt lib32-libxtst.
    3. TODO: How does lib32-util-linux translate to Debian packages? → Took the library dependencies of the util-linux:i386 package.
    4. Many of the above packages were already installed. Missing were:
      • expat
      • libblkid1:i386
      • libcanberra0:i386
      • libgtk2.0.0-0:i386
      • libmount1:i386
      • libpam0g:i386
      • libslang2:i386
      • libsmartcols1:i386
      • tcllib
    5. According to this web site, the following two packages may be also necessary:
      • build-essential
      • libgtk-3-0:i386
    6. TODO: Verify, which packages are actually needed as dependencies for ModelSim.
  4. Unpack the archive Quartus-web-15.0.2.153-linux.tar:
    $ tar xfv Quartus-web-15.0.2.153-linux.tar
  5. Launch the setup script as root from the extacted archive:
    $ cd Quartus-web-15.0.2.153-linux
    $ bash ./setup.sh

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

  6. 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/15.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
    ln -s /lib/x86_64-linux-gnu/liblzma.so.5
    ln -s /lib/x86_64-linux-gnu/liblzma.so.5 liblzma.so
     
    cd /opt/altera/15.0/quartus/linux32
    mv libstdc++.so.6 libstdc++.so.6_ori
     
    ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6
    ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6 libstdc++.so
  7. Install the command wrapper script altera described below to /usr/local/bin.
  8. Set up the udev rules and make sure that jtagd finds libudev.so.0 as described below.
  9. 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/15.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 II FPGA tools command wrapper
########################################################################
# Author:       Torsten Maehne <torsten.maehne@bfh.ch
# Organization: BFH-TI, Burgdorf, Switzerland
# Created:      2015-07-22
########################################################################
 
# Output help message if no arguments have been passed
if [[ $# -lt 1 ]]; then
   echo "Altera Quartus II 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 II.
unset QT_PLUGIN_PATH
 
# Set the necessary environment variables
ALTERAPATH=/opt/altera/15.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
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 relaunch

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. To ignore this warning, launch vsim with the following option:

$ altera vsim +nowarn3116

You can create an alias for this purpose in your .bashrc:

alias vsim="altera vsim +nowarn3116"

A better method to fix this issue batch modelsim.ini located in /opt/altera/15.0/modelsim_aes. Use following batch:

[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-quartus2-we.desktop
[Desktop Entry]
Type=Application
Version=1.0
Name=Altera Quartus II 15.0 (Web Edition)
Comment=Design environment for Altera CPLDs/FPGAs
Exec=altera quartus
Icon=/opt/altera/15.0/quartus/adm/quartusii.png
Terminal=false
Categories=Development;IDE;Electronics
Keywords=CPLD;FPGA
altera-modelsim-ase.desktop
[Desktop Entry]
Type=Application
Version=1.0
Name=Mentor Graphics ModelSim 10.3d (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 II
#
 
# echo "Copying icons to /usr/share/icons/"
xdg-icon-resource install --context apps --size 48 altera-modelsim.png
 
# echo "Adding items to main menu"
 
# echo "Updating icons"
# xdg-icon-resource forceupdate
 
# echo "Registering MIME types"
 
# echo "Installing icons for filetypes"
 
echo "Installing menu items"
xdg-desktop-menu install altera-quartus2-we.desktop
xdg-desktop-menu install altera-modelsim-ase.desktop
 
echo "Done!"

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

Remaining issues

  • When Quartus II is launched with
    $ altera quartus

    the following error appears:

Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion `map→l_init_called' failed!

According to this Altera Knowledge Base article, this is due to a non-thread-safe libcurl. A patch for Altera Quartus II 14.1 is provided and it is claimed that the error has been fixed for 15.0. However, replacing /opt/altera/15.0/quartus/linux64/libcurl.so.4 with a symbolic link to Debian's libcurl variants doesn't help. Fix the error by the following commands:

cd /opt/altera/15.0/quartus/linux64

mv crashreporter crashreporter_ori
mv crashreporter.dep crashreporter.dep_ori
mv libccl_curl_drl.so libccl_curl_drl.so_ori
mv libcrypto.so.1.0.0 libcrypto.so.1.0.0_ori
mv libcurl.so.4 libcurl.so.4_ori
mv libssl.so.1.0.0 libssl.so.1.0.0_ori
  • Improve the altera wrapper script so that recursive calls don't have an impact (e.g., repeated entries in the PATH).
  • Improve the altera wrapper script to cope with different installed toolchain versions.
  • Decide about organization of the Debian packages. Proposal:
    • altera-quartus2-common: Common wrapper scripts, e.g., altera
    • altera-quartus2-<version>-web-edition: Pure Quartus II binary installation with supplied setup.sh
    • altera-quartus2-<version>-web-edition-fixes: Any necessary reversible fixes to make Quartus II work on Debian.
    • altera-quartus2-<version>-web-edition-desktop: Any desktop integration files. Maybe integrated with altera-quartus2-<version>-web-edition-fixes.
  • Find a way to disable vsim warning 3116 in modelsim.ini so that it gets more reliably suppressed.
  • Check whether other shared object files installed with Quartus II can be replaced by links to the Linux distribution's maintained equivalents (e.g., Qt4).
  • Fix file permissions, e.g.:
    1. /opt/altera/15.0/quartus/linux64 contains many .so files with set executable permission.
    2. suggestion for fix chmod o-x ^(dir&elf) & chmod o-w
    3. add group and user to group as for a quick fix.

Links to References