Difference between revisions of "Altera Design Software"

From ArchWiki
Jump to: navigation, search
(USB-Blaster Download Cable Driver)
(Added lib32-freetype2 option to correct freetype2 issues)
 
(30 intermediate revisions by 16 users not shown)
Line 1: Line 1:
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Mathematics and science]]
 
[[Category:Mathematics and science]]
[[zh-CN:Altera Design Software]]
+
[[ja:Altera Quartus Prime Design Software]]
This tutorial shows how to get, install and configure the following softwares from Altera:
+
[[zh-cn:Altera Design Software]]
* Quartus II Web Edition v13.0
+
This tutorial shows how to download, install, and configure the following software from Altera:
 +
* Quartus Prime Stamdard Edition v15.1
 
** USB-Blaster (I and II) Download Cable Driver
 
** USB-Blaster (I and II) Download Cable Driver
* ModelSim - Altera Starter Edition
+
* ModelSim-Altera Edition (Included with Quartus Prime Standard Edition v15.1)
  
== Quartus II Web Edition v13.0 ==
+
{{Note|The following tutorial works for older Quartus II and ModelSim versions, including both Subscription Editions and Web Editions, from at-least v13.0 through v15.0.}}
  
The following procedure shows how to get, install and configure Altera Quartus II Web Edition v13.0 for Arch Linux.
+
== Quartus Prime Standard Edition ==
Quartus II is Altera's big software collection to design and interact with about all their FPGAs/CPLDs/etc. products.
+
 
 +
The following procedure shows how to download, install, and configure Altera Quartus Prime Standard Edition v15.1 for Arch Linux.
 +
 
 +
{{Note|The following tutorial works for older Quartus II and ModelSim versions, including both Subscription Editions and Web Editions, from at-least v13.0 through v15.0.}}
 +
 
 +
Quartus Prime is Altera's design software collection to design and interact with all their FPGAs/CPLDs/etc. products.
  
 
The procedure focuses on Arch Linux 64-bit systems, although 32-bit installations should work fine too.
 
The procedure focuses on Arch Linux 64-bit systems, although 32-bit installations should work fine too.
  
