Difference between revisions of "Altera Design Software"

From ArchWiki
Jump to: navigation, search
(Flag out of date.)
(22 intermediate revisions by 14 users not shown)
Line 1: Line 1:
[[Category: Development (English)]]
+
[[Category:Development]]
 
+
[[Category:Mathematics and science]]
== Introduction ==       
+
[[zh-CN:Altera Design Software]]
 
This tutorial shows how to install the following softwares form the Altera ''Design Software''
 
This tutorial shows how to install the following softwares form the Altera ''Design Software''
* Quartus II (''Web edition'' and ''Subscription Edition'')
+
* Quartus II (''Web edition'')
 
* USB-Blaster Driver
 
* USB-Blaster Driver
 
+
* ModelSim (''starter edition'')
 +
{{Out of date|Only version 12.1 is provided in the download page. Need to update to the latest version.}}
 
== Quartus II ==
 
== Quartus II ==
The following procedure shows how to install the '''10.1 sp1''' version of Quartus II
+
The following procedure shows how to install the '''10.2 sp2''' version of Quartus II
  
 
=== Installation ===
 
=== 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
+
Quartus II is downloadable at: https://www.altera.com/download/software/quartus-ii-we
 +
Downloading Altera softwares requires registration. Once this is done, proceed with the download. Download the file ''12.0sp2_quartus_free_linux.tar.gz''.
  
 +
Once you have downloaded the file, unzip it. Now you can proceed with the installation
 
  $ cd <Download-folder>
 
  $ cd <Download-folder>
  $ sudo sh ./10.1_quartus_linux.sh
+
  $ sudo ./altera_installer/bin/altera_installer_gui --gui
  
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 {{Filename|/opt/altera}} folder.   
+
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.   
  
After the base software is installed, you should install devices related files and upgrade to the service pack 1.
+
Now you need to install manually the 64 bit edition
 
+
  $ cd <Download-folder>
  $ sudo sh ./10.1_quartus_devices.sh
+
  $ sudo linux_installer/quartus_free_64bit/install
  $ sudo sh ./10.1_quartus_linux.sh
+
type your install folder path (/opt/altera)
 +
choose "n" for not deleting the 32bit install
  
 
=== Libpng12 ===
 
=== Libpng12 ===
Quartus II requires libpng12 to work, which can be found in AUR.
+
Quartus II requires libpng12 to work and can be found on aur.
 
+
$ wget http://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 ===
 
=== Integrating Quartus II with the system ===
Let's now add the Quartus bin folder to the {{Codeline|PATH}} variable as well as select if we want to run it in 64 bits mode. Create a {{Filename|quartus.sh}} file in the {{Filename|/etc/profile.d}} directory
+
Let's now add the Quartus bin folder to the {{ic|PATH}} variable as well as select if we want to run it in 64 bits mode. Create a {{ic|quartus.sh}} file in the {{ic|/etc/profile.d}} directory
  
{{File
+
{{hc|/etc/profile.d/quartus.sh
|name=/etc/profile.d/quartus.sh
+
|2=<nowiki>
|content=<nowiki>
+
export PATH=$PATH:/opt/altera/quartus/bin
export PATH=$PATH:/opt/altera/10.1/quartus/bin
+
if [ "`uname -m`" = "x86_64" ]; then
+
  export QUARTUS_64BIT=1
+
fi
+
 
</nowiki>}}
 
</nowiki>}}
  
Line 58: Line 45:
 
  $ quartus
 
  $ quartus
  
If this works, don't forget to logout/login for the change to have effect.  
+
You can add Quartus II to your system application menu by creating a {{ic|quartus.desktop}} file in your {{ic|~/.local/share/applications}} directory
 +
 
 +
{{hc|~/.local/share/applications/quartus.desktop
 +
|2=<nowiki>
 +
[Desktop Entry]
 +
Version=1.0
 +
Name=Quartus II
 +
Comment=Quartus II design software for Altera FPGA's
 +
Exec=/opt/altera/quartus/bin/quartus
 +
Icon=/opt/altera/quartus/adm/quartusii.png
 +
Terminal=false
 +
Type=Application
 +
Categories=Development
 +
</nowiki>}}
  
 
=== USB-Blaster Driver ===  
 
