Skip to content

Reference Operating System Setup Guide

marcinwoj edited this page Dec 16, 2020 · 40 revisions

Introduction

NetFPGA-SUME development should be possible on any Linux distribution which supports the Xilinx Vivado Design Suite. We are currently using:

  • Xilinx Vivado Design Suite v2014.4 (NetFPGA-SUME code-base<release_1.6.0)
  • Xilinx Vivado Design Suite v2016.4 (NetFPGA-SUME code-base>=release_1.6.0).
  • Xilinx Vivado Design Suite v2020.1 (NetFPGA-SUME code-base>=release_1.10.0).

Xilinx provides a list of officially-supported Linux distributions for Vivado Design Suite 2014.4 under Architecture Support and Requirements section of UG973.

In this guide, we will provide instructions on setting up Vivado Design Suite, and programming solutions for NetFPGA-SUME board on Ubuntu 14.04.2 LTS. The screen shot are taken from a machine running Ubuntu 14.04 LTS. The same procedure can be followed to install Ubuntu 16.04 LTS.

Instructions on setting up Vivado Design Suite 2020.1 and Ubuntu 2020.4 LTS can be find under Installation of Vivado and Vitis 2020.2 on Ubuntu 2020.4 LTS and Network Setup for Ubuntu 2020.4 LTS.

Change host name

You can skip this step, if you don't wish to change the host name. Modifying the following files based to get your desired host name.

vi /etc/hostname

vi /etc/hosts

Note: source

Enable root login

Running Xilinx tools using root privileges saved us a lot of time by avoiding random errors (due to permissions and path settings). We have noticed that Vivado tools can also be run with user privileges with less hassles. But we are yet to test it.

Create your own configuration file (in our case 50-neels.conf)

vi /usr/share/lightdm/lightdm.conf.d/50-neels.conf

and write the following contents into it.

[SeatDefaults]
allow-guest=false
greeter-show-remote-login=false
greeter-show-manual-login=true

Then update root password

sudo su -
passwd root
{write your password}

Note: source_1 , source_2

Overcoming the error when you login as root.

if we login as root, we get an error due to the problem is in /root/.profile. This is because in graphical mode "mesg assumes that its standard input is connected to your terminal".

To overcome this problem, replace

mesg n

with:

if `tty -s`; then
mesg n
fi

Note: source

Delete other users

deluser username

Disable ipv6

We need to disable ipv6 as interferes with our python testing framework.

Append the following into /etc/sysctl.conf (Ubuntu 14.04) OR /etc/sysctl.d/99-sysctl.conf (Ubuntu 16.04)

   # Disable ipv6
   net.ipv6.conf.all.disable_ipv6=1
   net.ipv6.conf.default.disable_ipv6=1
   net.ipv6.conf.lo.disable_ipv6=1

Disable Avahi daemon

Please follow the instructions below to disable avahi daemon. As it interferes with the test infrastructure.

Edit the line with “start on” and add “never and”:

   # sudo vi /etc/init/avahi-daemon.conf
   start on (filesystem and started dbus)  ->  start on (never and filesystem and started dbus)      

Avoid the popup notice:

   # sudo vi /etc/default/avahi-daemon
   AVAHI_DAEMON_DETECT_LOCAL=0

Completely deactivate the service at boot time

   # sudo systemctl mask avahi-daemon
   # sudo systemctl mask avahi-daemon.socket
   # sudo systemctl stop avahi-daemon
   # sudo systemctl stop avahi-daemon.socket

Add under the first line of this sysv init script:

   # vi /etc/init.d/avahi-daemon
   #!/bin/sh
   +exit 0

Note: source

Network Manager configuration

The following procedure is suggested as it helps us to manage and control the network interfaces by ourself instead of Network Manager.

Please update the MAC address of devices that you don't want to be configured by Network Manager by editing vim /etc/NetworkManager/NetworkManager.conf. An example configuration is shown below. Network Manager Configuration

Update the interface file vim /etc/network/interfaces with the right IP address and interface names as shown in the image below.

Interface Configuration

Network Interface Names (Ubuntu 16.04)

Ubuntu 16.04 will automatically assign predictable, stable network interface names for all local Ethernet, WLAN and WWAN interfaces (ex. enp0s31f6). To have the old name assignment you need to edit your /etc/default/grub

GRUB_CMDLINE_LINUX="" -> GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

sudo update-grub && reboot

Kernel version supported

Due to an API change, the NIC driver may compile improperly on some versions of the Linux kernel. We have reports of this issue on Ubuntu 16.04.4 x64 with the kernel 4.13.0.

