Welcome, guest ( Login )

WikiHome » OperatingSystems » µClinux » QuartusforLinux

QuartusforLinux

Version 25, changed by hippo5329@yahoo.com.tw. 04/27/2008.   Show version history


The latest Altera Design Software 7.2 is supported on the following Linux operating systems and versions:
  •    Red Hat Enterprise Linux 3 (32 bit & 64 bit)
  •    Red Hat Enterprise Linux 4 (32 bit & 64 bit)
  •    SUSE 9 Enterprise Linux
You can use CentOS 4.6 , which is free and binary compatible with RHEL4. It is recommended for Linux newbies.
You may find step by step guide on Linux installation and usage from Redhat's doc .

The version of Linux distro is important. Some latest distro use udev, and need extra hacking, see Instalation on unsupported distributions. Though it is possible to use other Linux disto or version, it might be difficult for newbies.

To install Altera Design Software 7.2 in Ubuntu Linux, follow this step by step tutorial : Altera Software Installation Tutorial for Ubuntu.pdf
This tutorial show how to install all the tools including setting up usbfs for USB blaster. It might also apply for other Linux distros based on Debian.

Make sure you have tcsh isntalled, otherwise install it, as root or via sudo
On Fedora,RHEL,
yum install tcsh
On Debian/Ubuntu, (via sudo)
apt-get install tcsh


After installed Linux PC, you can download and install all Altera design suits from Altera's website.

If you have a valid license file, add these to /etc/rc.local to start license manager.
echo 356 40000 32 32000 > /proc/sys/kernel/sem
/opt/altera7.2/quartus/linux/lmgrd -c /opt/licenses/license.dat

The license file should be /opt/licenses/license.dat, and begin with
SERVER localhost <your nic> 1800
VENDOR alterad "/opt/altera7.2/quartus/linux/alterad"
VENDOR mgcld "/opt/altera7.2/modelsim/modeltech/linuxaloem/mgls/lib/mgcld"

Make sure to install the programs in the following directories :
Quartus        = /opt/altera7.2/quartus
IP Megacore = /opt/altera7.2/ip
Nios II EDS   = /opt/altera7.2/nios2eds
Modelsim      = /opt/altera7.2/modelsim

(Ed., we don't need "7.2" numbered for each subdir when the parent dir already spelled it. while "nios2eds" and "ip" are more officially used by Altera.)



Easy way to setup environment

Login as a user. Open a terminal, just type <your_nios2_dir>/sdk_shell. eg,
/opt/altera7.2/nios2eds/sdk_shell
This will open a Bourne-again shell (bash) with a pre-configured environment.
(you may put this line in a script file , say "n2sdk", in ~/bin dir. remember "chmod +x n2sdk". then you can just spell "n2sdk")

When Quartus ask you the license file for the first run, enter "1800@localhost" .

You can find more usage of command line tools on section 2-4 of  Embedded Design Handbook (highly recommended reading).

You DON'T need to setup environment in profile manually as below



Manual way to setup environment


Login as a user, edit your ~/.bash_profile (In Debian based distros this is ~/.profile) and add these lines at the end of the file.



## Altera Quartus and Nios environment variables 7.2
LM_LICENSE_FILE=1800@localhost
QUARTUS_64BIT=0
SOPC_KIT_NIOS2=/opt/altera7.2/nios2eds
SOPC_BUILDER_PATH=/opt/altera7.2/nios2eds+$SOPC_BUILDER_PATH_72+$SOPC_BUILDER_PATH_61
QUARTUS_ROOTDIR=/opt/altera7.2/quartus
SOPC_BUILDER_PATH_72=SOPC_BUILDER_PATH_72=/opt/altera7.2/nios2eds+$SOPC_BUILDER_PATH_72
SOPC_BUILDER_PATH_61=/opt/altera7.2/nios2eds+/opt/altera7.2/ip/ddr_ddr2_sdram/lib/sopc_builder+/opt/altera7.2/ip/pci_compiler/lib/sopc_builder
PATH=$PATH:/opt/altera7.2/quartus/bin:/opt/altera7.2/nios2eds/bin:/opt/altera7.2/quartus/linux
PATH=$PATH:/opt/altera7.2/modelsim/linuxaloem:/opt/altera7.2/nios2eds/bin/nios2-gnutools/H-i686-pc-linux-gnu/bin:/opt/nios2/bin
LD_LIBRARY_PATH=/lib:/usr/lib:/opt/altera7.2/quartus/linux
unset GCC_EXEC_PREFIX
export LM_LICENSE_FILE QUARTUS_ROOTDIR SOPC_KIT_NIOS2 SOPC_BUILDER_PATH_72
export SOPC_BUILDER_PATH_61 PATH LD_LIBRARY_PATH SOPC_BUILDER_PATH QUARTUS_64BIT



If you want this paths and settings to be global, you can put them in /etc/profile. But you must be root. You will need to put them there if you want to use FlexLM at boot or make a shortcut icon at your desktop.

You can modify the entries based on your computer. If you have a 64-bit CPU, then set the QUARTUS_64BIT to 1. Set the LM_LICENSE_FILE to a appropriate value based on your floating server host and prot settings.

Then logout and login as user again, to update the environment, now you can try out Quartus and SOPC builder.

Next, you can install nios2gcc tools and uClinux-dist. Build the uClinux kernel image.




USB Blaster

To enable USB Blaster, you need to add the following lines to file /etc/hotplug/usb.usermap. This works for Red Hat based distros.
# Altera USB-Blaster
usbblaster 0x03 0x09fb 0x6001 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
usbblaster 0x03 0x09fb 0x6002 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
usbblaster 0x03 0x09fb 0x6003 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0


And then create the following script as /etc/hotplug/usb/usbblaster ,
#!/bin/sh
# USB-Blaster hotplug script. Allow any user to access the cable
chmod 666 $DEVICE

Don't forget to make the script executable. "chmod +x /etc/hotplug/usb/usbblaster"

To get the USB blaster working in certain distros like Ubuntu, all you need to do is mount USB filesystem. Do this by adding this line at the end of /etc/fstab :
   usbfs /proc/bus/usb usbfs devmode=0666 0 0

Then restart your PC or remount by typing : sudo mount -a

Next, create an empty file in your home directory named “.jtag.conf ”. Then plug in your USB Blaster, connect to your dev board (2C35 here), and check from a regular Linux shell Terminal (NOT the Nios II command shell in SOPC builder),

$ jtagconfig
1) USB-Blaster [USB 5-1.2]
  020B40DD   EP2C35
