Xilinx ISE WebPACK

From ArchWiki
Revision as of 02:47, 8 January 2012 by PkmX (Talk | contribs) (Edit on the introduction and installation section)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

The Xilinx ISE WebPACK is a complete FPGA/CPLD programmable logic design suite providing:

  • specification of programmable logic, via schematic capture or verilog/VHDL
  • synthesis and fit of specified logic into Xilinx CoolRunner and Spartan devices
  • behavioral and post-fit simulation
  • download of configuration into target device via communications cable
  • support for Linux based development system host

While Arch Linux is not one of the officially supported distributions, many features are known to work on Arch Linux.

Installation

Note: The installation is last known to work with Linux kernel 3.1.4 and Xilinx ISE 13.3.

The ISE WebPACK Linux version can be downloaded from the official download page. It requires registration and licensing agreement, but there is no charge, i.e. it's free as in "free beer", but not free as in "free speech".

Once the tarball is downloaded, unpack it and run the installer:

$ tar xf Xilinx_ISE_DS_Lin_13.3_O.76xd.1.0.tar
$ cd Xilinx_ISE_DS_Lin_13.3_O.76xd.1.0
$ ./xsetup

Then, follow the instructions to install the ISE. By default, the whole application is installed to Template:Filename, so make sure the user running the installer has permissions to write to this directory.

After installation, the ISE can be launched from Template:Filename. Design capture, synthesis and simulation features should work out-of-box.

Troubleshooting

However once I reached the point of trying to download a design to a target device I ran into some trouble. Installing the cable drivers for talking to the target interface cable yielded errors.

I downloaded the standalone driver installation utility from: ftp://ftp.xilinx.com/pub/utilities/fpga/install_drivers.tar.gz

This download yields a file named install_drivers.tar.gz

$ tar xzf install_drivers.tar.gz 

yields a directory named install_drivers/. When I attempted to build the drivers from this file I encountered the following errors:

linux_wrappers.c:48:31: error: linux/ioctl32.h: No such file or directory

and

linux_wrappers.c:1398: error: ‘struct scatterlist’ has no member named ‘page’

Reading in the Gentoo HOWTO's listed above led me to download the latest Jungo source code, which is the core of the Xilinix linux USB support. I modified the link after reading that the latest Jungo driver was 9.20. I got WinDriver 9.20 from: http://www.jungo.com/st/download/WD920LN.tgz

$ tar xzf WD920LN.tgz 

yields a directory named WinDriver/ Within this directory you'll find:

$ ls WinDriver/redist/ 
configure*      linux_wrappers.c  makefile.in      wdreg*             wdusb_linux.c     windrvr_gcc_v3.a
linux_common.h  linux_wrappers.h  setup_inst_dir*  wdusb_interface.h  windrvr_gcc_v2.a  windrvr_gcc_v3_regparm.a

These are the same core files also found in:

$ ls install_drivers/linux_drivers/windriver32/windrvr/
config.cache    LINUX.2.6.24-ARCH.i386/  makefile         wdusb_interface.h  windrvr_gcc_v3_regparm.a
config.log      linux_common.h           makefile.in      wdusb_linux.c
config.status*  linux_wrappers.c         setup_inst_dir*  windrvr_gcc_v2.a
configure*      linux_wrappers.h         wdreg*           windrvr_gcc_v3.a

So I copied the 9.20 WinDriver files over those found in the install_drivers/ subdirectory:

$ cp -p WinDriver/redist/* install_drivers/linux_drivers/windriver32/windrvr/

This update to the Jungo driver eliminated the error: linux/ioctl32.h: No such file or directory, but the error: ‘struct scatterlist’ has no member named ‘page’ was still persisting.

After research regarding changes to scatterlist.h lead to these discussions: http://kerneltrap.org/Linux/SG_Chaining_Merged

Which describe changes in scatter/gather lists that were implemented in kernel 2.6.23 in Oct 2007.

I implemented the following:

$ cd install_drivers/linux_drivers/windriver32/windrvr/

and apply the patch indicated below to linux_wrappers.c:

124a125,127
> /* added to fix scatterlist without page compile bug -jea 2008-05-09 */
> // #include <linux/scatterlist.h>
>
1791c1794
<     sgl[0].page = pages[0];
---
>     sgl[0].page_link = (unsigned long)pages[0];
1798c1801
<             sgl[i].page = pages[i];
---
>             sgl[i].page_link = (unsigned long)pages[i];
1823c1826
<         void *va = page_address(sgl[i].page) + sgl[i].offset;
---
>         void *va = page_address((struct page *)sgl[i].page_link) + sgl[i].offset;
1954,1956c1957,1959
<         if (!PageReserved(sgl[i].page))
<             SetPageDirty(sgl[i].page);
<         page_cache_release(sgl[i].page);
---
>         if (!PageReserved((struct page *)sgl[i].page_link))
>             SetPageDirty((struct page *)sgl[i].page_link);
>         page_cache_release((struct page *)sgl[i].page_link);

or, viewed as a unified patch:

--- before/install_drivers/linux_drivers/windriver32/windrvr/linux_wrappers.c   2008-02-19 09:58:43.000000000  -0800
+++ after/install_drivers/linux_drivers/windriver32/windrvr/linux_wrappers.c    2008-05-15 20:02:23.000000000  -0700
@@ -122,6 +122,9 @@
     static struct pci_dev *pci_root_dev;
 #endif 

