Getting Started

 

If you already have Vivado installed and would like to extend your trial license skip to Load License (Existing Install)

If you are developing on the AWS FPGA Developer AMI skip to Install AWS F1 Repo and beware of the one extra step required under Vivado Simulation/Synthesis.

If you are just getting started and do not have Vivado installed, begin below.

 

 

This page describes how to install Vivado, SDAccel, and an extended competition license from Xilinx for on-premise development. With this install you will be able to run both Vivado and the AWS F1 SDAccel flow locally.

This will work on AWS EC2 but if you are working on AWS we highly recommending using the AWS FPGA AMI as the tools and license are pre-installed. See https://github.com/supranational/vdf-fpga/blob/master/docs/aws_f1.md, and you can jump forward in this guide to see how to run hardware emulation, SDAccel synthesis, Vivado behavioral simulation, and Vivado out-of-context synthesis.

If Vivado is already installed: This assumes a from scratch install. If you already have Vivado installed and want to extend the license or add SDAccel you can skip ahead to Load License. It is important to note that if you originally installed Vivado using sudo then it must be run with sudo to add or remove devices!

 

Host/OS

This document assumes Ubuntu 18.04 LTS. The tools and OS require about 63GB of disk space.

Generate License

In order to use the extended competition license you will need to redeem your code at https://www.xilinx.com/getlicense.

After logging in (you will need an account) enter your voucher number and select “Redeem Now”.

Select the licenses below and click “Generate Node-Locked License”.

You will have to provide the host MAC address to bind the license to. Be sure to choose a host where you will have long term access. You can find the MAC address by running ‘ifconfig’ in Linux. Look for the wired ethernet connection, then the colon separated 12 digit hex value after “ether”.

The new license will be emailed to you. You will need to download it and make it available on the target host.

Installing Vivado

Download and Launch

Download the “Vivado Design Suite - HLx Editions - 2018.3 Full Product Installation” Web installer from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/2018-3.html – Be sure to get the installer, not the update!

Once you have the file start the installation process:

1 2 3 4 chmod 755 Xilinx_Vivado_SDK_Web_2018.3_1207_2324_Lin64.bin sudo mkdir -p /tools/Xilinx sudo chown $USER:$USER /tools/Xilinx ./Xilinx_Vivado_SDK_Web_2018.3_1207_2324_Lin64.bin

!!! DO NOT UPGRADE !!!

AWS does not support 2019.1 yet! Click ‘Continue’ and not ‘Get Latest’.

Install HL Design Edition

Devices

Install the minimum set of required devices. From here click Next, use the default installation directory, say Yes to create the directory, and Install to proceed.

Load License (New Install)

Once the install is done the License install window will appear.

Select Load License, then Copy License, and browse to the license file you generated earlier.

Load License (Existing Install)

If you are looking to extend your license or add SDAccel, launch Vivado then select Help -> Manage License…

Select Load License, then Copy License, and browse to the license file you generated earlier.

License Status

After loading the license select View License Status. It resemble the screen below. In particular you should see PartialReconfiguration, XCVU9P, and ap_opencl.

Add Vivado to path

Add Vivado to your path. You can also append this line to ~/.profile to add it to future login sessions.

1 export PATH=/tools/Xilinx/Vivado/2018.3/bin:$PATH

 

Install SDAccel

SDAccel (SDx) is the environment used by AWS F1. In order to develop bitstreams for F1 you will need to install SDx and associated tools.

Add Tools

Launch Vivado, then select Help -> Add Design Tools or Devices...

Note that if Vivado was installed with sudo you must run it again with sudo to add devices or you will see a blank screen when you attempt to install SDx.

SDx Install

Select SDx Development Environments

SDAccel, Spartan-7, and UltraScale+ should be enabled.

If you get a blank screen after clicking Next see the note above about running with sudo.

toolchain.sh error

If you receive this error you can ignore it as it does not seem to impact the installation.

Add SDx to Path

You can also add these to the end of your ~/.profile file so that they are automatically set in the future.

1 2 export XILINX_SDX=/tools/Xilinx/SDx/2018.3 export PATH=$PATH:$XILINX_SDX/bin

Install XRT

The Xilinx runtime is required to build SDAccel targets.

Install Dependencies

1 2 sudo apt-get update sudo apt-get install make g++ gcc ocl-icd-libopencl1 opencl-headers ocl-icd-opencl-dev python3 libgmp-dev -y

