Installation of Xilinx ISE 8.1 under Linux (Kernel 2.6.16)

Content

Preface

This guide is based on the article Installing Xilinx Webpack 8.1i (or ISE Foundation 8.1i) on debian 3.1. System configuration: Linux Debian with kernel 2.6.16, self compiled.

The following websites provide further useful information:
If you have any questions, suggestions or solutions, please send me a mail.

Installation of Xilinx ISE/EDK under Debian

Install WinDriver and Xilinx driver

In the meantime Xilinx provides a source packet specially for the kernel 2.6 to compile the drivers yourself. This makes the task much easier and faster, since you don't have to register with jungo anymore.

Here the short guide. Change into a directory where the sources should be extracted and execute the following commands in case of kernel 2.6.16:
wget ftp://ftp.xilinx.com/pub/utilities/M1_workstation/linuxdrivers.2.6.tar.gz
tar zxvf linuxdrivers.2.6.tar.gz
cd linuxdrivers.2.6
cd windrvr
./configure
cp makefile makefile.orig
perl -p -i -n -e 's/-DKBUILD_MODNAME=windrvr6/-D"KBUILD_STR(s)=\\#s" -D"KBUILD_BASENAME=KBUILD_STR(windrvr6)" -D"KBUILD_MODNAME=KBUILD_STR(windrvr6)"/' makefile
make
make install
dmesg
[...]
WinDriver v7.00 Jungo (c) 1997 - 2005 Build Date: Apr 26 2005 X86 loaded
If the output of dmesg ends with the above, then the module is working correctly. In any other case you should consider the websites cited at the top of the page to solve the problem.

Using modprobe windrvr6 you can load the module anytime.

Now we compile xpc4drvr:
cd ..
cd xpc4drvr/
./configure
make
make install
[...]
Loading /lib/modules/2.6.16/kernel/drivers/misc/xpc4drvr.ko
ERROR: Module xpc4drvr does not exist in /proc/modules
depmod

Register device at hotplug

cd path_to_ise_installation/bin/lin/
touch /etc/hotplug/usb.usermap
sh setup_pcusb
Unfortunately the script setup_pcusb failed to work on my system, therefore I did some modifications. Regrettably I don't remember what the modifications where.

If you want to put the XUP-board into operation using ISE 7.1, you should in accordance with the following article incorporate a small modification into /etc/hotplug/usb.usermap. I am not sure if this is still necessary with ISE 8.1, but in any case it seems not harmful. In particular you have to set the value of idProduct from 0x0007 to 0x0009. Maybe this is superfluous in newer versions of ISE.

Then I have restarted hotplug.
/etc/init.d/hotplug restart
Amongst other things the following was printed:
      xusbdfwu: loaded successfully
microcontroller type: fx2
single stage:  load on-chip memory
open RAM hexfile image usb/xusbdfwu.fw/xusbdfwu.hex
stop CPU
write on-chip, addr 0x1b2f len   10 (0x000a)
write on-chip, addr 0x0178 len   53 (0x0035)
write on-chip, addr 0x15fd len  112 (0x0070)
write on-chip, addr 0x1000 len  543 (0x021f)
...
write on-chip, addr 0x047a len  486 (0x01e6)
write on-chip, addr 0x1509 len  128 (0x0080)
write on-chip, addr 0x0479 len    1 (0x0001)
write on-chip, addr 0x0660 len  115 (0x0073)
... WROTE: 6934 bytes, 71 segments, avg 97
reset CPU
Well, we are happy that something happens at all, and the board was recognized.

Interestingly the Product id of the XUP board changes from 0x0009 to 0x0008 (verifiable with lsusb). And without this change the USB data transfer does not work for me.

USB transfer in iMPACT

iMPACT can be started directly ( path_to_ise_installation/bin/lin/impact) or from ISE.

After system restart you have to load both driver modules to be able to use USB transfer in iMPACT. Because this was not enough in my case, I have tried several combinations to find out in which order the modules have to be unloaded and loaded. And this USB init scipt is the result (adjust red markings):
#!/bin/bash
##############################
# USB init script for iMPACT #
#                            #
#     by Stefan Endrullis    #
##############################

VENDOR_ID=03fd
PRODUCT_ID=0008

##############################

# prevent hacking
PATH=/sbin:/bin:/usr/sbin:/usr/bin

rmmod xpc4drvr
rmmod windrvr6

modprobe windrvr6
chown stefan:users /dev/windrvr6
chmod 660 /dev/windrvr6
modprobe xpc4drvr

echo -n "Please turn on the board."
while [ `lsusb -d "$VENDOR_ID:$PRODUCT_ID" | wc -l` != "1" ]; do
  printf ".";
  sleep 1;
done
echo "OK"

echo -n "Initialising USB devices..."
/etc/hotplug/usb.rc restart
echo "OK"

After running the script the USB transfer should work.

The best way to test whether the board is reachable is to select Cable Auto Connect in the menu Output. If the connection could not be established, you can look into the log of iMPACT by clicking View->View Log File. Here you can get useful information like...
Connecting to cable (Usb Port - USB21).
Checking cable driver.
File version of /opt/xilinx/bin/lin/xusbdfwu.hex = 1018(dec), 03FA.
File version of /etc/hotplug/usb/xusbdfwu.fw/xusbdfwu.hex = 1018(dec), 03FA.
 Cannot access /dev/windrvr6 - Permission denied.
Cable connection failed.
If you find the following in the log,
Connecting to cable (Usb Port - USB21).
Checking cable driver.
File version of /opt/xilinx/bin/lin/xusbdfwu.hex = 1018(dec), 03FA.
File version of /etc/hotplug/usb/xusbdfwu.fw/xusbdfwu.hex = 1018(dec), 03FA.
Cable connection failed.
I suggest you to run the USB init scipt again and then try to use iMPACT.

If you are working with the EDK, then the fastest way to perform the USB transfer is to run make -f system.make download from your project directory. In advance you have to run the Xilin setup scripts in order to setup the PATH variable for iMPACT and the other programs. The following script settings.sh does the job:
#!/bin/bash

. /opt/ise/settings.sh
. /opt/edk/setup.sh
. /opt/edk/settings.sh
You only have to run . settings.sh and everything will be configured. The dot may not be left out. It guaranties that the variables, set by the script, are taken over by the shell.

Note: You can use lsusb to list all attached USB devices. Since I use the XUP board, it gives me the following output:
Bus 002 Device 008: ID 03fd:0008 Xilinx, Inc.
If the connection with iMPACT fails, you should check whether the device can be found by lsusb. It seems that the board switches itself off after some idle time. Then it helps to turn it off and on again. Afterwards lsusb should list it again.

FAQ

Q: When running ./setup I get the following error message:
/cdrom/platform/lin/bin/lin
/cdrom/platform/lin/xilsetup: error while loading shared libraries: libXm.so.3: cannot open shared object file: No such file or directory


************ setup done! ***************
A: libXm.so.3 is within the Debian package libmotif3 (apt-get install libmotif3 libcurl3).

Q: When running make -f system.make download I get the following error message:
make -f system.make download

*********************************************
Downloading Bitstream onto the target board
*********************************************
impact -batch etc/download.cmd
make: impact: Command not found
make: *** [download] Fehler 127
A: The system variables are not set. You can call . settings.sh to solve the problem.