$ nios2-configure-sof /opt/altera7.2/nios2eds/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof
Info: *******************************************************************
Info: Running Quartus II Programmer
Info: Command: quartus_pgm --no_banner --mode=jtag -o p;/opt/altera7.2/nios2eds/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof
Info: Using programming cable "USB-Blaster [USB 5-1.2]"
Info: Started Programmer operation at Fri Dec  8 11:35:01 2006
Info: Configuring device index 1
Info: Device 1 contains JTAG ID code 0x020B40DD
Info: Configuration succeeded -- 1 device(s) configured
Info: Successfully performed operation(s)
Info: Ended Programmer operation at Fri Dec  8 11:35:04 2006
Info: Quartus II Programmer was successful. 0 errors, 0 warnings
    Info: Processing ended: Fri Dec  8 11:35:04 2006
    Info: Elapsed time: 00:00:22
$ nios2-download -g ~/uClinux-dist/images/zImage
Using cable "USB-Blaster [USB 5-1.2]", device 1, instance 0x00
Pausing target processor: OK
Initializing CPU cache (if present)
OK
Downloaded 1016KB in 16.2s (62.7KB/s)
Verified OK
Starting processor at address 0x04500000
$ nios2-terminal
nios2-terminal: connected to hardware target using JTAG UART on cable
nios2-terminal: "USB-Blaster [USB 5-1.2]", device 1, instance 0
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)
Uncompressing Linux... Ok, booting the kernel.
Linux version 2.6.Uncompressing Linux... Ok, booting the kernel.
Linux version 2.6.17-uc1 (hippo@darkstar) (gcc version 3.4.6) #46 PREEMPT Thu Dec 7 15:22:06 CST 2006

You can try out flash programmer, or add flash file conversion to your build script. Or run GDB debugger.
Happy hacking.


Miscelaneus Fixes

  1. If the Nios II EDS installer does not work, edit the install script at line 143 :
         From : x=\${x/~/$HOME}
         To     : ##x=\${x/~/$HOME}

  2. If the modelsim installer doesnt work, edit the install.ms script :
    At line 172 :
        From    : tar xfo {$script_path}/modeltech_altera_unix.tar
        To        : tar xfo {$script_path}/modeltech_altera_unix.tar --no-same-permissions
    At line 174 :
        From    : tar xfo {$script_path}/modeltech_altera_unix.tar $file1.Z $file2.Z $file3.Z
        To        : tar xfo {$script_path}/modeltech_altera_unix.tar $file1.Z $file2.Z $file3.Z --no-same-permissions

  3. If the SOPC builder keeps giving language error (minor problem). This is an issue with Perl. To fix it, type this in a terminal :
           cd /usr/lib/locale
           cp -r en_US.utf8 en_US


  4. To fix the “Unknown Linux Processor” issue, download the file 'arch' and put it in /bin. You will need administrator access to do this.

  5. Sometimes the Licences in Quartus menu will not open. This can be solved by copying the provided file 'libX11.so.6.2' into/opt/altera7.2/quartus/linux. You will need administrator privileges. Then type this in a terminal:
         cd /opt/altera7.2/quartus/linux
         sudo ln -s libX11.so.6.2 libX11.so.6

Comments (1)

jychen150 said, 02/06/2008:

I was able to install Altera Quartus7.2 for Linux into Gentoo Linux. Before installing, do the following (as root):
1. Install tcsh by


2. Create emulation command for "arch" by creating file /bin/arch, containing the following:
==== Begin Cut Here ===

uname -m
==== End Cut Here ====
chmod a=rx /bin/arch


Before using the commands such as "nios2-config-sof", "nios2-download", do the following as a work around to change USB port permission (as root):
chmod -R 777 /proc/bus/usb

Then start using the Altera tools with a regular user login.

Attachments (3)

  File By Size Attached Ver.
 Altera Software Installation Tutorial for Ubuntu.pdf vishnu350 137K 02/22/2008 2 Delete attachment
 arch vishnu350 21B 02/22/2008 1 Delete attachment
 libX11.so.6.2 vishnu350 759K 02/22/2008 1 Delete attachment