Altera jtag server linux

my tech blog

Latest Posts

Archives

Quartus / Linux: Programming the FPGA with command-line

Command-line?

Yes, it much more convenient than the GUI programmer. Programming an FPGA is a repeated task, always the same file to the same FPGA on the same board connected to the computer. And somehow the GUI programming tools turn it into a daunting ceremony (and sometimes even a quiz, when it can’t tell exactly which device is connected, so I’m supposed to nail the exact one).

With command line its literally picking the command from bash history, and press Enter. And surprisingly enough, the command line tool doesn’t ask the silly questions that the GUI tool does.

First, some mucking about

Set up the environment:

To list all devices found (cable auto-detected):

Note that listing the devices as shown above is not necessary for programming. It might be useful to tell the position of the FPGA in the JTAG chain, maybe. Really something that is done once to explore the board.

jtagd

It’s important to be aware of this deamon, which listens to TCP/IP port 1309: It’s responsible for talking with the JTAG adapter through the USB bus, so both the GUI and command line programmer utilities rely on it. If there’s no daemon running, both of these launch it.

But if you use multiple versions of Quartus, this may be a source of confusion, in particular if you make a first attempt to program an FPGA with an older version, and then try a newer one. That’s because the newer version of Quartus will keep using the older version of jtagd, possibly failing to work with recent devices. Bottom line: If wonky things happen, this won’t hurt:

Programming

quartus_pgm displays most of its output in green. Generally speaking, if there’s no red text, all went fine.

Or add the position in the JTAG explicitly (in particular if it’s not the first device). In this case it’s @1, meaning it’s the first device in the JTAG chain. If it’s the second device, pick @2 etc.

If anything goes wrong — device mismatch, a failure to scan the JTAG chain or whatever, it will be hard to miss because of the errors written in red. The sweet thing with the command line interface is that every attempt starts from fresh, so just turn the board on (the usual reason for errors) and give it another go.

Cyclone 10 GX FPGA development kit

This board caused me some extra trouble, so a few words about it. When connected, it appears as 09fb:6810, however after attempting to program the FPGA (note the “@2″ in the end) with

it changes to 09fb:6010. So there’s clearly some reprogramming of firmware (the log shows a disconnection and reconnection with the new ID). The board is detected as GX0000406 by the Quartus GUI Programming Tool, but clicking “Auto Detect” yields “Unable to scan device chain. Hardware is not connected”.

OK, what about a scan?

The problem in my case was apparently that the jtagd running was launched by an older version of Quartus, which didn’t recognize Cyclone 10 devices. So follow the advice above, and kill it. After that, programming with the command above worked with Quartus Pro 17.1:

Reader Comments

Very good news! I would like to know if you tested the complete Quartus toolchain for Linux. I am very interested in it as I intend to buy some development boards based on an Altera FPGA and use it on the Linux platform. Could you post the minimal workflow based on Quartus command line tools (from the Verilog/VHDL code to programming the board)?

I work with Intel / Altera’s toolchain for Linux for years, based upon the command line interfaces. The commands are those appearing in the GUI’s log pane as well as in the report files. So if you just want a simple batch script that runs through the flow from beginning to end, just copy these commands into a bash script file.

Читайте также:  Ошибка 0х80004005 при установке windows

Writing a makefile is somewhat trickier, because the synthesizer and fitter don’t produce specific output files, but rather update a the tool’s database. So it’s impossible, as far as I know, to pinpoint a file that is the “output” of each tool. The only thing that comes close is the tools’ reports, but they are updated even if the tool fails, and GNU make will assume it ran OK if it’s re-invoked.

Anyhow, Intel / Altera supplies plenty of docs on scripting.

Источник

Altera jtag server linux

Installing and Running Altera’s Quartus II on Linux

Please note that this tutorial is intended for Debian-derived Linux distros such as Ubuntu, Mint, MX, etc.

Users running Arch-based distros should refer to the Arch Wiki (in fact, arch users can automatically download, install, and get the Quartus toolkit to work on their computers by simply using one of the AUR’s packages).

1) Download & Install

Select by Device -> Choose Device Family -> Choose your Device

Click on the most recent Web Edition.

Select the rigth OS and click on Individual Files.

Download only what you need.

Give the downloaded script execution permission: chmod +x QuartusSetup.run

Run the installation script: /path/to/script/QuartusSetup.run

2) Add path dependencies

Create the following script file to be run at startup, one way to accomplish this is to append source /path/to/script/quartus.sh to your shell configuration file.

3) Install 32-bit compatibility packages

A few 32-bit packages will probably need to be installed on 64-bit systems in order for some tools to work.

Try opening and using any tool directly fom the Quartus GUI. If it doesn’t work, run it from the terminal and there should be some complaint about a missing packge or library. Look up on what package you may find this library and install it.

The eclipse-nios2 tool requires installing libgtk2.0-0:i386

It may also require starting it through the terminal with:

$SOPC_KIT_NIOS2/bin/eclipse-nios2 -configuration $HOME/.nios2-ide-6.1 $WORKSPACE_ARGS «$@»

Extra packages I needed to get on a MX Linux install included gcc-multilib , lib32ncurses5 , libx11-6 , libfreetype6 , libpng12 , libc6 , libxtst6 , zlib1g , libssl1.0.0 and libssl-dev ; generally the :i386 versions. You may also need Java 8 or greater.

4) USB-Blaster configuration

At first, connect the cable and make sure the USB device is recognized:

Take note of the Product ID listed — 6010 in the above example.

The Quartus software will use the Linux built-in usb_device drivers. By default, only root has access to these so we must make sure the user is allowed to access them as well.

jtagd, part of the Quartus tools, is a deamon that provides the interface between the Altera tool accessing the JTAG chain and the USB driver. If not already running, jtagd will be startetd automatically when the Quartus software or jtagconfig is run. You’ll usually run these as a user, which means jtagd will also run as a user. That is why edited permission for the usb_device is necessary.

Create a file /etc/udev/rules.d/51-usbblaster.rules, make sure it has read permissions for root, and fill it with this content:

Edit the value for ATTR to match the Product ID determined before.

If you have more than one Product ID you want this to work for, simply repeat the above lines in the same file and use the other Product IDs for ATTR.

For the changes to take effect, reboot the machine.

Make sure jtagd has access to the list of devices:

Also make sure this file has read access for the user.

The cable should now be recognized as a valid hardware by the Quartus tools. From Quartus, select Tools, Programmer, Hardware Setup. and then select the board from the drop-down list. Now, the Programmer, JTAG Chain Debugger and System console should all recognize and use the USB-Blaster device.

About

Quartus II installation tutorial for Debian-based Linux distros

Источник

Ubuntu Documentation

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

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

    Читайте также:  Linux клонирование системного диска

    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:

      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

    Make sure that /bin/sh is pointing to bash.

    If it is not pointing to bash, delete existing link and create a new one

    Install Quartus II Subscription Edition

    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

    Follow the instructions to complete the default installation. If you decide to do a custom installation, read readme.txt or the installation script 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

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

    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

    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

    Читайте также:  Windows boot disk commands

    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

    Start jtagd service

    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.

    If your setup was successful, you should have a jtagd process listening in port 1309

    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.

    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

    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

    Sites

    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)

    QuartusII (последним исправлял пользователь knome 2015-03-30 16:21:57)

    The material on this wiki is available under a free license, see Copyright / License for details
    You can contribute to this wiki, see Wiki Guide for details

    Источник

    Оцените статью