Difference between revisions of "Xilinx Vivado"

From ArchWiki
Jump to navigation Jump to search
m (Vivado HLS testbench error with GCC: Formatting)
(add tclsh to segfault section)
(23 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Development]]
+
[[Category:Electronic design automation]]
[[Category:Mathematics and science]]
 
 
[[ja:Xilinx Vivado]]
 
[[ja:Xilinx Vivado]]
 +
[[zh-hans:Xilinx Vivado]]
 
{{Style|Write a PKGBUILD}}
 
{{Style|Write a PKGBUILD}}
 
ArchLinux is not officially supported by Vivado, but as happens with [[Xilinx ISE WebPACK]], most of its features can be used with a bit of hacking.
 
ArchLinux is not officially supported by Vivado, but as happens with [[Xilinx ISE WebPACK]], most of its features can be used with a bit of hacking.
Line 7: Line 7:
 
== Prerequisites ==
 
== Prerequisites ==
  
Xilinx Vivado can be downloaded from its official website [http://www.xilinx.com/products/design-tools/vivado.html]. Vivado only supports 64-bit systems, so you will need a working 64-bit ArchLinux install. It's recommended to download "Vivado HLx 2015.4: Full Installer For Linux Single File Download Image Including SDK" tarball, but make sure not to be in a hurry, as it's a large download (near 9 GB). Update tarballs can also be downloaded and installed later.
+
Xilinx Vivado can be downloaded from its official website [http://www.xilinx.com/products/design-tools/vivado.html]. It's recommended to download "Vivado HLx <year>.<version>: All OS installer Single-File Download" tarball, but make sure not to be in a hurry, as it's a large download (near 19 GB). Update tarballs can also be downloaded and installed later.
  
 
=== Dependencies ===
 
=== Dependencies ===
 +
Installer needs ncurses5 libs, and will not work with ncurses 6 available at official repos. You can work-around this problem by installing {{AUR|ncurses5-compat-libs}}  from the [[Arch User Repository]]. You will also need to install {{Pkg|libpng12}} and {{Pkg|lib32-libpng12}} for Xilinx Document Navigator to launch.
  
Installer needs ncurses5 libs, and will not work with ncurses 6 available at official repos. You can work-around this problem by installing {{AUR|ncurses5-compat-libs}}  from the [[Arch User Repository]]. You will also need to install {{Pkg|lib32-libpng12}} for Xilinx Document Navigator to launch.
+
SDK 2018.3 (potentially also other versions) needs gtk2 library. You may need to install {{Pkg|gtk2}} if you are planning to use SDK.
  
 
== Installation ==
 
== Installation ==
Line 18: Line 19:
  
 
=== Vivado and SDK  ===
 
=== Vivado and SDK  ===
 +
{{Warning |heading=Vivado 2018.1 |align=center |The patch below is not longer needed in the 2018.1 version. Just unpack and run the xsetup file.}}
  
 
Once downloaded and unpacked the tarball, the install script must be patched to be able to properly detect the machine architecture. You can do it by going to the directory where installer is extracted and running:
 
Once downloaded and unpacked the tarball, the install script must be patched to be able to properly detect the machine architecture. You can do it by going to the directory where installer is extracted and running:
Line 30: Line 32:
  
 
=== Update patch ===
 
=== Update patch ===
 +
{{Warning |heading=Vivado 2018.1 |align=center |The patch below is not longer needed in the 2018.1 version.}}
  
 
It is recommended to install the latest update patch, and repeat the process each time a new patch is released. Note that update patches cannot be applied to WebPACK installs. If you installed Vivado WebPACK, skip this section.
 
It is recommended to install the latest update patch, and repeat the process each time a new patch is released. Note that update patches cannot be applied to WebPACK installs. If you installed Vivado WebPACK, skip this section.
Line 39: Line 42:
  
 
=== Licensing ===
 
=== Licensing ===
 +
{{Warning |heading=Vivado 2018.1 |align=center |In the 2018.1 Webpack version there is not longer required download an explicit license file, it just works.}}
  
 
If you already have a license file, you can load it using Vivado License Manager. Unfortunately, if you want to obtain a WebPack license, further steps are needed. Vivado installs old stdc++ libraries, causing problems when spawning programs not included with Vivado Suite (like your default browser). To fix this, do the following steps:
 
If you already have a license file, you can load it using Vivado License Manager. Unfortunately, if you want to obtain a WebPack license, further steps are needed. Vivado installs old stdc++ libraries, causing problems when spawning programs not included with Vivado Suite (like your default browser). To fix this, do the following steps:
Line 61: Line 65:
 
In addition, installing {{AUR|digilent.adept.utilities}} may do good to configuring your board.
 
In addition, installing {{AUR|digilent.adept.utilities}} may do good to configuring your board.
  
== Launching programs ==
+
=== Linux cable driver ===
 +
Run as root privilege:
 +
 
 +
$ {vivado_install_dir}/data/xicom/cable_drivers/lin64/install_script/install_drivers/install_drivers
 +
 
 +
== Tips and tricks ==
 +
 
 +
=== Create .desktop files ===
 +
 
 +
{{Note |For 2018.3 and later, there is no need to write .desktop file manually}}
  
 
To ease launching programs, you can create the following .desktop files for Vivado IDE, SDK and DocNav:
 
To ease launching programs, you can create the following .desktop files for Vivado IDE, SDK and DocNav:
Line 71: Line 84:
 
Type=Application
 
Type=Application
 
Name=Xilinx Vivado IDE
 
Name=Xilinx Vivado IDE
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/Vivado/2015.4/settings64.sh && vivado"
+
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/Vivado/2018.1/settings64.sh && vivado"
Icon=/opt/Xilinx/Vivado/2015.4/doc/images/vivado_logo.png
+
Icon=/opt/Xilinx/Vivado/2018.1/doc/images/vivado_logo.png
 
Categories=Development;
 
Categories=Development;
 
Comment=Vivado Integrated Development Environment}}
 
