Linux

From JopWiki

Jump to: navigation, search

This page describes issues with the design flow of JOP under Linux.

Contents

[edit] Quartus

For Altera FPGAs, you need of course a working version of Quartus-II. If you don't have the Linux version of Quartus, you can install the Windows Web-Edition version under Wine (make sure that it pretends to be Windows98) and put shell scripts into you PATH to wrap the call.

On my machine, I use the following file, /usr/local/bin/quartus:

 #! /bin/sh
 QUARTUSPATH=/home/wolfgang/.wine/drive_c/altera/72sp1/quartus/bin
 wine $QUARTUSPATH/`basename $0`.exe $*

Other programs (e.g., quartus_map) are realized through symlinks to this file.

[edit] Xilinx

A HOWTO for the Xilinx tool chain under gentoo can be found at [1].

[edit] Configuring the FPGA

[edit] Boards with FTDI2232C Chip

A Linux version of USBRunner has been developed that can be used to program boards which are configured through an FTDI2232C chip (e.g., the dspio board). Other FTDI chips may work as well, but are untested. To compile the source code, you need the development files for libftdi installed (package libftdi-dev in Ubuntu).

To enable the virtual serial ports provided by this chip, you need the ftdi_sio kernel module. The port for downloading programs is probably /dev/tty/USB1, but the port number may change if other gadgets are connected to your machine.

[edit] USB-Blaster

Download to boards that are configured via USB-Blaster (e.g., the DE2 board from Altera) does not work through Wine. As work-around, Quartus can be started in a virtual machine like the KVM. The USB port the board is connected to can be forwarded to the virtual machine, and Quartus can configure the FPGA from there.

It is also possible to use UrJTAG for downloading. Version 0.9 was successfully tested with the DE2 board and the appropriate BSDL file from Altera, which can be found here. Provided that the BSDL file is located in /usr/local/share/urjtag/bsdl/, the appropriate commands for this board are:

 bsdl path /usr/local/share/urjtag/bsdl/
 cable UsbBlaster ftdi 9fb:6001
 detect 
 svf jop.svf

If you are using Ubuntu (tested with Quartus II 9.1 running on Ubuntu 10.04 64-bit) try the following steps:

 $ sudo mount --bind /dev/bus /proc/bus
 $ sudo ln -s /sys/kernel/debug/usb/devices /proc/bus/usb/devices
 $ sudo <quartus_directory>/bin/jtagd
 $ sudo <quartus_directory>/bin/jtagconfig
 $ <quartus_directory>/bin/quartus

More information can be found on http://ubuntuforums.org/showthread.php?t=1441742 and http://www.alteraforum.com/forum/showthread.php?t=22481

[edit] Downloading Programs

You can download programs to the processor with com.jopdesign.tools.JavaDown, a replacement for the platform dependent down.exe. To use it, you need the RXTX library installed (package librxtx-java in Ubuntu). If the version of the installed library does not match the version of the .jar shipped with JOP, you find an appropriate .jar in /usr/share/java/.

As an alternative you can use wine for downloading. Therefore you need a symlink like ~/.wine/dosdevices/com5 pointing to the device your board is connected to:

ln -s /dev/ttyUSB1 ~/.wine/dosdevices/com5

Then you can simply call wine in order to download your program:

wine down -e -usb java/target/dist/bin/HelloWorld.jop COM5

[edit] Design Flow for dspio Board

The following section describes the steps which have to be taken to get the design flow for the dspio board working. As the Makefile is in some places fairly platform dependent, ant was used for automating the build process.

[edit] Change build.xml to fit your needs

  • Set usb to true
  • Set com-port to /dev/ttyUSB1 (or something alike)
  • Set qproj to usbmin (or whatever project you want to build)
  • Make sure the the right configuration type is selected (use-config-usb for the dspio Board)

[edit] Run ant

Depending on your user-privileges, configuration of the FPGA can fail, because the ftdi_sio module claims the USB device. Running ant config-usb as root is a work-around for this problem. After that, you need to run ant download to download a program. At least in Ubuntu, it is also possible to add a file like 51-fpgaboards.rules to the directory /etc/udev/rules.d/ to fix the device permissions.

 # permissions for FPGA boards
 SUBSYSTEM=="usb", DRIVER=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
 SUBSYSTEM=="usb", DRIVER=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE="0666"

Of course, the vendor id and the product id have to match the ids of the respective FPGA board.

Personal tools