Tag/tag.png

Needs Expansion
This article is incomplete, and needs to be expanded. More info...

Tag/tag.png

Unsupported Version
This article applies to an unsupported version of Ubuntu. More info...

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:

  1. Quartus II Web Edition - Free version available only for Windows
  2. 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:

  1. Install Quartus II Web Edition in the guest system to be able to create, compile and load designs into Altera devices
  2. Set up a JTAG server on host computer

    1. Install Quartus II Subscription Edition in the host machine to be able to use jtagd and jtagconfig

    2. Use jtagd and jtagconfig to setup a JTAG server

  3. Communicate the Quartus II Web Edition installed in the guest system with the JTAG server running on the host via virtual networking

  4. Test configuration by loading a compiled design into Altera device

Setting up Quartus II Web Edition 8.1 in the Windows guest

  1. Install VirtualBox (either normal or OSE version) on the host computer.

  2. Create a new virtual machine and install WindowsXP or Windows Vista on it (only this versions of Windows are supported by Quartus II software)

  3. Download Quartus II Web Edition Software v8.1 from Altera's site

  4. 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:

  • quartus_windows_virtualbox.jpg

Setting up the JTAG server

Setup environment for Quartus II installation script

  1. Remove csh and install tcsh on the host system

    sudo apt-get remove csh tcsh
    sudo apt-get install tcsh
  2. 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

  1. Download Quartus II Subscription Edition Software v8.1 for Linux from Altera's site

  2. Untar 81_quartus_linux.tar in the the host computer, in a directory of your choice

  3. Go to the directory where you untared the software and execute the installation script
    ./install
  4. 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
  5. 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
  • quartus_ubuntu.jpg

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:

  1. Download jtagd init script from here

  2. Place the script in /etc/init.d/ directory

  3. 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

  4. Create /etc/jtagd directory

  5. Create an empty file called /etc/jtagd/jtagd.conf (needed to store jtagd configuration, which is managed by jtagconfig)

  6. Create the following symbolic link
    sudo ln -s $ALTERA_HOME/quartus/linux/pgm_parts.txt /etc/jtagd/
  7. 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

  8. 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

  1. 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.

  2. 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.

  3. Configure HCI networking in VirtualBox using the start up and teardown scripts

    1. On VirtualBox's main screen, select the Windows guest virtual machine

    2. Go to Machine->Settings->Network

    3. Select a the network adapter of your choice and enable networking on that adapter by clicking on the "Enable network Adapter" checkbox
    4. In the "Attached to" combo, select the "Host Interface" option
    5. 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

    virtualbox_network_config.jpg

  4. Press OK button
  5. Start Windows guest virtual machine
  6. 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

  • windows_ping.jpg ubuntu_ping.jpg

Test configuration

  1. Start jtagd if is not already running in the host

  2. Turn on and connect an Altera device to the host computer
  3. Start Windows guest and Quartus II software
  4. In Quartus II IDE, go to Tools->Programmer

    quartus_windows_programmer.jpg

  5. In the programmer window, go to "Hardware Setup" and select the "JTAG Settings" tab
  6. Insert the host computer's IP and the password you used when setting up the JTAG server. Press OK button

  7. You should see the host's IP and the name of the Altera device that is connected to the host computer
  8. Go back to "Hardware Settings" tab and select the Altera device from "Currently Selected Hardware" combo

    quartus_remote_jtag.jpg

  9. Close the "Hardware Setup" Dialog

Now you should be able to load a compiled digital circuit by using Quartus II programmer

External Links

Sites

Forum threads and tutorials this document is based on


CategoryHardware

QuartusII (last edited 2015-03-30 16:21:57 by knome)