Comment=Vivado Integrated Development Environment}}
Line 82: Line 95:
 
Type=Application
 
Type=Application
 
Name=Xilinx SDK
 
Name=Xilinx SDK
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/SDK/2015.4/settings64.sh && xsdk"
+
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/SDK/2018.1/settings64.sh && xsdk"
Icon=/opt/Xilinx/SDK/2015.4/data/sdk/images/sdk_logo.png
+
Icon=/opt/Xilinx/SDK/2018.1/data/sdk/images/sdk_logo.png
 
Categories=Development;
 
Categories=Development;
 
Comment=Xilinx Software Development Kit}}
 
Comment=Xilinx Software Development Kit}}
Line 96: Line 109:
 
Categories=Development;
 
Categories=Development;
 
Comment=Xilinx Documentation Navigator}}
 
Comment=Xilinx Documentation Navigator}}
 +
 +
=== Enable display scaling ===
 +
Start vivado, then set the scaling rate as follow:
 +
 +
Tools -> Setting -> Display -> Scaling
  
 
== Troubleshooting ==
 
== Troubleshooting ==
  
=== libncurses.so.5 not found ===
+
=== Synthesis segfaults ===
  
Xilinx Vivado requires version 5 of ncurses while ArchLinux has already updated to a newer version.
+
See https://forums.xilinx.com/t5/Synthesis/Vivado-crashes-on-Arch-Linux-when-performing-synthesis/td-p/706847
  
To obtain this library, you can either search in your pacman cache to see if you already have a local copy:
+
You'll need to recompile glibc (just take the PKGBUILD from the abs) with {{ic|--disable-lock-elision}}. Instead of patching the system libc in /usr/lib, copy the newly
 +
compiled {{ic|libpthread-2.25.so}} and {{ic|libc-2.25.so}} to {{ic|/opt/Xilinx/Vivado/2016.4/ids_lite/ISE/lib/lin64}}
 +
Don't forget to repeat this when glibc gets upgraded.
  
$ ls /var/cache/pacman/pkg/ | grep ncurses
+
=== xsct, xsdb, xmd, and tclsh segfault ===
  