Quartus II Web Edition v13.0 is [http://www.altera.com/download/os-support/oss-index.html officially supported]
+
Quartus Prime Standard Edition v15.1 is [http://www.altera.com/download/os-support/oss-index.html officially supported]
for RHEL 5 and RHEL 6, but since it's one of those huge collections of proprietary software that doesn't
+
for RHEL 5 and RHEL 6, but since it is one of those huge collections of proprietary software that does not
interact so much with the distribution, it's fairly easy to install on Arch Linux.
+
interact so much with the distribution, it is fairly easy to install on Arch Linux.
  
=== Get Quartus II ===
+
=== Get Quartus Prime ===
  
In [http://dl.altera.com/13.0/?edition=web Altera's Downloads section], select Linux as the operating system
+
In [http://dl.altera.com/?edition=standard Altera's Downloads section], select Linux as the operating system
and get the ''Combined Files'' tar archive (something like {{ic|Quartus-web-13.0.0.156-linux.tar}}).
+
and get the ''Combined Files'' tar archive (something like {{ic|Quartus-15.1.2.193-linux-complete.tar}}).
  
 
=== Install dependencies ===
 
=== Install dependencies ===
  
Although the main Quartus II software is 64-bit, lots of Altera tools shipped with Quartus II are still 32-bit
+
Although the main Quartus Prime software is 64-bit, alot of Altera tools shipped with Quartus Prime are still 32-bit
softwares. Those include the Nios II EDS and Qsys, for example. This is why we need to install lots of
+
software. Those include the Nios II EDS and Qsys, for example. This is why we need to install lots of
 
{{ic|lib32-}} libraries and other programs from the Arch Linux Multilib repo. Obviously, if you have a 32-bit
 
{{ic|lib32-}} libraries and other programs from the Arch Linux Multilib repo. Obviously, if you have a 32-bit
Arch Linux system, you don't need the Multilib versions.
+
Arch Linux system, you do not need the Multilib versions.
  
In order to install Multilib packages using Pacman, you need to enable the Multilib repository (if not already done). Open
+
In order to install Multilib packages using [[pacman]], you need to enable the [[multilib]] repository first (if not already done).
{{ic|/etc/pacman.conf}} and uncomment the following lines:
+
 
+
[multilib]
+
Include = /etc/pacman.d/mirrorlist
+
 
+
Then, synchronize the repository.
+
 
+
# pacman -Sy
+
 
+
You should see {{ic|multilib}} being updated.
+
  
 
All the packages required below are taken from [http://www.altera.com/literature/manual/quartus_install.pdf Altera Software Installation and Licensing] (sect. 1-4).
 
All the packages required below are taken from [http://www.altera.com/literature/manual/quartus_install.pdf Altera Software Installation and Licensing] (sect. 1-4).
  
Let's first install the native versions of the required packages:
+
Let us first install the native versions of the required packages: {{Pkg|expat}} {{Pkg|fontconfig}} {{Pkg|freetype2}} {{Pkg|xorg-fonts-type1}} {{Pkg|glibc}} {{Pkg|gtk2}} {{Pkg|libcanberra}} {{Pkg|libpng}} {{AUR|libpng12}} {{Pkg|libice}} {{Pkg|libsm}} {{Pkg|util-linux}} {{Pkg|ncurses}} {{Pkg|tcl}} {{Pkg|tcllib}} {{Pkg|zlib}} {{Pkg|libx11}} {{Pkg|libxau}} {{Pkg|libxdmcp}} {{Pkg|libxext}} {{Pkg|libxft}} {{Pkg|libxrender}} {{Pkg|libxt}} {{Pkg|libxtst}}.
 
+
# sudo pacman -S expat fontconfig freetype2 glibc gtk2 libcanberra libpng \
+
  libpng12 libice libsm util-linux ncurses tcl tcllib zlib libx11 libxau \
+
  libxdmcp libxext libxft libxrender libxt libxtst
+
  
And the Multilib versions:
+
And the Multilib versions: {{Pkg|lib32-expat}} {{Pkg|lib32-fontconfig}} {{Pkg|lib32-freetype2}} {{Pkg|lib32-glibc}} {{Pkg|lib32-gtk2}} {{Pkg|lib32-libcanberra}} {{Pkg|lib32-libpng}} {{AUR|lib32-libpng12}} {{Pkg|lib32-libice}} {{Pkg|lib32-libsm}} {{Pkg|lib32-util-linux}} {{Pkg|lib32-ncurses}} {{Pkg|lib32-zlib}} {{Pkg|lib32-libx11}} {{Pkg|lib32-libxau}} {{Pkg|lib32-libxdmcp}} {{Pkg|lib32-libxext}} {{Pkg|lib32-libxft}} {{Pkg|lib32-libxrender}} {{Pkg|lib32-libxt}} {{Pkg|lib32-libxtst}}. 
  
# sudo pacman -S lib32-expat lib32-fontconfig lib32-freetype2 lib32-glibc lib32-gtk2 lib32-libcanberra lib32-libpng \
+
You are now ready to install and launch Quartus Prime.
  lib32-libpng12 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 
+
 
+
You are now ready to install and launch Quartus II.
+
  
 
=== Installing ===
 
=== Installing ===
 +
 +
{{Poor writing|The installation should be handled with pacman through a [[PKGBUILD]].}}
  
 
To install, first extract the downloaded tar archive:
 
To install, first extract the downloaded tar archive:
  
  $ tar -xvf Quartus-web-13.0.0.156-linux.tar
+
  $ tar -xvf Quartus-15.1.2.193-linux-complete.tar
  
and launch {{ic|setup.sh}}. If you're going to install Quartus II anywhere outside your
+
and launch {{ic|setup.sh}}. If you are going to install Quartus Prime anywhere outside your
 
home directory, run it as root:
 
home directory, run it as root:
  
Line 72: Line 62:
 
get a command-line interactive install wizard, which will do the same.
 
get a command-line interactive install wizard, which will do the same.
  
The default install path is {{ic|~/altera/13.0}}, but some prefer {{ic|/opt/altera/13.0}}, which we assume
+
The default install path is {{ic|/root/altera/15.1}}, but some prefer {{ic|/opt/altera/15.1}}, which we assume
 
for the rest of this document.
 
for the rest of this document.
  
'''Make sure to include''' the 64-bit option of Quartus II when installing.
+
'''Make sure to include''' the 64-bit option of Quartus Prime when installing.
  
=== Launching Quartus II ===
+
=== Launching Quartus Prime ===
  
Assuming you installed Quartus II in {{ic|/opt/altera/13.0}}, Quartus II binaries are located into {{ic|/opt/altera/13.0/quartus/bin}}.
+
Assuming you installed Quartus Prime in {{ic|/opt/altera/15.1}}, Quartus Prime binaries are located into {{ic|/opt/altera/15.1/quartus/bin}}.
Run Quartus II (64-bit version):
+
Run Quartus Prime (64-bit version):
  
  $ /opt/altera/13.0/quartus/bin/quartus --64bit
+
  $ /opt/altera/15.1/quartus/bin/quartus --64bit
  
 
or the 32-bit version:
 
or the 32-bit version:
  
  $ /opt/altera/13.0/quartus/bin/quartus
+
  $ /opt/altera/15.1/quartus/bin/quartus
  
 
All other Altera tools, like Qsys, the Nios II EDS, Chip Planner and SignalTap II may be launched without any problem
 
All other Altera tools, like Qsys, the Nios II EDS, Chip Planner and SignalTap II may be launched without any problem
from the ''Tools'' menu of Quartus II.
+
from the ''Tools'' menu of Quartus Prime.
  
=== Integrating Quartus II with the system ===
+
=== Integrating Quartus Prime with the system ===
  
Quartus II can be integrated with the system in several ways, but those are optional.
+
Quartus Prime can be integrated with the system in several ways, but those are optional.
  
 
==== {{ic|PATH}} variable ====
 
==== {{ic|PATH}} variable ====
  
Let's now add the Quartus {{ic|bin}} folder to the {{ic|PATH}} variable so it can be executed without specifying its absolute path.
+
Let us now add the Quartus {{ic|bin}} folder to the {{ic|PATH}} variable so it can be executed without specifying its absolute path.
 
Create a {{ic|quartus.sh}} file in the {{ic|/etc/profile.d}} directory
 
Create a {{ic|quartus.sh}} file in the {{ic|/etc/profile.d}} directory
  
 
{{hc|/etc/profile.d/quartus.sh
 
{{hc|/etc/profile.d/quartus.sh
 
|2=<nowiki>
 
|2=<nowiki>
export PATH=$PATH:/opt/altera/13.0/quartus/bin
+
export PATH=$PATH:/opt/altera/15.1/quartus/bin
 
</nowiki>}}
 
</nowiki>}}
  
Line 109: Line 99:
 
  # chmod +x /etc/profile.d/quartus.sh
 
  # chmod +x /etc/profile.d/quartus.sh
  
Please note that those {{ic|profile.d}} files are loaded at each ''login''. In the mean time, simply source
+
Please note that those {{ic|profile.d}} files are loaded at each ''login''. In the mean time, simply {{ic|source}}
 
that file in Bash:
 
that file in Bash:
  
Line 119: Line 109:
 
version. A shell alias, like {{ic|quartus64}}, is a great solution to avoid typing it each time.
 
version. A shell alias, like {{ic|quartus64}}, is a great solution to avoid typing it each time.
  
==== Application menu entry ====
+
==== Application menu entry - Quartus Prime ====
  
 
A freedesktop.org application menu entry (which a lot of desktop environments and window managers follow) can be added
 
A freedesktop.org application menu entry (which a lot of desktop environments and window managers follow) can be added
Line 129: Line 119:
 
[Desktop Entry]
 
[Desktop Entry]
 
Version=1.0
 
Version=1.0
Name=Quartus II Web Edition v13.0
+
Name=Quartus Prime Standard Edition v15.1
Comment=Quartus II design software for Altera FPGA's
+
Comment=Quartus Prime design software for Altera FPGA's
Exec=/opt/altera/13.0/quartus/bin/quartus --64bit
+
Exec=/opt/altera/15.1/quartus/bin/quartus --64bit
Icon=/opt/altera/13.0/quartus/adm/quartusii.png
+
Icon=/opt/altera/15.1/quartus/adm/quartusii.png
 
Terminal=false
 
Terminal=false
 
Type=Application
 
Type=Application
 
Categories=Development
 
Categories=Development
 
</nowiki>}}
 
</nowiki>}}
 +
 +
=== Standard Edition License Validation ===
 +
 +
Configuring the path to your Quartus Prime Standard Edition license file from the Quartus Prime settings interface is not enough for successful license validation. The license validation routine looks for your MAC address on device {{ic|eth0}}. This was the legacy name for your ethernet controller; now {{ic|systemd}} dynamically allocates a name to your device on boot - this can be different from machine to machine. We need to rename that device back to the expected {{ic|eth0}}.
 +
 +
Create a new udev rule:
 +
{{hc|/etc/udev/rules.d/10-network.rules
 +
|<nowiki>
 +
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="eth0"
 +
</nowiki>}}
 +
 +
where {{ic|xx:xx:xx:xx:xx:xx}} is your networking device's MAC address. Then, ''reload'' that file using {{ic|udevadm}}:
 +
 +
# udevadm control --reload
 +
 +
Alternatively a dummy {{ic|eth0}} network interface can be created by {{ic|systemd-networkd}} daemon dynamically at boot. Create the file {{ic|25-dummy.netdev}} in the {{ic|/etc/systemd/network/}} directory
 +
 +
{{hc|/etc/systemd/network/25-dummy.netdev
 +
|2=<nowiki>
 +
[Match]
 +
Host=hostname
 +
 +
[NetDev]
 +
Name=eth0
 +
Kind=dummy
 +
MACAddress=xx:xx:xx:xx:xx:xx
 +
</nowiki>}}
 +
 +
where {{ic|xx:xx:xx:xx:xx:xx}} is the licensed networking device's MAC address and {{ic|hostname}} is your machine's hostname. Finally ensure {{ic|systemd-networkd}} service is enabled and started:
 +
 +
# systemctl enable systemd-networkd.service
 +
# systemctl start systemd-networkd.service
 +
 +
The Quartus Prime Standard Edition license validation routine also uses the deprecated networking tool {{ic|ifconfig}} to validate your networking devices MAC address as per your Quartus Prime license. The deprecated networking package {{ic|net-tools}} contains the {{ic|ifconfig}} tool. Thus one must also install the {{ic|net-tools}} package for Quartus Prime Standard Edition licensing validation success.
  
 
=== USB-Blaster Download Cable Driver ===  
 
=== USB-Blaster Download Cable Driver ===  
Line 154: Line 178:
 
</nowiki>}}
 