While we work on a new release to address the issue, the recommended fix is to install (instructions here) a different version of the Linux kernel (4.10.0.42-generic).

Additional Required Packages

Depending on how you install the Linux distributions, the operating system can be configured with different set of packages. The following list of packages are needed so that your environment is ready for development for NetFPGA-SUME board. Please install the following packages using package manager that comes with your distribution, e.g. apt for Ubuntu.

First update all your packages using the following command.

$ apt-get update

To run package installation in Ubuntu:

$ apt-get install <package_name>

To search package in Ubuntu:

$ apt-cache search <regular_expression>

Here are the list of mandatory packages:

Package How to Install Used for
gcc g++ apt-get install gcc g++ installing gcc and gcc C++ compiler (package gcc-g++ on other distos)
minicom apt-get install minicom RS-232 link to NetFPGA-SUME card
libusb-devel apt-get install libusb-dev Third-party driver for Xilinx JTAG programming cable
glibc.i686 apt-get install libc6-i386 32-bit statically-linked Microblaze compiler and binutils
pySerial apt-get install python-serial Python access for the serial port
wxpython apt-get install python-wxgtk3.0 Python GUI library
scapy apt-get install python-scapy Packet generator / receiver
Install ia32-libs apt-get install lib32z1 lib32ncurses5 libbz2-1.0 Otherwise, if you run mb-gcc, it will report: mb-gcc file not found error.
Install ia64-libs apt-get install lib64z1 lib64ncurses5 libbz2-1.0 Otherwise, if you run mb-gcc, it will report: mb-gcc file not found error.
Install 32-bit libstdc++ apt-get install lib32stdc++6 Otherwise, if you run mb-gcc, it will report libstdc++ cannot be found
Install 64-bit libstdc++ apt-get install lib64stdc++6 Otherwise, if you run mb-gcc, it will report libstdc++ cannot be found
Install libgtk apt-get install libgtk2.0-0:i386 GTK Library
Install libstdc++6 apt-get install libstdc++6:i386 Otherwise, if you run mb-gcc, it will report libstdc++ cannot be found
Install development tools apt-get install linux-headers-$(uname -r) build-essential linux headers
git apt-get install git for git repository
patch apt-get install patch for patching files
vim apt-get install vim for vim users

Patching pySerial

Note : (Please skip this step if you are using the NetFPGA_SUME code-base release_1.2.0 or newer)

Open /usr/lib/python2.7/dist-packages/serial/tools/list_ports_posix.py

Insert the following line after line 67:

dev = popen(['cat', sysfs_path + '/devnum'])

Serial Port Privilege

You need change /dev/ttyUSB1 (usually this one) to rw-rw-rw- so that your user will have access to serial port:

$ sudo chmod 666 /dev/ttyUSB1

Install Xilinx Vivado Design Suite 2016.4

( for NetFPGA-SUME release_1.6.0 or newer )

Xilinx Vivado Design Suite 2016.4 will work on most of the Linux distributions. You can download Xilinx Vivado Design Suite 2016.4 from here. You can use webinstall or download the full installation package. If you download the full package, please check the MD5 SUM Value before installation to make sure that the package is not corrupted.

Vivado Installation Configuration

If you downloaded webinstall, you can use the following commands:

$ chmod +x Xilinx_Vivado_SDK_2016.4_0124_1_Lin64.bin

$ ./Xilinx_Vivado_SDK_2016.4_0124_1_Lin64.bin

If you downloaded the full package, follow the next two steps: To extract the package, you can use the following command:

$ tar zxvf Xilinx_Vivado_SDK_2016.4_0124_1.tar.gz

Get into the extraction directory (usually Xilinx_Vivado_SDK_2016.4_0124_1), run xsetup with root previlidge.

$ sudo ./xsetup

If you downloaded webinstall, you will see a screen like this. Login and continue. Vivado Installation Configuration

The following steps are common to all installation modes:

Read and Accept License Agreements.

Vivado Installation Configuration

Select Vivado System Edition in Select Edition to Install page. In Vivado System Edition page, deselect Vivado High Level Synthesis (if you are not going to use it), select Software Development Kit and Install Cable Drivers as shown in the figure below:

Vivado Installation Configuration Vivado Installation Configuration

The installation may takes several minutes to half an hour to finish depending on your computer performance.

After the installation, to start Vivado Design Suite, open a command prompt, source the environment setting script and start vivado:

$ export XILINX_PATH=/opt/Xilinx/Vivado/2016.4
$ source /opt/Xilinx/Vivado/2016.4/settings64.sh
$ export SWT_GTK3=0 (Resolve a SDK bug in Ubuntu 16.04)