=== 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 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 ({{Filename|/opt/altera/10.1/quartus/linux/jtagd}} and {{Filename|/opt/altera/10.1/quartus/linux64/jtagd}}) is searching for devices in {{Filename|/proc/bus/usb/<bus_num>/<dev_num>}} and in the file {{Filename|/proc/bus/usb/devices}}. Using Archlinux, the former is located in {{Filename|/etc}} and not {{Filename|/proc}} and the latter does not exist unless {{Codeline|usbfs}} is mounted.
+
Create a new file :
 +
{{hc|/etc/udev/rules.d/51-usbblaster.rules
 +
|<nowiki>
 +
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"
 +
</nowiki>}}
  
Since the search paths are hardcoded in the JTAG server, we need to patch it to make him search for devices in {{Filename|/dev/bus/usb/<bus_num>/<dev_num>}} instead of {{Filename|/proc/bus/usb/<bus_num>/<dev_num>}}.
+
Then 'reload' that file using
  
For 32 bits systems:
+
$ sudo udevadm control --reload-rules
  
$ sudo sed -i.bak 's/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\d0/g' /opt/altera/10.1/quartus/linux/jtagd
+
Now to check that everything is working, plug your FPGA or CPLD board using your USB-Blaster cable and run
  
For 64 bits systems:
+
$ sudo /opt/altera/quartus/bin/jtagconfig
  
$ 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
+
You should have an output similar to this one
  
Side by the patched JTAG server, a backup of the original one is created in {{Filename|jtagd.bak}}.
+
1) USB-Blaster [USB 1-1.1]
 +
  020B30DD  EP2C15/20
  
Now we need to add one rule in the {{Filename|/etc/fstab}} file:
+
If there seems to be an error message about linux64, create a symlink from linux to linux64 in /opt/altera/quartus
{{File
+
|name=/etc/fstab
+
|content=<nowiki>
+
...
+
usbfs /proc/bus/usb usbfs defaults 0 0
+
...
+
</nowiki>}}
+
Then 'reload' that file using
+
  
  $ sudo mount -a
+
  # ln -s linux linux64
  
and now you should have a {{Filename|/proc/bus/usb/devices}} file
+
==Model Sim==
 +
===Install===
 +
ModelSim is downloadable at: https://www.altera.com/download/software/modelsim-starter/12.0
  
$ ls -l /proc/bus/usb/devices
+
You need to download these 3 files :
i-r--r--r-- 1 root root 0 Feb 10 19:05 /proc/bus/usb/devices
+
* 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)
  
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
+
Unzip 12.0_modelsim_ase_linux.tar.gz
 +
 +
$ cd <Download-folder>
 +
$ sudo ./setup
  
$ sudo /opt/altera/10.1/quartus/bin/jtagconfig
+
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
  
You should have an output similar to this one
+
Repeat this procedure for the sp1 file then the sp2.
  
1) USB-Blaster [USB 1-1.1]
+
===Compatibility with Archlinux===
  020B30DD  EP2C15/20
+
====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 :
  
In this example I have a board using a serial EEPROM to retain the FPGA configuration.
+
change
 
+
{{hc|/opt/altera/modelsim_ase/bin/vsim line 204
There is still one last thing to do: give write access to casual users, not only the root.
+
|<nowiki>
We can add a simple {{Codeline|udev}} rule.
+
*)                vco="linux_rh60" ;;
{{File
+
</nowiki>}}
|name=/etc/udev/rules.d/60-usbblaster.rules
+
to
|content=<nowiki>
+
{{hc|/opt/altera/modelsim_ase/bin/vsim line 204
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
+
|<nowiki>
 +
*)                vco="linux" ;;
 
</nowiki>}}
 
</nowiki>}}
  
Let's now make a final check by relaunching {{Filename|jtagconfig}} after having reloaded the udev rules.
+
====Install libraries====
 +
