How to set up AMD Vivado and Vitis on MacOS

A wave of data in front of binary code

AMD (formerly Xilinx) makes a number of great products that we have worked with in the past. If you haven’t used an FPGA-based platform before, it is amazing what you can do with these devices. You can literally build hardware accelerators, meet hard real-time deadlines in silicon, make changes to the FPGA logic in the field with OTA updates, and many more applications. I think we’re just getting started with understanding how to apply FPGAs to real-world problems.

With this complexity comes a huge amount of complexity in the toolset. Imagine the complexity that goes into compilers – and then imagine configuring asynchronous logic in silicon across millions of configuration settings – and you’ll understand how complex these tools need to be to enable development. Additionally, most FPGAs these days contain a “hard core” and configurable logic. The hard core is a traditional CPU, fixed in the silicon. The FPGA fabric connects to the hardcore to allow an infinite number of configuration options. The AMD Unified Installer for 2023.2 tools requires over 256GB!!! Yikes!

The Unified Installer contains both Vivado and Vitis. Vivado Design Suite is a platform for synthesis and analysis of hardware description language (HDL) designs – the FPGA portion of the device. Verilog and VHDL are the two most popular HDLs, and they are used with FPGAs to design for the configurable portion of the silicon. Vitis IDE, on the other hand, is an embedded software development platform targeted towards AMD embedded processors. With Vitis, the developer can debug their application code together with the hardware designs created with Vivado.

Due to this enormous complexity, the toolset requires a fairly specific environment to run in. At DojoFive we’re mostly a Mac shop, but AMD prefers to run on Windows and several Linux distributions. We’ll setup an example environment for the Zynq 7Z007S on an Avnet MiniZed development board to show you how we do it – and hopefully speed up your own development in the process!

Create a Virtual Machine

Since macOS is not one of the supported operating systems for installing Vivado and Vitis, a virtual machine is needed for hosting a supported OS. This can be done with software such as VirtualBox and Parallels. In this blog post, we are using Parallels. To test out the software, you can download the 14-day free trial version and follow the installation instructions on their site.Once Parallels is installed, we want to download an ISO image to create a virtual machine. Since Ubuntu is one of the supported OSes, download an Ubuntu ISO image. Vivado and Vitis 2023.2 only work on the following versions of Ubuntu, so take care that your ISO is of one of these versions. If using a different version of Vivado,  that versions supported OSes should be referenced and adhered to.


Supported Ubuntu Linux Versions

– 18.04.1 LTS
– 18.04.2 LTS
– 18.04.3 LTS
– 18.04.4 LTS
– 18.04.5 LTS
– 18.04.6 LTS
– 20.04.2 LTS
– 20.04.3 LTS
– 20.04.4 LTS
– 20.04.5 LTS
– 20.04.6 LTS
– 22.04 LTS
– 22.04.1 LTS
– 22.04.2 LTS (64-bit)

What if You Use the Wrong Ubuntu Version