</nowiki>}}
  
Then, ''reload'' that file using {{ic|udevadm}}:
+
Then, ''reload'' that file using {{ic|udevadm}} (disconnect any Altera device from port USB port before this command):
  
 
  # udevadm control --reload
 
  # udevadm control --reload
Line 160: Line 184:
 
To check that everything is working, plug your FPGA or CPLD board using your USB-Blaster Download Cable and run:
 
To check that everything is working, plug your FPGA or CPLD board using your USB-Blaster Download Cable and run:
  
  $ /opt/altera/13.0/quartus/bin/jtagconfig
+
  $ /opt/altera/15.1/quartus/bin/jtagconfig
  
 
You should have an output similar to this one
 
You should have an output similar to this one
Line 167: Line 191:
 
   020B30DD  EP2C15/20
 
   020B30DD  EP2C15/20
  
If jtagconfig output doesn't contain board name, you might have problems with launching nios2 tools. In order to workaround this issue, you should copy jtagd settings to /etc/jtagd:
+
If jtagconfig output does not contain board name, you might have problems with launching nios2 tools. In order to workaround this issue, you should copy jtagd settings to /etc/jtagd:
  
 
  # mkdir /etc/jtagd
 
  # mkdir /etc/jtagd
  # cp /opt/altera/13.0/quartus/linux/pgm_parts.txt /etc/jtagd/jtagd.pgm_parts