+/* added to fix scatterlist without page compile bug -jea 2008-05-09 */
+// #include <linux/scatterlist.h>
+
 typedef struct
 {
     struct page **pages;
@@ -1788,14 +1791,14 @@ 

     memset (sgl, 0, sizeof(struct scatterlist) * page_count);
     sgl[0].offset = ((unsigned long)buf) & (~PAGE_MASK);
-    sgl[0].page = pages[0];
+    sgl[0].page_link = (unsigned long)pages[0];
     if (page_count > 1)
     {
         sgl[0].length = PAGE_SIZE - sgl[0].offset;
         size -= sgl[0].length;
         for (i=1; i < page_count ; i++, size -= PAGE_SIZE)
         {
-            sgl[i].page = pages[i];
+            sgl[i].page_link = (unsigned long)pages[i];
             sgl[i].length = size < PAGE_SIZE ? size : PAGE_SIZE;
         }
     }
@@ -1820,7 +1823,7 @@
     for (i=0; i<*dma_sglen; i++)
     {
 #if defined(_CONFIG_SWIOTLB)
-        void *va = page_address(sgl[i].page) + sgl[i].offset;
+        void *va = page_address((struct page *)sgl[i].page_link) + sgl[i].offset;
         dma_addr_t dma_addr = virt_to_phys(va); 

         if (dma_addr & ~mask)
@@ -1951,9 +1954,9 @@
 #if defined(_CONFIG_SWIOTLB)
         pci_unmap_single(dev_handle, sg_dma_address(&sgl[i]), sg_dma_len(&sgl[i]), (int)dma_direction);
 #endif
-        if (!PageReserved(sgl[i].page))
-            SetPageDirty(sgl[i].page);
-        page_cache_release(sgl[i].page);
+        if (!PageReserved((struct page *)sgl[i].page_link))
+            SetPageDirty((struct page *)sgl[i].page_link);
+        page_cache_release((struct page *)sgl[i].page_link);
     }
     vfree(sgl);
 #elif defined(LINUX_24)

This corrected the compile errors in the Jungo USB driver and produced the windrvr6.ko kernel module. However there was still a nagging error in the compilation of install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/

scripts/Makefile.build:46: *** CFLAGS was changed in "/home/johnea/src/before/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/Makefile". Fix it to use EXTRA_CFLAGS.  Stop.
make[1]: *** [_module_/home/johnea/src/before/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.24-ARCH'
make: *** [default] Error 2

which was corrected by the following brutal hack to the Makefile:

diff before/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/Makefile  \ 
      after/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/Makefile

25c25
< ifeq ($(GET_USER_SIZE_SYM),0)
---
> #ifeq ($(GET_USER_SIZE_SYM),)
27c27
< endif
---
> #endif

This corrected all compilation errors, but the xpc4drvr.ko still yielded the following error in /var/log/everything.log whenever it was attempted to be loaded:

xpc4drvr: Unknown symbol get_user_size

However this did allow compilation of the entire driver tree and the install script was able to successfully install the drivers via:

cd install_drivers/
./install_drivers

There is also a udev rule entry that will make the driver accessible to all users after each reboot. (Which I haven't yet applied)

So after this brief modification, I am able to successfully run ISE on Arch Linux (kernel26 2.6.24) with full USB cable support.

There is a GPL'd libusb based driver mentioned in the Gentoo HOWTO: http://www.rmdir.de/~michael/xilinx/ that I was particularly interested in using. However while the source built without error, I continued to receive runtime errors when attempting to run it in ISE.

I never attempted to use the Xup driver.

There were quite a few pertinent facts along the way that I'm failing to capture here. Such as the fact that I discovered the same directory:

install_drivers/ 

in the base install of the entire ISE package under:

/opt/Xilinx/10.1/common/bin/lin/install_script/install_drivers/

I would expect that this procedure could be applied directly to that without the additional step of downloading the install_drivers.tar.gz but I haven't tried this.

Additionally, as a housekeeping note, the commands above expect all files to be downloaded and untared in the same working directory.

All in all this is the crux of what was necessary for me to get the USB support running on Arch.

Sorry for the somewhat fragmented description, but hopefully this allows others to get this great tool for linux users running on the post 2.6.23 kernels.

Happy Hardware Hacking!!!

Update 2010-08-02

Comments in the forum thread announcing this wiki entry make reference to the page:

http://rmdir.de/~michael/xilinx/

This is the upstream source for non-proprietary Xilinx USB drivers using libusb. This is now the Xilinx recommended linux usb interface and is shipped with new versions of Xilinx ISE WebPack.

Per a note on the rmdir.de website, newer versions of udev no longer support the older syntax of the /etc/udev/rules.d/xusbdfwu.rules file:

* 2010-03-15: If you are using newer udev-versions (like the version included in Debian Squeeze and Ubuntu 9.10), then the file /etc/udev/rules.d/xusbdfwu.rules is incompatible with this udev version. The effect of this is that the cable-firmware gets never loaded and the cable led never lights up.

To fix this, run the following command as root:
sed -i -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' /etc/udev/rules.d/xusbdfwu.rules
You may have to reboot for this change to take effect.

I didn't require a reboot for this patch to take affect while running:

[root@vhost pcusb]# pacman -Q udev
udev 151-3
[root@vhost pcusb]# pacman -Q kernel26
kernel26 2.6.33.4-1

In both the x86_64 host and the i686 chroot.

android

Resources