Installing the Altera Design Suite on Linux

From Crashcourse Wiki

Jump to: navigation, search

This page is merely a shortened version of what you can read [here], so if anything untoward happens while following the directions on this page, by all means, go to the Nios wiki page for more detail. In what follows, I'll assume you don't have a Quartus license; if you do, again, visit the Nios wiki page for more details.

Contents

The prerequisites

  • A working C shell (almost certainly tcsh)
  • A working USB filesystem

You can verify that you have a USB filesystem on your Linux system by running:

$ cat /proc/mounts
...
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0   [or something similar]
...

Personally, I'd be surprised if any modern Linux distro didn't have this already running, but I'm willing to be corrected.

NOTE: You might very well not see an entry for this mount point in /etc/fstab, or in the output of the mount command; the proper way to check this is to examine the contents of /proc/mounts.

Getting the tarballs

Rather than using the Design Suite software that comes with your NEEK, you should download the latest versions of the design suite components:

Note well the size of these tarballs and make sure you have enough space for the downloads and the subsequent installation (the installed software will use up about 7.5G).

The installation

Once all the tarballs have been downloaded into the same directory, unload the installer tarball, decide where you want to install the (7.5G worth of) design suite software, and simply run:

$ ./install_download

NOTE: Depending on where you want to install the design suite, you may or may not need root privilege. Personally, I prefer to avoid needing to be superuser, so I have a tendency to install software under my home directory. In what follows, I chose the location of /home/rpjday/altera/ (or just ~/altera/ in my case), and the installation worked just fine on my Fedora 8 system:

$ ls -l ~/altera
total 56
-rw-rw-r--  1 rpjday rpjday 11271 2008-06-21 05:06 download_install_8.0_log.txt
-rw-rw-r--  1 rpjday rpjday  3762 2008-06-21 05:02 install_8.0_log.txt
drwxrwxr-x 46 rpjday rpjday  4096 2008-06-21 05:02 ip
drwxrwxr-x  2 rpjday rpjday  4096 2008-06-21 05:06 modelsim_ae
drwxrwxr-x  7 rpjday rpjday  4096 2008-06-21 05:05 nios2eds
drwxrwxr-x 15 rpjday rpjday  4096 2008-06-21 05:02 quartus

As far as I know, there is nothing that requires the software to be installed as root but, again, I'm willing to be corrected.

Configuring the appropriate system files

At this point, there are a couple system files you need to prepare (which will require root privilege). First:

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

Also, you should arrange for the JTAG daemon to be started at boot time by adding the following lines to your distro's version of /etc/rc.local:

echo 356 40000 32 32000 > /proc/sys/kernel/sem
/home/rpjday/altera/quartus/bin/jtagd

You can either reboot or, for now, just run those two commands manually as root.

Running the design suite

For convenience (and to make sure the proper Quartus-related environment variables are set), you should create a short script with which to start the Design Suite SDK. Create the one-line script ~/bin/n2sdk with contents (in my case):

QUARTUS_ROOTDIR=~/altera/quartus ~/altera/nios2eds/sdk_shell

then make it executable with:

$ chmod +x ~/bin/n2sdk

Lastly, create an empty JTAG configuration file in your home directory with:

$ touch ~/.jtag.conf

Even though this file is initially empty, you do need it to exist to run the SDK. Finally, see what happens:

$ n2sdk
------------------------------------------------
Welcome To Altera SOPC Builder

Version 8.0, Built Tue May 27 22:59:48 PDT 2008
------------------------------------------------
... etc etc ...
[NiosII EDS]$

Looks good. And you can just type exit to terminate the SDK.

Testing the JTAG connection

At the very least, you should now verify that you have access to the NEEK's JTAG functionality. Simply plug in the NEEK-supplied USB cable and:

$ lsusb
Bus 001 Device 010: ID 067b:2506 Prolific Technology, Inc. 
Bus 001 Device 001: ID 1d6b:0002  
Bus 004 Device 001: ID 1d6b:0001  
Bus 005 Device 001: ID 1d6b:0001  
Bus 003 Device 010: ID 09fb:6001 Altera     <--- OK, that looks good.
Bus 003 Device 002: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse
Bus 003 Device 001: ID 1d6b:0001  
Bus 002 Device 002: ID 413c:2005 Dell Computer Corp. RT7D50 Keyboard
Bus 002 Device 001: ID 1d6b:0001  

If you don't see a new entry corresponding to your NEEK system, you have some troubleshooting to do. If things look good, you can verify the JTAG connection to your NEEK from within the SDK shell as well:

[NiosII EDS]$ jtagconfig
1) USB-Blaster [USB 3-1.1]
  020F30DD   EP3C25           <-- should see something like that

/etc/jtagd
[NiosII EDS]$ 

Running the web server example

Now that everything's configured, you can try to run the web server example described [here].

[NiosII EDS]$ nios2-configure-sof ~/neek/dl/tryout/web_server/cycloneIII_embedded_evaluation_kit_web_server.sof

Info: *******************************************************************
Info: Running Quartus II Programmer
Info: Command: quartus_pgm --no_banner --mode=jtag -o p;/home/rpjday/neek/dl/tryout/web_server/cycloneIII_embedded_evaluation_kit_web_server.sof
Info: Using programming cable "USB-Blaster [USB 3-1.1]"
Info: Started Programmer operation at Sat Jun 21 10:00:47 2008
Info: Configuring device index 1
Info: Device 1 contains JTAG ID code 0x020F30DD
Info: Configuration succeeded -- 1 device(s) configured
Info: Successfully performed operation(s)
Info: Ended Programmer operation at Sat Jun 21 10:00:48 2008
Info: Quartus II Programmer was successful. 0 errors, 0 warnings
    Info: Processing ended: Sat Jun 21 10:00:48 2008
    Info: Elapsed time: 00:00:02
    Info: Total CPU time (on all processors): 00:00:01
/etc/jtagd
[NiosII EDS]$ 

Then download the corresponding kernel image:

[NiosII EDS]$ nios2-download -g ~/neek/dl/tryout/zImage_cycloneIII_embedded_evaluation_kit_web_server 
Using cable "USB-Blaster [USB 3-1.1]", device 1, instance 0x00
Pausing target processor: OK
Initializing CPU cache (if present)
OK
Downloaded 1206KB in 10.5s (114.8KB/s)
Verified OK                         
Starting processor at address 0x00500000
/etc/jtagd
[NiosII EDS]$ 

And finally:

$ nios2-terminal
nios2-terminal: connected to hardware target using JTAG UART on cable
nios2-terminal: "USB-Blaster [USB 3-1.1]", device 1, instance 0
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)

 InitialUncompressing Linux... Ok, booting the kernel...
... etc etc ...
/>    <-- now at the shell prompt


Return to the main NEEK page.

Personal tools