Vivado will throw an error when you try to open it on an Ubuntu version that is not supported. When that happens, you have to download the correct ISO image, create a new virtual machine, and install Vivado again. To remove the unsupported virtual machine, go to the control center, right-click on the virtual machine, and click “Remove <VM_NAME>…`

Defining and Creating the VM

On the Parallels window, select “Install Windows or another OS from a DVD or image file” and point it to the ISO image you just downloaded. Prior to clicking “Create”, check “Customize settings before installation” and configure the installation’s disk size to at least 300GB. Vivado and Vitis are also notorious memory hogs, so allocate as much of your system’s memory as is practical; at least 12GB is recommended. Lastly, allocating more cores, if possible, to the VM will help speed synthesis and implementation along.  Continue with the instructions to create the Ubuntu virtual machine.

Right-click on the Parallels icon on the top right of your desktop and click on Control Center

Install Dependencies

Before installing the toolchain, a few system setup steps are needed. 

First, some additional packages are required to avoid the installation from hanging indefinitely towards the end. Run the following in a terminal to install them. 

sudo apt-get install -y libncurses5-dev libtinfo5 libstdc++6 libgtk2.0-0 dpkg-dev git

Next, a toolchain installation folder needs to be created. 

sudo mkdir /tools
sudo chown <your_user> /tools
mkdir /tools/Xilinx

Download Vitis and Vivado Design Suite

Once the VMis created, download the latest version of AMD Unified Installer: Linux Self Extracting Web Installer from the AMD website. Since the installer is a .bin file, run it with the following steps.

# Make the .bin file executable
$ chmod +x 
./FPGAs_AdaptiveSoCs_Unified_2023.2_1013_2256_Lin64.bin

# Run the installer
$ 
./FPGAs_AdaptiveSoCs_Unified_2023.2_1013_2256_Lin64.bin

On the installer window, select Vitis to be installed. It will include Vivado Design Suite. To reduce the install size, remove all devices except the one used in your project on the “customize your installation” screen. For our example Zynq-7000 project, only Zynq-7000 is selected.

Setup Board Definition Files

In order to have Vivado recognize the Avnet MiniZed board and build design projects for it, you’ll need the MiniZed’s board definition files. These files can be cloned from Avnet’s bdf repository and placed into the proper Vivado directory.

# Download MiniZed bdf files
cd ~/
git clone https://github.com/Avnet/bdf.git
cp -r ~/bdf/minized/ /tools/Xilinx/Vivado/<version>/data/xhub/boards/XilinxBoardStore/boards/Xilinx
rm -rf ~/bdf

Run Vivado

Finally, to run Vivado or Vitis on Ubuntu, you need to source the settings64.sh file and create a directory as the workspace. You can also add the source commands to the ~/.bashrc file so that you don’t have to source the shell script every time you want to run Vivado or Vitis. Below are the steps to setup source commands, create Vivado and Vitis workspaces, and launch Vivado/Vitis. Execute the setup steps and launch Vivado. Vitis does not need to be launched at this point. 

# Add the source commands of both Vivado and Vitis to the ~/.bashrc file 
# in your virtual machine (Only have to do it once)
source /tools/Xilinx/Vivado/<VERSION>/settings64.sh
source /tools/Xilinx/Vitis/<VERSION>/settings64.sh

# Create a directory as the workspace (Only have to do it once)
mkdir ~/<VIVADO_WORKSPACE>
mkdir ~/<VITIS_WORKSPACE>

# Run Vivado
cd ~/<VIVADO_WORKSPACE>
vivado &

# Run Vitis
cd ~/<VITIS_WORKSPACE>
vitis &
A terminal example of Vitis running

Once Vivado launches, select Window > Tcl Console. Vivado and Vitis make use of the Tcl scripting language for automating builds and performing actions programmatically. In the console, enter:

get_board_parts *minized*

Confirm the console outputs an entry containing “avnet.com:minized”; this verifies the board definition files were installed into the correct location.

Vitis Brief

Vitis provides an environment for development of embedded applications running on AMD ARM devices, as well as, perhaps more interestingly, means to integrate AI engines and compile C/C++ into a hardware implementation capable of running on programmable logic (i.e. an FPGA)! The full suite of Vitis capabilities is beyond the scope of this blog post, as are the design flows utilizing both Vivado and Vitis together.

Conclusion

TADA! You’ve done it! This setup is a great means to try out AMD’s FPGA and embedded development toolchain offerings. For those ready to take the next step into a more serious project on AMD hardware, a dedicated, non-VM Linux setup is highly recommended to maximize performance and avoid the very lengthy build times. 

There is a pretty steep learning curve to using these tools, but a number of good resources exist. Check out AvNet’s ZedBoard pages, Element14, and AMD’s documentation.And please let us know if you’re using the AMD tools or any FPGA in your embedded work. We’d love to hear about what others are doing and how we can all bring embedded to the next level!Dojo Five brings modern tools, techniques, and best-practices from the web and mobile development environments, paired with leading-edge innovations in firmware to our customers to help them build successful products and successful clients. We have talented engineers on-hand ready to help you with all aspects of your EmbedOps journey. Bring your interesting problems that need solving – we are always happy to help out. You can reach out at any time on LinkedIn or through email!

Sign up to get our content updates!

Unlock the full potential of your embedded projects with our expert insights! Dive into our comprehensive resources to stay ahead in firmware development. Subscribe now to get the latest best practices and guides delivered straight to your inbox.

Sign Up for Updates

Leave a Reply