|
Needs Expansion |
|
Unsupported Version |
|
Introduction
This document provides information on installation and setup of Quartus II v8.1 under Ubuntu 8.04 (Hardy Heron). At the end of this how-to you should be able to use Quartus II IDE both to design digital circuits and to load them in Altera devices using the following configuration:
Windows guest on a Ubuntu 8.04 (Hardy Heron) host using virtualization via VirtualBox
Quartus II v8.1 running on Windows guest
- Altera device connected to host computer
Although it is possible that the following instructions work under a different version of Ubuntu, it is very important to use the indicated version of Quartus II software, as it has been reported that previous releases have some problems during installation on Linux flavors that are different from the ones officially supported (Red Hat Linux Enterprise 4/5 (32/64 bit), SUSE Linux Enterprise 9 (32/64-bit) and CentOS 4/5 (32/64 bit)).
About Quartus II
At the time of writing this document, Altera provides Quartus II software in two different versions:
- Quartus II Web Edition - Free version available only for Windows
- Quartus II Subscription Edition - Free 30 day trial. After that period, subscription license is required. Available for Windows and Linux
Although Quartus II Subscription Edition needs a license in order to work, several command line tools that are provided as part of the installation can be used without the need of it. Two important commands of these tools that we will use are jtagd and jtagconfig.
jtagd communicates with and loads compiled designs into Altera devices using JTAG standard in two different connection modes:
Local mode - The Altera device is fisically connected to the computer in which jtagd is running
- Remote mode - The Altera device is fisically connected to a remote computer that acts as a server. Quartus II software running on the local computer communicates with the remote Altera device via the remote server
jtagconfig allows us to register and configure connection cables and Altera devices, and setup jtagd to act as a JTAG server
Setting up configuration
The following is a big picture of the steps that will be explained in the following sections:
- Install Quartus II Web Edition in the guest system to be able to create, compile and load designs into Altera devices
Set up a JTAG server on host computer
Install Quartus II Subscription Edition in the host machine to be able to use jtagd and jtagconfig
Use jtagd and jtagconfig to setup a JTAG server
Communicate the Quartus II Web Edition installed in the guest system with the JTAG server running on the host via virtual networking
- Test configuration by loading a compiled design into Altera device
Setting up Quartus II Web Edition 8.1 in the Windows guest
Install VirtualBox (either normal or OSE version) on the host computer.
Create a new virtual machine and install WindowsXP or Windows Vista on it (only this versions of Windows are supported by Quartus II software)
Download Quartus II Web Edition Software v8.1 from Altera's site
- Install Quartus II Web Edition Software v8.1 in previously created Windows guest. No license file is required in this version of Quartus II software
You should now be able to run Quartus II on your Windows guest:
Setting up the JTAG server
Setup environment for Quartus II installation script
Remove csh and install tcsh on the host system
sudo apt-get remove csh tcsh sudo apt-get install tcsh
Make sure that /bin/sh is pointing to bash.
ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-11-06 11:53 /bin/sh -> bash
If it is not pointing to bash, delete existing link and create a new one
sudo rm /bin/sh sudo ln -s bash /bin/sh
Install Quartus II Subscription Edition
Download Quartus II Subscription Edition Software v8.1 for Linux from Altera's site
Untar 81_quartus_linux.tar in the the host computer, in a directory of your choice
- Go to the directory where you untared the software and execute the installation script
./install
Follow the instructions to complete the default installation. If you decide to do a custom installation, read readme.txt or the installation script help
./install --help
If you are using USB Blaster to connect the Altera device to the host computer, you will need to enable usbfs, which is disabled by default on Ubuntu 8.04 (Hardy Heron). Follow this instructions to do so. If you want to enable USB access to your VirtualBox installation (currently not available for OSE version) follow the instructions as is. Otherwise, change the group vboxusers for a group you'd like to provide the access to usbfs.
Test your installation
Connect and turn on the Altera device to the host computer. Follow the instructions according to the connection cable you are using:
USB Blaster - USB cable connection is automatically detected when connected to the host computer, so executing jtagconfig should list the available Altera devices currently connected
$ALTERA_HOME/quartus/bin/jtagconfig
1) USB-Blaster [USB 3-1.2] 020B40DD
- LPT cable - (instructions for LPT1 cable missing)
You should now be able to execute jtagd and jtagconfig, that should be found in $ALTERA_HOME/quartus/bin. You will also be able to execute Quartus II IDE with free 30 day trial. In this version, binary compilation and design loading into Altera devices are disabled.
$ALTERA_HOME/quartus/bin/quartus
Create a service for jtagd
jtagd should be run as a service to be able to work as a JTAG server. The correct way to do this is installing jtagd in the system run levels mechanism:
Download jtagd init script from here
Place the script in /etc/init.d/ directory
Create /etc/rcn.d symbolic links
sudo update-rc.d jtagd defaults
The defaults option will create links to start service in 2, 3, 4 and 5 run levels and links to stop service in 0, 1 and 6 run levels
Create /etc/jtagd directory
Create an empty file called /etc/jtagd/jtagd.conf (needed to store jtagd configuration, which is managed by jtagconfig)
- Create the following symbolic link
sudo ln -s $ALTERA_HOME/quartus/linux/pgm_parts.txt /etc/jtagd/
Start jtagd service
sudo invoke-rc.d jtagd
If everything is going ok you'll be able to connect successfully with your Altera device as before
Configure jtagd service to act as a JTAG server. A password is required for the server. This password should be used by JTAG clients that want to connect to this server.
sudo $ALTERA_HOME/quartus/bin/jtagconfig --enableremote <password>
If your setup was successful, you should have a jtagd process listening in port 1309
sudo lsof -i :1309
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME jtagd 5568 root 4u IPv4 14518 TCP *:1309 (LISTEN)
Create a virtual network between guest and host systems
In this section we will create a simple virtual network between guest virtual machine and host computer using VirtualBox's HIC Networking. In order to keep this how-to as simple as possible, the network will just allow communication between guest, host and other computers connected to the same network. No bridge configuration will be covered here.
If you would like to setup a different type of virtual network, please refeer to VirtualBox networking howto. Just make sure that the configuration you choose allows communication between guest and host systems (you should be able to ping the guest from the host and viceversa).
In order to create the virtual network, we will provide two scripts to VirtualBox: onen will create and setup a temporal virtual network interface (so-called TAP interface), and the other one will shutdown and remove the created interface from the host system.
The following hipothetic settings will be used to setup the virtual network configuration:
- Host computer
- Network id: 192.168.1.0/24
- Network DHCP range: 192.168.1.2-100
- Network default gateway: 192.168.1.1
User running VirtualBox: vboxuser
- Guest Computer
- IP: 192.168.1.200 (static ip outside DHCP range to avoid conflicts)
- DNS server: Any DNS server
- Network default gateway: 192.168.1.1 (same value that host computer)
Setting up VirtualBox HIC Network
- Create the virtual interface setup script.
# Create a new TAP interface for the user 'vboxuser' and remember its name. interface=`VBoxTunctl -b -u vboxuser` # If for some reason the interface could not be created, return 1 to # tell this to VirtualBox. if [ -z "$interface" ]; then exit 1 fi # Write the name of the interface to the standard output. echo $interface # Bring up the interface. /sbin/ip link set "$interface" up # Add information to kernel routing tables. ip route add 192.168.1.200/32 dev "$interface"
The script shown above creates and sets up a temporal TAP interface in the host system. It also adds routing information that allows the kernel to identify the created interface (using the IP 192.168.1.200). Save it in a location of your choice and make it executable.
- Create the virtual interface deletion script
# Bring down the interface. The second script parameter is # the interface name. /sbin/ip link set "$2" down # Remove information from kernel routing tables. ip route del 192.168.1.200/32 dev "$2" # And use VBoxTunctl to remove the interface. VBoxTunctl -d $2
The script shown above tears down and removes the temporal TAP interface created by the script shown in the previous step. It also removes the routing information assigned to that interface. Save the script in a location of your choice and make it executable.
Configure HCI networking in VirtualBox using the start up and teardown scripts
On VirtualBox's main screen, select the Windows guest virtual machine
Go to Machine->Settings->Network
- Select a the network adapter of your choice and enable networking on that adapter by clicking on the "Enable network Adapter" checkbox
- In the "Attached to" combo, select the "Host Interface" option
In the "Host Interface Settings" section, insert gksudo full_path_to_creation_script/creation_script_name.sh in the Setup Application text field and gksudo full_path_to_deletion_script/deletion_script_name.sh in the Terminate Application text field
- Press OK button
- Start Windows guest virtual machine
- Configure the network interface from windows to use 192.168.1.200 as static ip and 192.168.1.1 as default gateway
You should now be able to ping the host machine from the windows guest and viceversa
Test configuration
Start jtagd if is not already running in the host
- Turn on and connect an Altera device to the host computer
- Start Windows guest and Quartus II software
In Quartus II IDE, go to Tools->Programmer
- In the programmer window, go to "Hardware Setup" and select the "JTAG Settings" tab
Insert the host computer's IP and the password you used when setting up the JTAG server. Press OK button
- You should see the host's IP and the name of the Altera device that is connected to the host computer
- Go back to "Hardware Settings" tab and select the Altera device from "Currently Selected Hardware" combo
- Close the "Hardware Setup" Dialog
Now you should be able to load a compiled digital circuit by using Quartus II programmer
External Links
Sites
http://www.alteraforum.com - Altera's user community forum
http://nioswiki.jot.com - A Nios II development Wiki
http://sopc.et.ntust.edu.tw/ - Public GIT server created to host open-source projects of soft-core FPGA processors
http://www.fpga-dev.com/altera-usb-blaster-with-ubuntu/ - An updated post on getting USB-Blaster to work (Ubuntu 14.04-64, QuartusII 13.0.1-64)
Forum threads and tutorials this document is based on
http://www.alteraforum.com/forum/showthread.php?t=2824 - Installation of Altera Complete Design Suite v8.0 for Linux under Ubuntu 8.04 (Hardy Heron)
http://www.alteraforum.com/forum/showthread.php?t=1724 - Installation of Quartus II 7.2 under Ubuntu 7.2 (Gutsy Gibbon)
http://www.alteraforum.com/forum/showthread.php?t=3823&highlight=jtagd - Virtualization and the USB ByteBlaster.
http://nioswiki.jot.com/WikiHome/JtagStandalone - Short tutorial about setting up jtagd
http://www.informit.com/articles/article.aspx?p=25845 - Tutorial about setting up TCP/IP in Linux
http://sopc.et.ntust.edu.tw/pipermail/nios2-dev/2008-August/001709.html - A long thread about setting up jtagd