+
  # cp /opt/altera/15.1/quartus/linux/pgm_parts.txt /etc/jtagd/jtagd.pgm_parts
  
 
and restart jtagd:
 
and restart jtagd:
Line 183: Line 207:
 
  020F30DD EP3C25/EP4CE22
 
  020F30DD EP3C25/EP4CE22
  
If there seems to be an error message about "linux64" and you didn't install the 64-bit version of Quartus II,
+
If there seems to be an error message about "linux64" and you did not install the 64-bit version of Quartus Prime,
create a symlink from {{ic|linux}} to {{ic|linux64}} in {{ic|/opt/altera/13.0/quartus}}:
+
create a symlink from {{ic|linux}} to {{ic|linux64}} in {{ic|/opt/altera/15.1/quartus}}:
  
  # ln -s /opt/altera/13.0/quartus/linux /opt/altera/13.0/quartus/linux64
+
  # ln -s /opt/altera/15.1/quartus/linux /opt/altera/15.1/quartus/linux64
  
==ModelSim==
+
==ModelSim-Altera Edition ==
  
{{Out of date|This section is intended for Quartus II v12.0 and should be updated for Quartus II v13.0}}
 
 
{{Note|The ModelSim version installed with Quartus II Web Edition v13.0 works without any modification when launched from Quartus II's ''Tool'' menu.}}
 
  
 
===Install===
 
===Install===
ModelSim is downloadable at: https://www.altera.com/download/software/modelsim-starter/12.0
+
ModelSim-Altera Edition is downloaded and installed from the ''Combined Files'' tar archive {{ic|Quartus-15.1.2.193-linux-complete.tar}} as part of the Quartus Prime installation procedure above.
  
You need to download these 3 files :
 
* Modelsim v10.0d for Quartus II v12.0 (12.0_modelsim_ase_linux.tar.gz)
 
* Service Pack 2 for Modelsim v10.0d (12.0sp2_modelsim_ase_linux.tar.gz)
 
* Service Pack 1 for Modelsim v10.0d (12.0sp1_modelsim_ase_linux.tar.gz)
 
  
Unzip 12.0_modelsim_ase_linux.tar.gz
+
===Compatibility with Archlinux===
+
====With the kernel 4.x and Upwards ====
$ cd <Download-folder>
+
$ sudo ./setup
+
  
Executing this script should open a setup GUI. Just follow the instructions. For the purpose of this tutorial, I assume that you are installing Quartus II in the {{ic|/opt/altera}} folder. Don't forget to select the file for the source of install if you don't want to download again quartus.
+
{{Note|ModelSim Starter Edition installation uses the path {{ic|/opt/altera/15.1/modelsim_ase/}} where ModelSim Subscription Edition installation uses the path {{ic|/opt/altera/15.1/modelsim_ae/}}; the following assumes the ModelSim Subcription Edition installation.}}
  
Repeat this procedure for the sp1 file then the sp2.
+
Modelsim has a problem with version 4 of the linux kernel. You need to edit the {{ic|vsim}} script to make it compatible. This file may be be read only, so temporarily give yourself write permissions and:
 
+
===Compatibility with Archlinux===
+
====With the kernel 3.x ====
+
Modelsim has a problem with the version 3 of linux kernel. You need to edit the file to make it compatible :  
+
  
 
change
 
change
{{hc|/opt/altera/modelsim_ase/bin/vsim line 204
+
{{hc|/opt/altera/15.1/modelsim_ae/bin/vsim line 206
 
|<nowiki>
 
|<nowiki>
 
  *)                vco="linux_rh60" ;;
 
  *)                vco="linux_rh60" ;;
 
</nowiki>}}
 
</nowiki>}}
 
