Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Vitis edition)

Introduction

The author provides Debian GNU / Linux for Ultra96 / Ultra96-V2 (ZynqMP) 1. In addition, XRT (Xilinx Runtime) is an environment for running programs developed in the development environment (Vitis) provided by Xilinx on the platform 2.

Originally, XRT for MPSoC Edge Device only works in the Linux environment (Petalinux) provided by Xilinx, but this article has some steps to get XRT to work on Debian GNU / Linux for Ultra96 / Ultra96-V2. I will explain it separately in the part.

This article describes how to target Ultra96 / Ultra96-V2 with XRT installed and run and debug programs from the Vitis IDE on the host PC.

Caution

__ The Debian Package presented in this article is not official by Xilinx. __

Target preparation

Use Ultra96 / Ultra96-V2 with XRT installed as the target. For details on how to install XRT on Ultra96 / Ultra96-V2, refer to [Installation].

It is not enough to have XRT installed on the target in order to run and debug programs on the target from the Vitis IDE. The following additional items are required on the target side.

Preparation of TCF-Agent

TCF (Target Communication Framework) 3 is a lightweight and extensible network protocol for driving embedded systems (targets). The Vitis IDE is based on eclipse and communicates with the target via TCF. Therefore, in order to control the target from the Vitis IDE, it is necessary to run a server program called TCF-Agent on the target.

Build TCF-Agent

The source code for TCF-Agent can be found at the following URL:

You can download the repository here and build it on Ultra96 / Ultra96-V2. In this article, we have already built and prepared a Debian Package, so we will install it using that.

Installation of TCF-Agent

A pre-built Debian Packaged TCF-Agent is available at the following URL. Download and install.

shell$ git clone --recursive --depth=1 -b 1.7.0-1 git://github.com/ikwzm/tcf-agent-dpkg
shell$ cd tcf-agent-dpkg
shell$ sudo apt install ./tcf-agent_1.7.0-1_arm64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'tcf-agent' instead of './tcf-agent_1.7.0-1_arm64.deb'
The following NEW packages will be installed:
  tcf-agent
