I don't hide the fact that I'm a big fan of the Xilinx toolset, but I understand that installing them and getting started can be quite the task for a beginner. It is for this reason that I'm always working on staying up to date and creating new install guides to fill in where I find gaps because there are definitely overall flow changes that occur with pretty much every new release. Over the last couple of months I started migrating to the 2021 versions of the Xilinx tools, and specifically this past week I installed 2021.2. After finding a few gaps in the required package dependencies mentioned anywhere, I decided it was time to write this up again since the last time was for version 2019.2.
I've found you should have at least 300GB of free space available to install all of the Xilinx tools and 32GB - 64GB of RAM with at least 8 CPU cores you can dedicate to them.
System ConfigurationAll of the Xilinx tools require 32-bit libraries at some point in time to compile. DocNav requires several 32-bit libraries and PetaLinux needs 32-bit architectures for cross compilation. Therefore the first step is to add the 32-bit architecture to your Ubuntu system. Since there is a 99.999% chance your computer has an Intel based processor, add i386 using the package management system, dpkg:
~$ sudo dpkg --add-architecture i386
Change Ubuntu's shell from dash to bash as PetaLinux is only compatible with bash:
~$ sudo dpkg-reconfigure dash
The next step is to install all of the required package dependencies for the Xilinx tools. The list I've comprised includes everything required from a completely fresh/clean installation of Ubuntu 18.04.5. I comprised this exhaustive list after much trial and error because I found that there wasn't a clear distinct list of the package dependencies for Vivado/Vitis. I was able to find list of package dependencies for PetaLinux here, which are also included in my list below. There are also a few I found just by resolving errors thrown by Vivado and Vitis to the command line while using their respective GUIs.
~$ sudo apt-get update
~$ sudo apt-get install <package>
List of packages to install:
lib32stdc++6
libgtk2.0-0:i386
libfontconfig1:i386
libx11-6:i386
libxext6:i386
libxrender1:i386
libsm6:i386
libqtgui4:i386
xinetd
iproute2
gawk
gcc
net-tools
ncurses-dev
openssl
libssl-dev
flex
bison
xterm
autoconf
libtool
texinfo
zlib1g-dev
gcc-multilib
build-essential
automake
screen
putty
pax
g++
python3-pip
xz-utils
python3-git
python3-jinja2
python3-pexpect
debianutils
iputils-ping
libegl1-mesa
libsdl1.2-dev
pylint3
python3
cpio
tftpd-hpa
gnupg
zlib1g:i386
haveged
perl
liberror-perl
mtd-utils
xtrans-dev
libxcb-randr0-dev
libxcb-xtest0-dev
libxcb-xinerama0-dev
libxcb-shape0-dev
libxcb-xkb-dev
openssh-server
util-linux
sysvinit-utils
cython
google-perftools
Create TFTP ServerPetaLinux also requires a TFTP server service to support TFTP booting on a target system. In the /etc/xinetd.d/ directory create a TFTP service file:
~$ sudo gedit /etc/xinetd.d/tftp
And configure it as such:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
Then create the directory for the TFTP service to pull files from during the target boot process such as the boot image file (BOOT.bin), kernel, device tree, etc. Give the directory the appropriate permissions and give ownership to the same user specified in the TFTP service.
~$ sudo mkdir /tftpboot
~$ sudo chmod -R 777 /tftpboot
~$ sudo chown -R nobody /tftpboot
Stop and restart the host machine's extended internet services for these changes to take effect.
~$ sudo /etc/init.d/xinetd stop
~$ sudo /etc/init.d/xinetd start
Add Your User to Dialout GroupAdd your local user to the dial out group if you haven't already so Vivado and Vitis can access the computer's USB ports for serial communication with FPGA targets.
~$ sudo adduser $USER dialout
At this point, I recommend rebooting your machine to make sure everything is implemented.
Run Vitis InstallerWhile the downloads website has separate tabs for Vivado and Vitis, the Vitis installer also includes the option to install Vivado. The Vivado installer however only contains the option to install Vivado and if you try to then run the Vitis installer later, it will force you to install it in a different location. This can get messy very quickly, so I highly recommend only using the Vitis installer because it also contains the option to only install Vivado. The difference is that you'll be able to run the installer again later and install Vitis in the same location with Vivado.
If using the single file all-OS installer, extract the installer folder from the downloaded compressed package and run the setup installer GUI script:
~$ sudo ./Dowloads/Xilinx_Unified_2021.2_1021_0703/xsetup
If using the Linux self-extracting web installer, give it the appropriate permissions to make it executable and run it:
~$ sudo chmod 777 ./Downloads/Xilinx_Unified_2021.2_1021_0703_Lin64.bin
~$ sudo ./Downloads/Xilinx_Unified_2021.2_1021_0703_Lin64.bin
The GUI by default will install Vitis and Vivado to /tools/Xilinx/. You can change this if desired, but I highly recommend leaving it in this location.
Test installation by launching Vivado and Vitis. First, launch Vivado:
~$ source /tools/Xilinx/Vivado/2021.2/settings64.sh
~$ vivado
Close Vivado or open a new terminal window and launch Vitis:
~$ source /tools/Xilinx/Vitis/2021.2/settings64.sh
~$ vitis
Run PetaLinux InstallerYou can install the PetaLinux mostly wherever you prefer, but I like to keep all of the Xilinx tools in the same place so I create a PetaLinux directory in the same directory Vivado and Vitis installed to following the version format as well:
sudo mkdir -p /tools/Xilinx/PetaLinux/2021.2/
Give the directory 755 permissions (making the folder globally read-execute):
sudo chmod -R 755 /tools/Xilinx/PetaLinux/2021.2/
Give the PetaLinux installer 777 permissions:
sudo chmod 777 ./Downloads/petalinux-v2021.2-final-installer.run
Change ownership of the directory you’re installing PetaLinux in to the user:
sudo chown -R <user>:<user> /tools/Xilinx/PetaLinux/2021.2/
Run the PetaLinux installer:
~/Downloads/petalinux-v2021.2-final-installer.run /tools/Xilinx/PetaLinux/2021.2/
Then test the installation by turning Webtalk on/off:
~$ source /tools/Xilinx/PetaLinux/2021.2/settings.sh
~$ petalinux-util --webtalk off
~$ petalinux-util --webtalk on
NotesIt's worth noting that a PetaLinux project can not be built offline without access to the internet unless specifically configured to do so. This involves downloading the proper repositories locally to your machine and pointing the PetaLinux project to it, which I'll cover in a different post. This is something that you'll have to do to each PetaLinux project individually that you want to be able to run a build on offline.
Vivado also requires a network connection to download/install new development board preset files. So you'll want to make sure you can access the internet at least the first few times you create a new project.
Comments