https://wiki.archlinux.org/api.php?action=feedcontributions&user=Bradomyn&feedformat=atomArchWiki - User contributions [en]2024-03-28T15:48:33ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Xilinx_ISE_WebPACK&diff=199199Xilinx ISE WebPACK2012-04-26T12:24:13Z<p>Bradomyn: </p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
{{i18n|Xilinx ISE WebPACK}}<br />
<br />
The Xilinx ISE WebPACK is a complete FPGA/CPLD programmable logic design suite providing:<br />
* specification of programmable logic, via schematic capture or verilog/VHDL<br />
* synthesis and fit of specified logic into Xilinx CoolRunner and Spartan devices<br />
* behavioral and post-fit simulation <br />
* download of configuration into target device via communications cable<br />
* support for Linux based development system host <br />
<br />
While Arch Linux is not one of the officially supported distributions, many features are known to work on Arch Linux.<br />
<br />
== Installation ==<br />
{{Note|The installation is last known to work with Linux kernel 3.1.4 and Xilinx ISE 13.3.}}<br />
<br />
The ISE WebPACK Linux version can be downloaded from [http://www.xilinx.com/support/download/index.htm 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".<br />
<br />
Once the tarball is downloaded, unpack it and run the installer:<br />
$ tar xf Xilinx_ISE_DS_Lin_13.3_O.76xd.1.0.tar<br />
$ cd Xilinx_ISE_DS_Lin_13.3_O.76xd.1.0<br />
$ ./xsetup<br />
<br />
Then, follow the instructions to install the ISE. By default, the whole application is installed to {{ic|/opt/Xilinx/}}, so make sure the user running the installer has permissions to write to this directory.<br />
<br />
After installation, the ISE can be launched from {{ic|/opt/Xilinx/13.3/ISE_DS/ISE/bin/lin/ise}}. Design capture, synthesis and simulation features should work out-of-box.<br />
<br />
== Troubleshooting ==<br />
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.<br />
<br />
I downloaded the standalone driver installation utility from: ftp://ftp.xilinx.com/pub/utilities/fpga/install_drivers.tar.gz<br />
<br />
This download yields a file named install_drivers.tar.gz <br />
<br />
$ tar xzf install_drivers.tar.gz <br />
yields a directory named install_drivers/. When I attempted to build the drivers from this file I encountered the following errors:<br />
'''linux_wrappers.c:48:31: error: linux/ioctl32.h: No such file or directory'''<br />
and<br />
'''linux_wrappers.c:1398: error: ‘struct scatterlist’ has no member named ‘page’'''<br />
<br />
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<br />
<br />
$ tar xzf WD920LN.tgz <br />
yields a directory named WinDriver/ Within this directory you'll find:<br />
$ ls WinDriver/redist/ <br />
configure* linux_wrappers.c makefile.in wdreg* wdusb_linux.c windrvr_gcc_v3.a<br />
linux_common.h linux_wrappers.h setup_inst_dir* wdusb_interface.h windrvr_gcc_v2.a windrvr_gcc_v3_regparm.a<br />
<br />
These are the same core files also found in:<br />
$ ls install_drivers/linux_drivers/windriver32/windrvr/<br />
config.cache LINUX.2.6.24-ARCH.i386/ makefile wdusb_interface.h windrvr_gcc_v3_regparm.a<br />
config.log linux_common.h makefile.in wdusb_linux.c<br />
config.status* linux_wrappers.c setup_inst_dir* windrvr_gcc_v2.a<br />
configure* linux_wrappers.h wdreg* windrvr_gcc_v3.a<br />
<br />
So I copied the 9.20 WinDriver files over those found in the install_drivers/ subdirectory:<br />
$ cp -p WinDriver/redist/* install_drivers/linux_drivers/windriver32/windrvr/<br />
<br />
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.<br />
<br />
After research regarding changes to scatterlist.h lead to these discussions: http://kerneltrap.org/Linux/SG_Chaining_Merged<br />
<br />
Which describe changes in scatter/gather lists that were implemented in kernel 2.6.23 in Oct 2007.<br />
<br />
I implemented the following:<br />
$ cd install_drivers/linux_drivers/windriver32/windrvr/<br />
<br />
and apply the patch indicated below to linux_wrappers.c:<br />
<br />
124a125,127<br />
> /* added to fix scatterlist without page compile bug -jea 2008-05-09 */<br />
> // #include <linux/scatterlist.h><br />
><br />
1791c1794<br />
< sgl[0].page = pages[0];<br />
---<br />
> sgl[0].page_link = (unsigned long)pages[0];<br />
1798c1801<br />
< sgl[i].page = pages[i];<br />
---<br />
> sgl[i].page_link = (unsigned long)pages[i];<br />
1823c1826<br />
< void *va = page_address(sgl[i].page) + sgl[i].offset;<br />
---<br />
> void *va = page_address((struct page *)sgl[i].page_link) + sgl[i].offset;<br />
1954,1956c1957,1959<br />
< if (!PageReserved(sgl[i].page))<br />
< SetPageDirty(sgl[i].page);<br />
< page_cache_release(sgl[i].page);<br />
---<br />
> if (!PageReserved((struct page *)sgl[i].page_link))<br />
> SetPageDirty((struct page *)sgl[i].page_link);<br />
> page_cache_release((struct page *)sgl[i].page_link);<br />
<br />
or, viewed as a unified patch:<br />
<br />
--- before/install_drivers/linux_drivers/windriver32/windrvr/linux_wrappers.c 2008-02-19 09:58:43.000000000 -0800<br />
+++ after/install_drivers/linux_drivers/windriver32/windrvr/linux_wrappers.c 2008-05-15 20:02:23.000000000 -0700<br />
@@ -122,6 +122,9 @@<br />
static struct pci_dev *pci_root_dev;<br />
#endif <br />
<br />
+/* added to fix scatterlist without page compile bug -jea 2008-05-09 */<br />
+// #include <linux/scatterlist.h><br />
+<br />
typedef struct<br />
{<br />
struct page **pages;<br />
@@ -1788,14 +1791,14 @@ <br />
<br />
memset (sgl, 0, sizeof(struct scatterlist) * page_count);<br />
sgl[0].offset = ((unsigned long)buf) & (~PAGE_MASK);<br />
- sgl[0].page = pages[0];<br />
+ sgl[0].page_link = (unsigned long)pages[0];<br />
if (page_count > 1)<br />
{<br />
sgl[0].length = PAGE_SIZE - sgl[0].offset;<br />
size -= sgl[0].length;<br />
for (i=1; i < page_count ; i++, size -= PAGE_SIZE)<br />
{<br />
- sgl[i].page = pages[i];<br />
+ sgl[i].page_link = (unsigned long)pages[i];<br />
sgl[i].length = size < PAGE_SIZE ? size : PAGE_SIZE;<br />
}<br />
}<br />
@@ -1820,7 +1823,7 @@<br />
for (i=0; i<*dma_sglen; i++)<br />
{<br />
#if defined(_CONFIG_SWIOTLB)<br />
- void *va = page_address(sgl[i].page) + sgl[i].offset;<br />
+ void *va = page_address((struct page *)sgl[i].page_link) + sgl[i].offset;<br />
dma_addr_t dma_addr = virt_to_phys(va); <br />
<br />
if (dma_addr & ~mask)<br />
@@ -1951,9 +1954,9 @@<br />
#if defined(_CONFIG_SWIOTLB)<br />
pci_unmap_single(dev_handle, sg_dma_address(&sgl[i]), sg_dma_len(&sgl[i]), (int)dma_direction);<br />
#endif<br />
- if (!PageReserved(sgl[i].page))<br />
- SetPageDirty(sgl[i].page);<br />
- page_cache_release(sgl[i].page);<br />
+ if (!PageReserved((struct page *)sgl[i].page_link))<br />
+ SetPageDirty((struct page *)sgl[i].page_link);<br />
+ page_cache_release((struct page *)sgl[i].page_link);<br />
}<br />
vfree(sgl);<br />
#elif defined(LINUX_24)<br />
<br />
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/<br />
<br />
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.<br />
make[1]: *** [_module_/home/johnea/src/before/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr] Error 2<br />
make[1]: Leaving directory `/usr/src/linux-2.6.24-ARCH'<br />
make: *** [default] Error 2<br />
<br />
which was corrected by the following brutal hack to the Makefile:<br />
<br />
diff before/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/Makefile \ <br />
after/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/Makefile<br />
<br />
25c25<br />
< ifeq ($(GET_USER_SIZE_SYM),0)<br />
---<br />
> #ifeq ($(GET_USER_SIZE_SYM),)<br />
27c27<br />
< endif<br />
---<br />
> #endif<br />
<br />
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:<br />
xpc4drvr: Unknown symbol get_user_size<br />
<br />
However this did allow compilation of the entire driver tree and the install script was able to successfully install the drivers via:<br />
cd install_drivers/<br />
./install_drivers<br />
<br />
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)<br />
<br />
So after this brief modification, I am able to successfully run ISE on Arch Linux (kernel26 2.6.24) with full USB cable support.<br />
<br />
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.<br />
<br />
I never attempted to use the Xup driver.<br />
<br />
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:<br />
install_drivers/ <br />
<br />
in the base install of the entire ISE package under:<br />
/opt/Xilinx/10.1/common/bin/lin/install_script/install_drivers/<br />
<br />
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.<br />
<br />
Additionally, as a housekeeping note, the commands above expect all files to be downloaded and untared in the same working directory.<br />
<br />
All in all this is the crux of what was necessary for me to get the USB support running on Arch.<br />
<br />
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.<br />
<br />
Happy Hardware Hacking!!!<br />
<br />
== Update 2010-08-02 ==<br />
<br />
Comments in the forum thread announcing this wiki entry make reference to the page:<br />
<br />
http://rmdir.de/~michael/xilinx/<br />
<br />
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.<br />
<br />
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:<br />
<pre><br />
* 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.<br />
<br />
To fix this, run the following command as root:<br />
sed -i -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' /etc/udev/rules.d/xusbdfwu.rules<br />
You may have to reboot for this change to take effect.<br />
</pre><br />
<br />
I didn't require a reboot for this patch to take affect while running:<br />
<pre><br />
[root@vhost pcusb]# pacman -Q udev<br />
udev 151-3<br />
[root@vhost pcusb]# pacman -Q kernel26<br />
kernel26 2.6.33.4-1<br />
</pre><br />
In both the x86_64 host and the i686 chroot.<br />
<br />
android<br />
<br />
== Update 2012-04-26 ==<br />
I had a problem with PlanAhead software wich is based on Java, there is non-rendered window. It appears that this problem is a re-manifestation of the Java bug, which was meant to have been fixed in an early version of Java 1.6. Using MToolkit makes the workaroud: <br />
<pre><br />
$export AWT_TOOLKIT="MToolkit"<br />
</pre><br />
Source from [http://forums.xilinx.com/t5/Installation-and-Licensing/Planahead-12-3-has-a-non-rendered-window/td-p/105153 Xilinx Forum]<br />
<br />
== Resources ==<br />
* http://gentoo-wiki.com/HOWTO_Xilinx#Installing_Cable_Driver_Kernel_Modules<br />
* http://gentoo-wiki.com/Talk:HOWTO_Xilinx/Archive_1<br />
* http://gentoo-wiki.com/HOWTO_Xilinx<br />
* [http://www.xilinx.com/support/answers/22648.htm USB install on Linux]<br />
* http://developer.petalogix.com/wiki/Other/XilinxOnLinux<br />
* http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/archive/2007/03/msg00101.html<br />
* http://groups.google.com/group/comp.arch.fpga/msg/2dfa36541174a4f2<br />
* http://groups.google.com/group/comp.arch.fpga/browse_thread/thread/24884c2d0e90b97f<br />
* http://groups.google.com/group/comp.arch.fpga/browse_thread/thread/f149e5b6028e2c70/066766d9510e407a#066766d9510e407a</div>Bradomyn