Install library ''libxft'' and ''ncurses''.
 +
$ sudo pacman -S libxft ncurses libxext
  
  $ sudo udevadm control --reload-rules
+
For 64 bit edition, install these library from multilib repository
$ jtagconfig
+
  $ sudo pacman -S lib32-libxft lib32-ncurses lib32-libxext (from multilib repo)
 +
 
 +
=== Add icon to the system ===
 +
 
 +
You can add Modelsim to your system application menu by creating a {{ic|modelsim.desktop}} file in your {{ic|~/.local/share/applications}} directory
 +
 
 +
{{hc|~/.local/share/applications/modelsim.desktop
 +
|2=<nowiki>
 +
[Desktop Entry]
 +
Version=1.0
 +
Name=ModelSim
 +
Comment=ModelSim simulation software for Altera FPGA's
 +
Exec=/opt/altera/modelsim_ase/bin/vsim
 +
Icon=/opt/altera/modelsim_ase/modesim.gif
 +
Terminal=true
 +
Type=Application
 +
Categories=Development
 +
</nowiki>}}

Revision as of 12:16, 19 December 2012

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

  • Quartus II (Web edition)
  • USB-Blaster Driver
  • ModelSim (starter edition)

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: Only version 12.1 is provided in the download page. Need to update to the latest version. (Discuss in Talk:Altera Design Software#)

Quartus II

The following procedure shows how to install the 10.2 sp2 version of Quartus II

Installation

Quartus II is downloadable at: https://www.altera.com/download/software/quartus-ii-we Downloading Altera softwares requires registration. Once this is done, proceed with the download. Download the file 12.0sp2_quartus_free_linux.tar.gz.

Once you have downloaded the file, unzip it. Now you can proceed with the installation

$ cd <Download-folder>
$ sudo ./altera_installer/bin/altera_installer_gui --gui

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. Don't forget to select the file for the source of install if you don't want to download again quartus.

Now you need to install manually the 64 bit edition

$ cd <Download-folder>
$ sudo linux_installer/quartus_free_64bit/install

type your install folder path (/opt/altera) choose "n" for not deleting the 32bit install

Libpng12

Quartus II requires libpng12 to work and can be found on aur.

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/quartus/bin

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

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

~/.local/share/applications/quartus.desktop
[Desktop Entry]
Version=1.0
Name=Quartus II
Comment=Quartus II design software for Altera FPGA's
Exec=/opt/altera/quartus/bin/quartus
Icon=/opt/altera/quartus/adm/quartusii.png
Terminal=false
Type=Application
Categories=Development

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

Create a new file :

/etc/udev/rules.d/51-usbblaster.rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

Then 'reload' that file using

$ sudo udevadm control --reload-rules

Now to check that everything is working, plug your FPGA or CPLD board using your USB-Blaster cable and run

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

You should have an output similar to this one

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

If there seems to be an error message about linux64, create a symlink from linux to linux64 in /opt/altera/quartus

# ln -s linux linux64

Model Sim

Install

ModelSim is downloadable at: https://www.altera.com/download/software/modelsim-starter/12.0

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

$ 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 /opt/altera folder. Don't forget to select the file for the source of install if you don't want to download again quartus.

Repeat this procedure for the sp1 file then the sp2.

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

/opt/altera/modelsim_ase/bin/vsim line 204
 *)                vco="linux_rh60" ;;

to

/opt/altera/modelsim_ase/bin/vsim line 204
 *)                vco="linux" ;;

Install libraries

Install library libxft and ncurses.

$ sudo pacman -S libxft ncurses libxext

For 64 bit edition, install these library from multilib repository

$ sudo pacman -S lib32-libxft lib32-ncurses lib32-libxext (from multilib repo)

Add icon to the system

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
Comment=ModelSim simulation software for Altera FPGA's
Exec=/opt/altera/modelsim_ase/bin/vsim
Icon=/opt/altera/modelsim_ase/modesim.gif
Terminal=true
Type=Application
Categories=Development