or download it from the [https://archive.archlinux.org/packages/n/ncurses/ Arch Linux Archive]
+
The Xilinx Vivado command-line tools xsct, xsdb, xmd, and tclsh may crash with a message similar to the following:
  
After obtaining the package, simply extract {{ic|/usr/lib/libncurses.*}} to {{ic|/opt/Xilinx/Vivado/<version>/lib/lnx64.o/}}
+
Segmentation fault (core dumped) "$RDI_BINROOT"/unwrapped/"$RDI_PLATFORM$RDI_OPT_EXT"/rlwrap -rc -f "$RDI_APPROOT"/scripts/xsdb/xsdb/cmdlist -H "$HOME"/.xsctcmdhistory "$RDI_BINROOT"/loader -exec rdi_xsct "${RDI_ARGS[@]}"
  
 +
This is a problem with the rlwrap version bundled with Vivado, probably due to the lack of legacy vsyscall emulation in Arch Linux.
 +
To fix this issue, either drop rlwrap altogether (losing command history and auto-completion), or install {{Pkg|rlwrap}} from the official repo and edit the path to the rlwrap binary in the affected command startup script(s) from:
  
=== Synthesis segfaults ===
+
{{hc|head=/opt/Xilinx/{Vivado,SDK}/YYYY.Q/bin/{xsct,xsdb,xmd,tclsh}|output=
 +
# Use rlwrap to invoke the tool
 +
"$RDI_BINROOT"/unwrapped/"$RDI_PLATFORM$RDI_OPT_EXT"/rlwrap ...
 +
}}
  
See https://forums.xilinx.com/t5/Synthesis/Vivado-crashes-on-Arch-Linux-when-performing-synthesis/td-p/706847
+
To the following:
  
You'll need to recompile glibc (just take the PKGBUILD from the abs) with {{ic|--disable-lock-elision}}. Instead of patching the system libc in /usr/lib, copy the newly
+
{{hc|head=/opt/Xilinx/{Vivado,SDK}/YYYY.Q/bin/{xsct,xsdb,xmd,tclsh}|output=
compiled {{ic|libpthread-2.25.so}} and {{ic|libc-2.25.so}} to {{ic|/opt/Xilinx/Vivado/2016.4/ids_lite/ISE/lib/lin64}}
+
# Use rlwrap to invoke the tool
Don't forget to repeat this when glibc gets upgraded.
+
/usr/bin/rlwrap ...
 +
# OR run the tool without rlwrap
 +
#"$RDI_BINROOT"/loader -exec rdi_{xsct,xsdb,xmd,tclsh} "${RDI_ARGS[@]}"
 +
}}
  
 
=== Vivado HLS testbench error with GCC ===
 
=== Vivado HLS testbench error with GCC ===
  
See https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Testbench-error-with-gcc/td-p/756773
+
Vivado requires an older version of glibc (2.26 as of vivado 2018.1).
 +
 
 +
The solution proposed in [https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Testbench-error-with-gcc/td-p/756773 this thread] from Xilinx forums suggests to update the fixed headers shipped by Xilinx.
 +
 
 +
For vivado version 2016, run:
 +
 
 +
  # /opt/Xilinx/Vivado_HLS/<version>/lnx64/tools/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/install-tools/mkheaders /opt/Xilinx/Vivado_HLS/<version>/lnx64/tools/gcc/
 +
 
 +
For vivado 2017 and newer, run:
 +
 
 +
  # /opt/Xilinx/Vivado/2018.1/lnx64/tools/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/install-tools/mkheaders /opt/Xilinx/Vivado/2018.1/lnx64/tools/gcc
  
This error has been observed in Vivado 2016.4, 2017.1, and 2017.2.
+
=== Vivado Crashes with Wayland ===
  
Download an older version of GCC of GCC (2.17 or 2.18) and unpack it. Copy {{ic|glibc-2.17/misc/sys/cdefs.h}} to {{ic|$HLS_install_directory/lnx64/tools/gcc/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/sys/}} directory.
+
If Vivado crashes and the error file contains something similar to this:
  
Open {{ic|$HLS_install_directory/lnx64/tools/gcc/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/features.h}} and add the following:
+
{{hc|head=hs_err_pid*.log|output=
 +
#
 +
# An unexpected error has occurred (11)
 +
#
 +
Stack:
 +
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x923da9) [0x7fced0c19da9]
 +
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/server/libjvm.so(JVM_handle_linux_signal+0xb6) [0x7fced0c203f6]
 +
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x9209d3) [0x7fced0c169d3]
 +
/usr/lib/libc.so.6(+0x368f0) [0x7fcf0ea408f0]
 +
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42028) [0x7fceb1a20028]
 +
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42288) [0x7fceb1a20288]
 +
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/libawt_xawt.so(Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl+0x17c) [0x7fceb1a1867c]
 +
[0x7fcec0cb94cf]
 +
}}
  