to  
 
to  
{{hc|/opt/altera/modelsim_ase/bin/vsim line 204
+
{{hc|/opt/altera/15.1/modelsim_ae/bin/vsim line 206
 
|<nowiki>
 
|<nowiki>
 
  *)                vco="linux" ;;
 
  *)                vco="linux" ;;
 
</nowiki>}}
 
</nowiki>}}
  
====Install libraries====
+
====With freetype2 2.5.0.1-1 ====
Install library ''libxft'' and ''ncurses''.
+
The upgrade from freetype2 version 2.5.0.1-1 to 2.5.0.1-2 (October 2013[https://projects.archlinux.org/svntogit/packages.git/commit/?h=packages/freetype2&id=f2903d2374daf5becc931b010efb2f613eaaae18]) causes the following error in ModelSim:
  $ sudo pacman -S libxft ncurses libxext
+
  $ vsim
 +
Error in startup script:
 +
Initialization problem, exiting.
 +
Initialization problem, exiting.
 +
Initialization problem, exiting.
 +
    while executing
 +
"EnvHistory::Reset"
 +
    (procedure "PropertiesInit" line 3)
 +
    invoked from within
 +
"PropertiesInit"
 +
    invoked from within
 +
"ncFyP12 -+"
 +
    (file "/opt/questasim/linux_x86_64/../tcl/vsim/vsim" line 1)
 +
** Fatal: Read failure in vlm process (0,0)
 +
There are two solutions to solve this problem. The first involves downgrading the Package (probably via the [[Arch Linux Archive]]). If you are using the 32-bit version, it is sufficient to downgrade {{Pkg|lib32-freetype2}}. The second and more elegant solution involves replacing the old freetype version for ModelSim only without withholding updates on the whole system (originally proposed at the now-dead link http://communities.mentor.com/mgcx/message/46770):
 +
*Copy the freetype library and symlinks somewhere in the altera folder, eg: {{ic|$HOME/altera/xx.x/lib32/}}
 +
{{bc|libfreetype.so
 +
libfreetype.so.6
 +
libfreetype.so.6.10.2}}
 +
*Edit the ModelSim script in {{ic|/opt/altera/15.1/modelsim_ae/bin/vsim}} and add near the top (after the {{ic|#!/bin/sh}})
 +
export LD_LIBRARY_PATH=/home/user/altera/xx.x/lib32
 +
{{Note|The quartus script will need to have write permissions added to it.}}
 +
When ModelSim is launched directly from Quartus the error may persist. In this case, add the same line to {{ic|quartus/bin/quartus_sh}}.
  
For 64 bit edition, install these library from multilib repository
+
====With ncurses 5.9 ====
$ sudo pacman -S lib32-libxft lib32-ncurses lib32-libxext (from multilib repo)
+
The upgrade from ncurses version 5.9-7 to 6.0-1 (and later) (September 2015[https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/ncurses&id=ddb1abecfe25260321c9cb0ef24f29351f28ecb3]) causes the following error in ModelSim:
  
=== Add icon to the system ===
+
$ vsim
 +
vish: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
 +
[1]  + exit 127  vsim
  
 +
There are two solutions to this problem. One is to use {{AUR|ncurses5-compat-libs}} and tweak the PKGBUILD to compile a 32-bit version of the library. (Or use {{AUR|lib32-ncurses5-compat-libs}}) This will provide the latest version of ncurses with an ncurses5-compatible ABI.
 +
 +
The other solution is to download the ncurses 5.9 source, compile it, and copy the generated libraries and symlinks to the same directory as the freetype2 libraries.
 +
 +
Compiling ncurses 5.9 may lead to problems using GCC 5.x. It is also possible to get a precompiled library, using the [[Arch Linux Archive]]. The package can be found at http://ala.seblu.net/packages/l/lib32-ncurses/.
 +
 +
====Install libraries====
 +
Install library ''libxft'' and ''ncurses'': {{Pkg|libxft}}, {{Pkg|ncurses}}, {{Pkg|libxext}}.
 +
 +
For 64 bit edition, install these library from [[multilib]] repository: {{Pkg|lib32-libxft}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxext}}.
 +
 +
=== Application Menu Entry - ModelSim-Altera Edition ===
 
You can add Modelsim to your system application menu by creating a {{ic|modelsim.desktop}} file in your {{ic|~/.local/share/applications}} directory
 
You can add Modelsim to your system application menu by creating a {{ic|modelsim.desktop}} file in your {{ic|~/.local/share/applications}} directory
  
Line 241: Line 288:
 
[Desktop Entry]
 
[Desktop Entry]
 
Version=1.0
 
Version=1.0
Name=ModelSim
+
Name=ModelSim-Altera Edition
 
Comment=ModelSim simulation software for Altera FPGA's
 
Comment=ModelSim simulation software for Altera FPGA's
Exec=/opt/altera/modelsim_ase/bin/vsim
+
Exec=/opt/altera/15.1/modelsim_ae/bin/vsim
Icon=/opt/altera/modelsim_ase/modesim.gif
+
Icon=/opt/altera/15.1/modelsim_ae/modesim.gif
 
Terminal=true
 
Terminal=true
 
Type=Application
 
Type=Application
 
Categories=Development
 
Categories=Development
 
</nowiki>}}
 
</nowiki>}}
 +
 +
=== Resolving the "ModelSim Failed to access library 'work'" error ===
 +
The solution was originally documented here: http://jackeyblog.blogspot.com/2005/07/note-myself-modelsim-failed-to-access.html
 +
 +
If you receive the error:
 +
Error: (vcom-19) Failed to access library 'work' at "work".
 +
when running a simulation in a new directory, you must create a new {{ic|work}} directory. Execute the following in the ModelSim console:
 +
ModelSim> vlib work

Latest revision as of 19:22, 17 March 2016

This tutorial shows how to download, install, and configure the following software from Altera:

  • Quartus Prime Stamdard Edition v15.1
    • USB-Blaster (I and II) Download Cable Driver
  • ModelSim-Altera Edition (Included with Quartus Prime Standard Edition v15.1)
Note: The following tutorial works for older Quartus II and ModelSim versions, including both Subscription Editions and Web Editions, from at-least v13.0 through v15.0.

Quartus Prime Standard Edition

The following procedure shows how to download, install, and configure Altera Quartus Prime Standard Edition v15.1 for Arch Linux.

Note: The following tutorial works for older Quartus II and ModelSim versions, including both Subscription Editions and Web Editions, from at-least v13.0 through v15.0.

Quartus Prime is Altera's design software collection to design and interact with all their FPGAs/CPLDs/etc. products.

The procedure focuses on Arch Linux 64-bit systems, although 32-bit installations should work fine too.

Quartus Prime Standard Edition v15.1 is officially supported for RHEL 5 and RHEL 6, but since it is one of those huge collections of proprietary software that does not interact so much with the distribution, it is fairly easy to install on Arch Linux.

Get Quartus Prime

In Altera's Downloads section, select Linux as the operating system and get the Combined Files tar archive (something like Quartus-15.1.2.193-linux-complete.tar).

Install dependencies

Although the main Quartus Prime software is 64-bit, alot of Altera tools shipped with Quartus Prime are still 32-bit software. Those include the Nios II EDS and Qsys, for example. This is why we need to install lots of lib32- libraries and other programs from the Arch Linux Multilib repo. Obviously, if you have a 32-bit Arch Linux system, you do not need the Multilib versions.

In order to install Multilib packages using pacman, you need to enable the multilib repository first (if not already done).

All the packages required below are taken from Altera Software Installation and Licensing (sect. 1-4).

Let us first install the native versions of the required packages: expat fontconfig freetype2 xorg-fonts-type1 glibc gtk2 libcanberra libpng libpng12AUR libice libsm util-linux ncurses tcl tcllib zlib libx11 libxau libxdmcp libxext libxft libxrender libxt libxtst.

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.

You are now ready to install and launch Quartus Prime.

Installing

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: The installation should be handled with pacman through a PKGBUILD. (Discuss in Talk:Altera Design Software#)

To install, first extract the downloaded tar archive:

$ tar -xvf Quartus-15.1.2.193-linux-complete.tar

and launch setup.sh. If you are going to install Quartus Prime anywhere outside your home directory, run it as root:

# ./setup.sh

You will probably get a GUI install wizard if you installed all the aforementioned packages. You might also get a command-line interactive install wizard, which will do the same.

The default install path is /root/altera/15.1, but some prefer /opt/altera/15.1, which we assume for the rest of this document.

Make sure to include the 64-bit option of Quartus Prime when installing.

Launching Quartus Prime

Assuming you installed Quartus Prime in /opt/altera/15.1, Quartus Prime binaries are located into /opt/altera/15.1/quartus/bin. Run Quartus Prime (64-bit version):

$ /opt/altera/15.1/quartus/bin/quartus --64bit

or the 32-bit version:

$ /opt/altera/15.1/quartus/bin/quartus

All other Altera tools, like Qsys, the Nios II EDS, Chip Planner and SignalTap II may be launched without any problem from the Tools menu of Quartus Prime.

Integrating Quartus Prime with the system

Quartus Prime can be integrated with the system in several ways, but those are optional.

PATH variable

Let us now add the Quartus bin folder to the PATH variable so it can be executed without specifying its absolute path. Create a quartus.sh file in the /etc/profile.d directory

/etc/profile.d/quartus.sh
export PATH=$PATH:/opt/altera/15.1/quartus/bin

Also, make sure it can be executed:

# chmod +x /etc/profile.d/quartus.sh

Please note that those profile.d files are loaded at each login. In the mean time, simply source that file in Bash:

$ source /etc/profile.d/quartus.sh

Other environment variables related to Quartus can be found in the official installation manual.

Even if quartus is now a command known by Bash, you still need to add the --64bit argument in order to launch the 64-bit version. A shell alias, like quartus64, is a great solution to avoid typing it each time.

Application menu entry - Quartus Prime

A freedesktop.org application menu entry (which a lot of desktop environments and window managers follow) can be added to the system by creating a quartus.desktop file in your ~/.local/share/applications directory:

~/.local/share/applications/quartus.desktop
[Desktop Entry]
Version=1.0
Name=Quartus Prime Standard Edition v15.1
Comment=Quartus Prime design software for Altera FPGA's
Exec=/opt/altera/15.1/quartus/bin/quartus --64bit
Icon=/opt/altera/15.1/quartus/adm/quartusii.png
Terminal=false
Type=Application
Categories=Development

Standard Edition License Validation

Configuring the path to your Quartus Prime Standard Edition license file from the Quartus Prime settings interface is not enough for successful license validation. The license validation routine looks for your MAC address on device eth0. This was the legacy name for your ethernet controller; now systemd dynamically allocates a name to your device on boot - this can be different from machine to machine. We need to rename that device back to the expected eth0.

Create a new udev rule:

/etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="eth0"

where xx:xx:xx:xx:xx:xx is your networking device's MAC address. Then, reload that file using udevadm:

# udevadm control --reload

Alternatively a dummy eth0 network interface can be created by systemd-networkd daemon dynamically at boot. Create the file 25-dummy.netdev in the /etc/systemd/network/ directory

/etc/systemd/network/25-dummy.netdev
[Match]
Host=hostname

[NetDev]
Name=eth0
Kind=dummy
MACAddress=xx:xx:xx:xx:xx:xx

where xx:xx:xx:xx:xx:xx is the licensed networking device's MAC address and hostname is your machine's hostname. Finally ensure systemd-networkd service is enabled and started:

# systemctl enable systemd-networkd.service
# systemctl start systemd-networkd.service

The Quartus Prime Standard Edition license validation routine also uses the deprecated networking tool ifconfig to validate your networking devices MAC address as per your Quartus Prime license. The deprecated networking package net-tools contains the ifconfig tool. Thus one must also install the net-tools package for Quartus Prime Standard Edition licensing validation success.

USB-Blaster Download Cable Driver

The USB-Blaster (I and II) Download Cable is a cable that allows you to download configuration data from your computer to your FPGA, CPLD or EEPROM configuration device. However, Altera only provides official support for RHEL, SUSE Entreprise and CentOS, so we are required to do a little bit of work to make it work with Arch Linux. If you want some more detail about this cable, please refer to the USB-Blaster Download Cable User Guide.

Create a new udev rule:

/etc/udev/rules.d/51-altera-usb-blaster.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666"

Then, reload that file using udevadm (disconnect any Altera device from port USB port before this command):

# udevadm control --reload

To check that everything is working, plug your FPGA or CPLD board using your USB-Blaster Download Cable and run:

$ /opt/altera/15.1/quartus/bin/jtagconfig

You should have an output similar to this one

1) USB-Blaster [USB 1-1.1]
  020B30DD   EP2C15/20

If jtagconfig output does not contain board name, you might have problems with launching nios2 tools. In order to workaround this issue, you should copy jtagd settings to /etc/jtagd:

# mkdir /etc/jtagd
# cp /opt/altera/15.1/quartus/linux/pgm_parts.txt /etc/jtagd/jtagd.pgm_parts

and restart jtagd:

$ jtagconfig
1) USB-Blaster [2-4]
020F30DD 
$ killall jtagd
$ jtagd
$ jtagconfig
1) USB-Blaster [2-4]
020F30DD EP3C25/EP4CE22