$ vivado &

To test if the Vivado Cable driver works or not, connect NetFPGA-SUME to your PC, turn on the power supply for NetFPGA-SUME board, and click Open Hardware Manager in Vivado Welcom Window. Click Open Target on the green bar in the Hardware Manager window, and select Open New Target.... The Open New Hardware Target dialog will appear and click Next until Select Hardware Target tab.

NetFPGA-SUME Adept Tools Test

In the tab, you should see a Xilinx_tcf type target shows up in the Hardware Targets table, and xc7vx690t and xc2c512 device showed up in Hardware Devices table. If you see both of them available, the driver has been successfully installed.

NetFPGA-SUME Adept Tools Test

Install Xilinx Vivado Design Suite 2014.4

( for NetFPGA-SUME release_1.5.0 or older )

Xilinx Vivado Design Suite 2014.4 will work on most of the Linux distributions. You can download Xilinx Vivado Design Suite 2014.4 from here. You can use webinstall or download the full installation package. If you download the full package, please check the MD5 SUM Value before installation to make sure that the package is not corrupted.

If you downloaded webinstall, you can use the following commands:

$ chmod +x Xilinx_Vivado_SDK_2014.4_1119_1_Lin64.bin

$ ./Xilinx_Vivado_SDK_2014.4_1119_1_Lin64.bin

If you downloaded the full package, follow the next two steps: To extract the package, you can use the following command:

$ tar zxvf Xilinx_Vivado_SDK_2014.4_1119_1.tar.gz

Get into the extraction directory (usually Xilinx_Vivado_SDK_2014.4_1119_1), run xsetup with root previlidge.

$ sudo ./xsetup

The following steps are common to all installation modes:

Read and Accept License Agreements and select Vivado System Edition in Select Edition to Install page. In Vivado System Edition page, deselect Vivado High Level Synthesis (if you are not going to use it), select Software Development Kit and Install Cable Drivers as shown in the figure below:

Vivado Installation Configuration

The installation may takes several minutes to half an hour to finish depending on your computer performance.

After the installation, to start Vivado Design Suite, open a command prompt, source the environment setting script and start vivado:

$ export XILINX_PATH=/opt/Xilinx/Vivado/2014.4
$ source /opt/Xilinx/Vivado/2014.4/settings64.sh

$ vivado &

To test if the Vivado Cable driver works or not, connect NetFPGA-SUME to your PC, turn on the power supply for NetFPGA-SUME board, and click Open Hardware Manager in Vivado Welcom Window. Click Open Target on the green bar in the Hardware Manager window, and select Open New Target.... The Open New Hardware Target dialog will appear and click Next until Select Hardware Target tab. In the tab, you should see a Xilinx_tcf type target shows up in the Hardware Targets table, and xc7vx690t and xc2c512 device showed up in Hardware Devices table. If you see both of them available, the driver has been successfully installed.

NetFPGA-SUME Adept Tools Test

Install / Check Xilinx Licenses

See the Licensing web-page.

Access Xilinx Documentation with DocNav (optional)

See corresponding section in Reference Operating System Setup Guide for Vivado 2015, method should also work for DocNav as part of Vivado 2014.

Installation of Digilent Adept Tools

You need to install Digilent Adept Tools to write bitfiles to the Flash. The on-board Flash is divided into 4 sections and you can configure which section to load the bitfile from when the board is powered up (please refer to the FPGA configuration section of NetFPGA-SUME Reference Manual). Digilent Adept Tools can be downloaded from Software->Adept2 section on Digilent Website. You need to download and install both Adept 2.x.y Runtime and Adept 2.x.y Utilities. Both of them are distributed in three format: DEB package, RPM package or compressed file with installation scripts. You can use DEB package for Ubuntu distribution.

To install the DEB package in Ubuntu:

$ sudo dpkg -i digilent.adept.runtime_2.x.y_amd64.deb

$ sudo dpkg -i digilent.adept.utilities_2.x.y-amd64.deb

To test the installation of Digilent Adept Tools, power on the NetFPGA-SUME board and connect it to your PC using the micro-USB cable. Open up a terminal and in command line:

  • Enumerate the devices (discover and list) with

$ djtgcfg enum

  • Initialize JTAG Scan Chain

$ djtgcfg init -d NetSUME

  • Enumerate devices with dsumecfg

$ dsumecfg enum

  • Configure NetFPGA-SUME with bitfile stored in Flash section 0

$ dsumecfg reconfig -d NetSUME -s 0

and you should get something like the screen shot below:

NetFPGA-SUME Adept Tools Test

Clone this wiki locally