{{hc|head=$HLS_install_directory/lnx64/tools/gcc/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/features.h|output=
+
Switch to using Xorg instead of Wayland. The version of Java Vivado uses has compatibility problems with Wayland.
/* Whether to use feature set F. */
 
#define __GLIBC_USE(F)  __GLIBC_USE_ ## F}}
 

Revision as of 18:38, 3 April 2019

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Write a PKGBUILD (Discuss in Talk:Xilinx Vivado#)

ArchLinux is not officially supported by Vivado, but as happens with Xilinx ISE WebPACK, most of its features can be used with a bit of hacking.

Prerequisites

Xilinx Vivado can be downloaded from its official website [1]. It's recommended to download "Vivado HLx <year>.<version>: All OS installer Single-File Download" tarball, but make sure not to be in a hurry, as it's a large download (near 19 GB). Update tarballs can also be downloaded and installed later.

Dependencies

Installer needs ncurses5 libs, and will not work with ncurses 6 available at official repos. You can work-around this problem by installing ncurses5-compat-libsAUR from the Arch User Repository. You will also need to install libpng12 and lib32-libpng12 for Xilinx Document Navigator to launch.

SDK 2018.3 (potentially also other versions) needs gtk2 library. You may need to install gtk2 if you are planning to use SDK.

Installation

You must install the main package, and it is also recommended to install the latest update patch.

Vivado and SDK

Warning: The patch below is not longer needed in the 2018.1 version. Just unpack and run the xsetup file.

Once downloaded and unpacked the tarball, the install script must be patched to be able to properly detect the machine architecture. You can do it by going to the directory where installer is extracted and running:

$ sed -i.original 's/uname -i/uname -m/' xsetup

Install script will be patched and original will be backed up as xsetup.original, just in case you need to restore it later. Once patched, just run the script; it should work perfect and install the suite without a problem:

# ./xsetup

It is recommended to install the suite at the default location /opt/Xilinx, as further instructions in this page will assume the suite is installed there.

Update patch

Warning: The patch below is not longer needed in the 2018.1 version.

It is recommended to install the latest update patch, and repeat the process each time a new patch is released. Note that update patches cannot be applied to WebPACK installs. If you installed Vivado WebPACK, skip this section.

To install the update, repeat the same hack used to install the suite. Once downloaded and unpacked, go to the directory containing the extracted tarball, patch the install script and run it:

$ sed -i.original 's/uname -i/uname -m/' xsetup
# ./xsetup

Licensing

Warning: In the 2018.1 Webpack version there is not longer required download an explicit license file, it just works.

If you already have a license file, you can load it using Vivado License Manager. Unfortunately, if you want to obtain a WebPack license, further steps are needed. Vivado installs old stdc++ libraries, causing problems when spawning programs not included with Vivado Suite (like your default browser). To fix this, do the following steps:

# cd /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/
# mv libstdc++.so.6 libstdc++.so.6.orig
# ln -s /usr/lib/libstdc++.so.6

Close any running Vivado Suite program, and launch license manager:

$ /opt/Xilinx/Vivado/2015.4/bin/vlm

If you try obtaining a WebPack license, your default browser should open, and the license should be generated normally. If Vivado License Manager fails to automatically load the generated license, download the .lic file, and manually load it.

Digilent USB-JTAG Drivers

To use Digilent Adept USB-JTAG adapters (e.g. the onboard JTAG adapter on the ZedBoard) from Vivado, you need to install the Digilent Adept Runtime.

Make sure you have installed fxloadAUR from the Arch User Repository .

To install the Digilent Adept Runtime, it is recommended to install digilent.adept.runtimeAUR from the Arch User Repository.

In addition, installing digilent.adept.utilitiesAUR may do good to configuring your board.

Linux cable driver

Run as root privilege:

$ {vivado_install_dir}/data/xicom/cable_drivers/lin64/install_script/install_drivers/install_drivers

Tips and tricks

Create .desktop files

Note: For 2018.3 and later, there is no need to write .desktop file manually

To ease launching programs, you can create the following .desktop files for Vivado IDE, SDK and DocNav:

~/.local/share/applications/Xilinx-VivadoIDE.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Xilinx Vivado IDE
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/Vivado/2018.1/settings64.sh && vivado"
Icon=/opt/Xilinx/Vivado/2018.1/doc/images/vivado_logo.png
Categories=Development;
Comment=Vivado Integrated Development Environment
~/.local/share/applications/Xilinx-SDK.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Xilinx SDK
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/SDK/2018.1/settings64.sh && xsdk"
Icon=/opt/Xilinx/SDK/2018.1/data/sdk/images/sdk_logo.png
Categories=Development;
Comment=Xilinx Software Development Kit
~/.local/share/applications/Xilinx-DocNav.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Xilinx Documentation Navigator 
Exec=sh -c "/opt/Xilinx/DocNav/docnav"
Icon=/opt/Xilinx/DocNav/resources/doc_nav_application_48.png
Categories=Development;
Comment=Xilinx Documentation Navigator

Enable display scaling

Start vivado, then set the scaling rate as follow:

Tools -> Setting -> Display -> Scaling

Troubleshooting

Synthesis segfaults

See https://forums.xilinx.com/t5/Synthesis/Vivado-crashes-on-Arch-Linux-when-performing-synthesis/td-p/706847

You'll need to recompile glibc (just take the PKGBUILD from the abs) with --disable-lock-elision. Instead of patching the system libc in /usr/lib, copy the newly compiled libpthread-2.25.so and libc-2.25.so to /opt/Xilinx/Vivado/2016.4/ids_lite/ISE/lib/lin64 Don't forget to repeat this when glibc gets upgraded.

xsct, xsdb, xmd, and tclsh segfault

The Xilinx Vivado command-line tools xsct, xsdb, xmd, and tclsh may crash with a message similar to the following:

Segmentation fault (core dumped) "$RDI_BINROOT"/unwrapped/"$RDI_PLATFORM$RDI_OPT_EXT"/rlwrap -rc -f "$RDI_APPROOT"/scripts/xsdb/xsdb/cmdlist -H "$HOME"/.xsctcmdhistory "$RDI_BINROOT"/loader -exec rdi_xsct "${RDI_ARGS[@]}"

This is a problem with the rlwrap version bundled with Vivado, probably due to the lack of legacy vsyscall emulation in Arch Linux. To fix this issue, either drop rlwrap altogether (losing command history and auto-completion), or install rlwrap from the official repo and edit the path to the rlwrap binary in the affected command startup script(s) from:

/opt/Xilinx/{Vivado,SDK}/YYYY.Q/bin/{xsct,xsdb,xmd,tclsh}
# Use rlwrap to invoke the tool
"$RDI_BINROOT"/unwrapped/"$RDI_PLATFORM$RDI_OPT_EXT"/rlwrap ...

To the following:

/opt/Xilinx/{Vivado,SDK}/YYYY.Q/bin/{xsct,xsdb,xmd,tclsh}
# Use rlwrap to invoke the tool
/usr/bin/rlwrap ...
# OR run the tool without rlwrap
#"$RDI_BINROOT"/loader -exec rdi_{xsct,xsdb,xmd,tclsh} "${RDI_ARGS[@]}"

Vivado HLS testbench error with GCC

Vivado requires an older version of glibc (2.26 as of vivado 2018.1).

The solution proposed in this thread from Xilinx forums suggests to update the fixed headers shipped by Xilinx.

For vivado version 2016, run:

 # /opt/Xilinx/Vivado_HLS/<version>/lnx64/tools/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/install-tools/mkheaders /opt/Xilinx/Vivado_HLS/<version>/lnx64/tools/gcc/

For vivado 2017 and newer, run:

 # /opt/Xilinx/Vivado/2018.1/lnx64/tools/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/install-tools/mkheaders /opt/Xilinx/Vivado/2018.1/lnx64/tools/gcc

Vivado Crashes with Wayland

If Vivado crashes and the error file contains something similar to this:

hs_err_pid*.log
#
# An unexpected error has occurred (11)
#
Stack:
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x923da9) [0x7fced0c19da9]
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/server/libjvm.so(JVM_handle_linux_signal+0xb6) [0x7fced0c203f6]
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x9209d3) [0x7fced0c169d3]
/usr/lib/libc.so.6(+0x368f0) [0x7fcf0ea408f0]
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42028) [0x7fceb1a20028]
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42288) [0x7fceb1a20288]
/opt/Xilinx/Vivado/2018.2/tps/lnx64/jre/lib/amd64/libawt_xawt.so(Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl+0x17c) [0x7fceb1a1867c]
[0x7fcec0cb94cf]

Switch to using Xorg instead of Wayland. The version of Java Vivado uses has compatibility problems with Wayland.