Use bash instead of dash

Various scripts expect a full shell, not the minimal dash shell shipped with Ubuntu.

http://www.humbug.in/2012/configure-ubuntu-to-use-bash-as-default-shell-instead-of-dash/

Run the following command and select “No” when prompted.

1 sudo dpkg-reconfigure dash

Install XRT from GitHub

https://www.xilinx.com/html_docs/xilinx2019_1/sdaccel_doc/installing-sdx-environments-tik1504034261337.html

https://github.com/Xilinx/XRT/blob/master/src/runtime_src/doc/toc/build.rst

1 2 3 4 5 6 7 8 mkdir -p ~/src cd ~/src git clone https://github.com/Xilinx/XRT cd XRT ./src/runtime_src/tools/scripts/xrtdeps.sh cd build ./build.sh sudo apt install --reinstall ./Release/xrt_201920.2.3.0_18.04-xrt.deb -y

Create /bin/env

This is expected by some of the AWS scripts.

1 sudo ln -s /usr/bin/env /bin/env

Fix up xrt libraries

On Ubuntu there seem to be compatibility issues with the xrt version of libstdc++.so.6. Change it to use the OS installed libary.

1 2 3 4 5 sudo mv /opt/xilinx/xrt/lib/libstdc++.so.6 /opt/xilinx/xrt/lib/libstdc++.so.6_orig sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/xilinx/xrt/lib/libstdc++.so.6 /opt/xilinx/xrt/bin/xbutil validate # Expected result: ERROR: No card found

Install AWS F1 repo

Clone the AWS F1 environment.

1 2 3 4 export AWS_FPGA_REPO_DIR=~/src/project_data/aws-fpga git clone https://github.com/aws/aws-fpga.git $AWS_FPGA_REPO_DIR cd $AWS_FPGA_REPO_DIR source sdaccel_setup.sh

Run hardware emulation

1 2 3 4 5 6 7 cd ~/src git clone https://github.com/supranational/vdf-fpga.git cd vdf-fpga/msu source scripts/sdaccel_env.sh make clean; make hw_emu # Expected result: PASSED 1 iterations

If sdaccel_setup.sh fails to complete successfully for any reason it tends to leave the shell in a broken state. This can lead to strange tool errors. In this case it is best to start fresh from a new shell.

Run synthesis

Once hardware emulation completes you can perform synthesis to generate a bitstream. This takes several hours.

1 2 cd ~/src/vdf-fpga/msu make clean; make hw

Vivado Simulation/Synthesis

You can also run behavioral simulation and out-of-context synthesis in Vivado. This provides a more interactive environment for development with fast simulation, waveform viewing, GUI based synthesis and design exploration. It is convenient to develop and tune the design here prior to using SDAccel.

To run Vivado choose either the “simple” or “Ozturk” multiplier and launch Vivado using the provided script.

1 2 3 4 5 6 7 # Simple cd msu/rtl/vivado_simple ./run_vivado.sh # Ozturk cd msu/rtl/vivado_ozturk ./run_vivado.sh

 

NOTE: AWS FPGA AMI ONLY

If you are running this on an AWS FPGA AMI the above commands will fail due to lack of support for the Spartan-7 family. You can manually select the vu9p part by running the following sed command in vivado_simple of vivado_ozturk.

1 2 sed 's/xc7s100fgga676-2/xcvu9p-flga2104-1-e/g' msu.tcl > msu2.tcl mv msu2.tcl msu.tcl

NOTE: AWS FPGA AMI ONLY

Behavioral Simulations

You can run behavioral simulations using the GUI as shown. The test is self checking and should print “SUCCESS”.

In addition to “SUCCESS”, the simulation prints cycles per squaring statistics. This, along with synthesis timing results, provides an estimate of latency per squaring.

Synthesis

To perform synthesis first make sure the correct part (vu9p) is selected by navigating to Settings → Project Device:

Note: If you are an AWS FPGA Developer AMI the vu9p should already be selected

Select part xcvu9p-fsgd2104-2L-e:

Run out-of-context synthesis + Implementation to understand and tune performance. A pblock is set up to mimic the AWS F1 Shell exclusion zone. In our experience these results are pretty close to what you will get on F1 and and provide an easier/faster/more intuitive interface for improving the design.