If there seems to be an error message about "linux64" and you did not install the 64-bit version of Quartus Prime, create a symlink from linux to linux64 in /opt/altera/15.1/quartus:

# ln -s /opt/altera/15.1/quartus/linux /opt/altera/15.1/quartus/linux64

ModelSim-Altera Edition

Install

ModelSim-Altera Edition is downloaded and installed from the Combined Files tar archive Quartus-15.1.2.193-linux-complete.tar as part of the Quartus Prime installation procedure above.


Compatibility with Archlinux

With the kernel 4.x and Upwards

Note: ModelSim Starter Edition installation uses the path /opt/altera/15.1/modelsim_ase/ where ModelSim Subscription Edition installation uses the path /opt/altera/15.1/modelsim_ae/; the following assumes the ModelSim Subcription Edition installation.

Modelsim has a problem with version 4 of the linux kernel. You need to edit the vsim script to make it compatible. This file may be be read only, so temporarily give yourself write permissions and:

change

/opt/altera/15.1/modelsim_ae/bin/vsim line 206
 *)                vco="linux_rh60" ;;

to

/opt/altera/15.1/modelsim_ae/bin/vsim line 206
 *)                vco="linux" ;;

With freetype2 2.5.0.1-1

The upgrade from freetype2 version 2.5.0.1-1 to 2.5.0.1-2 (October 2013[1]) causes the following error in ModelSim:

$ vsim
Error in startup script:
Initialization problem, exiting.
Initialization problem, exiting.
Initialization problem, exiting.
   while executing
"EnvHistory::Reset"
   (procedure "PropertiesInit" line 3)
   invoked from within
"PropertiesInit"
   invoked from within
"ncFyP12 -+"
   (file "/opt/questasim/linux_x86_64/../tcl/vsim/vsim" line 1)
** Fatal: Read failure in vlm process (0,0)

There are two solutions to solve this problem. The first involves downgrading the Package (probably via the Arch Linux Archive). If you are using the 32-bit version, it is sufficient to downgrade lib32-freetype2. The second and more elegant solution involves replacing the old freetype version for ModelSim only without withholding updates on the whole system (originally proposed at the now-dead link http://communities.mentor.com/mgcx/message/46770):

  • Copy the freetype library and symlinks somewhere in the altera folder, eg: $HOME/altera/xx.x/lib32/
libfreetype.so
libfreetype.so.6
libfreetype.so.6.10.2
  • Edit the ModelSim script in /opt/altera/15.1/modelsim_ae/bin/vsim and add near the top (after the #!/bin/sh)
export LD_LIBRARY_PATH=/home/user/altera/xx.x/lib32
Note: The quartus script will need to have write permissions added to it.

When ModelSim is launched directly from Quartus the error may persist. In this case, add the same line to quartus/bin/quartus_sh.

With ncurses 5.9

The upgrade from ncurses version 5.9-7 to 6.0-1 (and later) (September 2015[2]) causes the following error in ModelSim:

$ vsim
vish: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
[1]  + exit 127   vsim

There are two solutions to this problem. One is to use ncurses5-compat-libsAUR and tweak the PKGBUILD to compile a 32-bit version of the library. (Or use lib32-ncurses5-compat-libsAUR) This will provide the latest version of ncurses with an ncurses5-compatible ABI.

The other solution is to download the ncurses 5.9 source, compile it, and copy the generated libraries and symlinks to the same directory as the freetype2 libraries.

Compiling ncurses 5.9 may lead to problems using GCC 5.x. It is also possible to get a precompiled library, using the Arch Linux Archive. The package can be found at http://ala.seblu.net/packages/l/lib32-ncurses/.

Install libraries

Install library libxft and ncurses: libxft, ncurses, libxext.

For 64 bit edition, install these library from multilib repository: lib32-libxft, lib32-ncurses, lib32-libxext.

Application Menu Entry - ModelSim-Altera Edition

You can add Modelsim to your system application menu by creating a modelsim.desktop file in your ~/.local/share/applications directory

~/.local/share/applications/modelsim.desktop
[Desktop Entry]
Version=1.0
Name=ModelSim-Altera Edition
Comment=ModelSim simulation software for Altera FPGA's
Exec=/opt/altera/15.1/modelsim_ae/bin/vsim
Icon=/opt/altera/15.1/modelsim_ae/modesim.gif
Terminal=true
Type=Application
Categories=Development

Resolving the "ModelSim Failed to access library 'work'" error

The solution was originally documented here: http://jackeyblog.blogspot.com/2005/07/note-myself-modelsim-failed-to-access.html

If you receive the error:

Error: (vcom-19) Failed to access library 'work' at "work". 

when running a simulation in a new directory, you must create a new work directory. Execute the following in the ModelSim console:

ModelSim> vlib work