Difference between revisions of "Altera Design Software"

From ArchWiki
Jump to: navigation, search
Line 1: Line 1:
 
[[Category:Development]]
 
[[Category:Development]]
[[Category: Mathematics and science (English)]]
+
[[Category:Mathematics and science]]
 
{{i18n|Altera Design Software}}
 
{{i18n|Altera Design Software}}
  

Revision as of 17:25, 23 April 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

This tutorial shows how to install the following softwares form the Altera Design Software

  • Quartus II (Web edition and Subscription Edition)
  • USB-Blaster Driver

Quartus II

The following procedure shows how to install the 10.1 sp1 version of Quartus II

Installation

Quartus II is downloadable at: https://www.altera.com/download/software/quartus-ii-se Downloading Altera softwares requires registration. Once this is done, proceed with the download. There are three files to get

  • Quartus II 10.1 base software
  • Quartus II devices
  • Quartus II 10.1 service pack 1

Make sure you get the GNU/Linux version!

Once you have downloaded the files, you can proceed with the installation

$ cd <Download-folder>
$ sudo sh ./10.1_quartus_linux.sh

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 /opt/altera folder.

After the base software is installed, you should install devices related files and upgrade to the service pack 1.

$ sudo sh ./10.1_quartus_devices.sh
$ sudo sh ./10.1_quartus_linux.sh

Libpng12

Quartus II requires libpng12 to work, which can be found in AUR.

$ wget https://aur.archlinux.org/packages/libpng12/libpng12.tar.gz
$ tar -xaf libpng12.tar.gz
$ cd libpng12
$ makepkg -i PKGBUILD

Trying to launch the software right now on a 64 bits system won't work. Quartus will complain that libpng12 does not have the right ELF class. This is because Quartus is launched in 32 bits mode by default. We need to add an environment variable to switch to 64 bits mode. Please, refer to the next section regarding this matter.

Integrating Quartus II with the system

Let's now add the Quartus bin folder to the PATH variable as well as select if we want to run it in 64 bits mode. Create a quartus.sh file in the /etc/profile.d directory

/etc/profile.d/quartus.sh
export PATH=$PATH:/opt/altera/10.1/quartus/bin
if [ "`uname -m`" = "x86_64" ]; then
  export QUARTUS_64BIT=1
fi

Other environment variables related to Quartus can be found in the official installation manual http://www.altera.com/literature/manual/quartus_install.pdf

And now you can try launching launching Quartus II

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

If this works, do not forget to logout/login for the change to have effect.

USB-Blaster Driver

The USB-Blaster is a cable that allows you to download configuration data from you computer to you FPGA, CPLD or EEPROM configuration device. However Altera only provides support for RedHat Entreprise, SUSE Entreprise and Cent OS and we are required to do a little bit of work to make it work with Archlinux. If you want some more detail about this cable, please refer to http://www.altera.com/literature/ug/ug_usb_blstr.pdf

The JTAG server of Quartus II is responsible for communications using the USB-Blaster cable. The JTAG server (/opt/altera/10.1/quartus/linux/jtagd and /opt/altera/10.1/quartus/linux64/jtagd) is searching for devices in /proc/bus/usb/<bus_num>/<dev_num> and in the file /proc/bus/usb/devices. Using Archlinux, the former is located in /etc and not /proc and the latter does not exist unless usbfs is mounted.

Since the search paths are hardcoded in the JTAG server, we need to patch it to make him search for devices in /dev/bus/usb/<bus_num>/<dev_num> instead of /proc/bus/usb/<bus_num>/<dev_num>.

For 32 bits systems:

$ sudo sed -i.bak 's/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\d0/g' /opt/altera/10.1/quartus/linux/jtagd 

For 64 bits systems:

$ sudo sed -i.bak 's/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\d0/g' /opt/altera/10.1/quartus/linux64/jtagd #For 64 bits systems

Side by the patched JTAG server, a backup of the original one is created in jtagd.bak.

Now we need to add one rule in the /etc/fstab file:

/etc/fstab
...
usbfs /proc/bus/usb usbfs defaults 0 0
...

Then 'reload' that file using

$ sudo mount -a

and now you should have a /proc/bus/usb/devices file

$ ls -l /proc/bus/usb/devices
i-r--r--r-- 1 root root 0 Feb 10 19:05 /proc/bus/usb/devices

Now to check that the JTAG server has been properly patched and that everything is working, plug your FPGA or CPLD board using your USB-Blaster cable and run

$ sudo /opt/altera/10.1/quartus/bin/jtagconfig

You should have an output similar to this one

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

In this example I have a board using a serial EEPROM to retain the FPGA configuration.

There is still one last thing to do: give write access to casual users, not only the root. We can add a simple udev rule.

/etc/udev/rules.d/60-usbblaster.rules
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"

Let's now make a final check by relaunching jtagconfig after having reloaded the udev rules.

$ sudo udevadm control --reload-rules
$ jtagconfig

Altera Quartus v11.1

The above does not seem to work successfully for version 11 of Quartus. Whether it is the new version, Gnome 3, or Kernel 3 I do not know.

It can be run in 32-bit with Multilib however.

Installation works as previously. However enable multilib and install lib32-libpng12 rather than libpng12, and do not set the QUARTUS_64BIT=1 as described above.

Quartus now appears to run fine.

There is no need to modify the jtagd binary with Quartus 11.1, it works fine without any modification.

If your system is 64bit rename the linux64 directory in altera/<ver>/quartus/ to linux64.bak then make a link to the linux folder in the same directory and call it linux64. This should allow JTAG to run.

Workarounds for Quartus II

Qsys can't import custom components

This bug should be fixed in version 11.1 of Quartus II. There is a problem in Quartus II when parsing the /etc/issue file for reading the distribution name (more information on the chinese version of ArchWiki, your preferred online tranlator is your friend here ;-)). The problem can be circumvented by removing the special characters from the file.

  • Create a backup of
 # mv /etc/issue /etc/issue.old
  • execute the following command
 # echo "Arch Linux  \r  (\n) (\l)" > /etc/issue