0 upgraded, 1 newly installed, 0 to remove and 69 not upgraded.
After this operation, 3,298 kB of additional disk space will be used.
Get:1 /home/fpga/work/tcf-agent-dpkg/tcf-agent_1.7.0-1_arm64.deb tcf-agent arm64 1.7.0-1 [689 kB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Selecting previously unselected package tcf-agent.
(Reading database ... 114950 files and directories currently installed.)
Preparing to unpack .../tcf-agent_1.7.0-1_arm64.deb ...
Processing triggers for systemd (237-3ubuntu10.39) ...

Start of TCF-Agent

The Debian Package above also includes a program for systemd. To start TCF-Agent, use the systemd command as follows.

shell$ sudo systemctl start tcf-agent.service

Also, when starting TCF-Agent automatically when Linux boots, do the following.

shell$ sudo systemctl enable tcf-agent.service

Stop TCF-Agent

To stop TCF-Agent, do the following. At the moment, it takes a few minutes to stop TCF-Agent for some reason. The cause is unknown.

shell$ sudo systemctl stop tcf-agent.service

Symbolic links for various files from / opt / xilinx / xrt to / usr

The XRT executables and libraries installed in [Installation] will be installed in / opt / xilinx / xrt on the target. When you run a program for XRT on your target, you must run a script such as /opt/xilinx/xrt/setup.sh to set environment variables.

However, when I ran the program for XRT from the Vitis IDE through TCF, I was told that the library could not be found or the device could not be found for some reason, and this method did not work.

As a result of trial and error, the library under / opt / xilinx / xrt / lib and the executable program under / opt / xylinx / xrt / bin are symbolically linked to / usr / lib and / usr / bin, respectively. became.

Since it is troublesome to link by hand, we have prepared a Debian Package for that. Please install this Debian Package.

shell$ git clone https://github.com/ikwzm/ZynqMP-FPGA-XRT.git
shell$ sudo apt install ./ZynqMP-FPGA-XRT/xrt-setup_2.6.0-1_arm64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'xrt-setup' instead of './xrt-setup_2.6.0-1_arm64.deb'
The following NEW packages will be installed:
  xrt-setup
0 upgraded, 1 newly installed, 0 to remove and 71 not upgraded.
After this operation, 30.7 kB of additional disk space will be used.
Get:1 /home/fpga/work/ZynqMP-FPGA-XRT/xrt-setup_2.6.0-1_arm64.deb xrt-setup arm64 2.6.0-1 [1,276 B]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buff\\
er, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Selecting previously unselected package xrt-setup.
(Reading database ... 115056 files and directories currently installed.)
Preparing to unpack .../xrt-setup_2.6.0-1_arm64.deb ...

Preparation of zocl

The preparation of zocl is as explained in [Practice]. Please refer to that.

Preparation of Vitis

Open Run Configuration in the Vitis IDE.

Fig.1 Vitis Run Configuration-1

Fig.1 Vitis Run Configuration-1


Configure a new Connection for Vitis Run Configuration.

Fig.2 Vitis Run Configuration-2

Fig.2 Vitis Run Configuration-2


Target Name is appropriate. For Host, specify the IP address of Ultra96 / Ultra96-V2.

Fig.3 Vitis Run Configuration-3

Fig.3 Vitis Run Configuration-3


Set the Remote File Path and Working directory on the Application tab. Prepare a working directory on the target and specify its path.

Fig.4 Vitis Run Configuration-4

Fig.4 Vitis Run Configuration-4


Running on Vitis

Select and run the Configuration you set earlier from Hardware> Run in the Vitis IDE.

Fig.5 Vitis Run-Start

Fig.5 Vitis Run-Start


The result is output to the Console as follows: Here, the result of the sample program explained in [Practice] is shown.

Fig.6 Vitis Run-Result

Fig.6 Vitis Run-Result


reference

[Overview]: https://qiita.com/ikwzm/items/0d3a8adfe725cd17f932 "" Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview) "@Qiita" [Build]: https://qiita.com/ikwzm/items/d8013ea91125a3fc46aa "Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Build)" @Qiita " [Installation]: https://qiita.com/ikwzm/items/6612eacc4a0d324a0a68 "" Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Installation) "@Qiita" [Practice]: https://qiita.com/ikwzm/items/58cfea3f9d0f42840511 "" Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Practice) "@Qiita" ["Run bootgen on Debian GNU / Linux, Ubuntu" @Qiita]: https://qiita.com/ikwzm/items/97811fcff7876181209f "Run bootgen on Debian GNU / Linux, Ubuntu" @Qiita " ["FPGA Room"]: https://marsee101.blog.fc2.com "" FPGA Room "" ["Trying a storming connection using the RTL kernel in Vitis 2019.2 1"]: https://marsee101.blog.fc2.com/blog-entry-4823.html "" Storming using the RTL kernel in Vitis 2019.2 Try the connection 1 ”” ["Trying a storming connection using the RTL kernel in Vitis 2019.2 2"]: https://marsee101.blog.fc2.com/blog-entry-4824.html "" Storming using the RTL kernel in Vitis 2019.2 Try the connection 2 ”” ["Trying a storming connection using the RTL kernel in Vitis 2019.2 3"]: https://marsee101.blog.fc2.com/blog-entry-4825.html "" Storming using the RTL kernel in Vitis 2019.2 Try the connection 3 ”” ["Try storming connection using RTL kernel in Vitis 2019.2 4"]: https://marsee101.blog.fc2.com/blog-entry-4826.html "" Storming using RTL kernel in Vitis 2019.2 Try the connection 4 ””

Recommended Posts

Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Vitis edition)
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Installation)
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Build) [Unfinished]
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Installation) [Unfinished]
Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview)
Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Practice)
Run Lima Driver on Debian GNU / Linux for Ultra96 / Ultra96-V2
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (LibMali)
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Video Driver)
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Gnome Desktop)
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Mali Driver)
Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (fbdev)
Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview)
Run bootgen on Debian GNU / Linux, Ubuntu
Debian GNU / Linux (v2019.2 version) boot image provided for UltraZed / Ultra96 / Ultra96-V2
Run Debian (Linux) & LXQt on Athlon 200GE (AMD)