In this blog series, I dive into Xilinx's new platform management utility called xmutil.
Introduction
For those who did not see my write-up on the new Xilinx Kria KV260 Vision AI Starter Kit, I invite you to check it out on hackster.io:
In this write-up, I take a look at a new platform and app management utility from Xilinx, XMUTIL. The utility can be used to query the platform status, and manage the accelerated apps, as well as several other features.
XMUTIL Overview
For those who did not see my write-up on the new Xilinx Kria KV260 Vision AI Starter Kit, I invite you to check it out on hackster.io:
The get more information on the xmutil utility, call it with the -h argument:
root@xilinx-k26-starterkit-2020_2:~# xmutil -h
usage: xmutil [-h]
{boardid,bootfw_status,bootfw_update,getpkgs,listapps,loadapp,unloadapp,platformstats,ddrqos,axiqos,pwrctl}
...
boardid: Reads all board EEPROM contents. Prints information summary in human readable structure to CLI.
-b Pick which board to print fru data for
-f Enter field to print
-s Enter som EEPROM path
-c Enter cc EEPROM path
bootfw_status: Prints Qspi MFG version and date info along with persistent state values.
bootfw_update: Updates the primary boot device with a new BOOT.BIN in the inactive partition (either A or B).
getpkgs: Queries Xilinx package feeds and provides summary to CLI of relevant packages for active platform based on board ID inf
ormation.
listapps: Queries on target HW resource manager daemon of pre-built apps available on the platform and provides summary to CLI.
loadapp: Loads integrated HW+SW application inclusive of bitstream and starts the corresponding pre-built app SW executable.
unloadapp: Removes accelerated application inclusive of unloading its bitstream. (Takes no argument)
platformstats: Reads and prints a summary of the following performance related information:
CPU Utilization for each configured CPU
RAM utilization
Swap memory Utilization
SOM overall current, power, voltage utilization
SysMon Temperatures(s)
SOM power supply data summary reported by PMICs & ZU+ SysMon sources
ddrqos: Set QOS value for DDR slots on zynqmp platform
axiqos: Set QOS value for AXI ports on zynqmp platform.
pwrctl: PL power control utility.
positional arguments:
{boardid,bootfw_status,bootfw_update,getpkgs,listapps,loadapp,unloadapp,platformstats,ddrqos,axiqos,pwrctl}
Enter a function
args
optional arguments:
-h, --help show this help message and exit
root@xilinx-k26-starterkit-2020_2:~#
The get more information on one of the supported commands, specify the command, followed by the -h argument.
For example, in order to get more information on the platformstats command:
root@xilinx-k26-starterkit-2020_2:~# xmutil platformstats -h
XILINX PLATFORM STATS UTILITY
Usage: platformstats [options] [stats]
Options
-i --interval Specify the decimal value for polling in ms. The default is 1000ms.
-v --verbose Print verbose messages
-l --logfile Print output to logfile
-s --stop Stop any running instances of platformstats
-h --help Show this usuage.
List of stats to print
-a --all Print all supported stats.
-c --cpu-util Print CPU Utilization.
-r --ram-util Print RAM Utilization.
-s --swap-util Print Swap Mem Utilization.
-p --power-util Print Power Utilization.
-m --cma-util Print CMA Mem Utilization.
-f --cpu-freq Print CPU frequency.
To print the power utilization:
root@xilinx-k26-starterkit-2020_2:~# xmutil platformstats -p
Power Utilization
SOM total power : 3560 mW
SOM total current : 708 mA
SOM total voltage : 5025 mV
AMS CTRL
System PLLs voltage measurement, VCC_PSLL : 1193 mV
PL internal voltage measurement, VCC_PSBATT : 716 mV
Voltage measurement for six DDR I/O PLLs, VCC_PSDDR_PLL : 1793 mV
VCC_PSINTFP_DDR voltage measurement : 841 mV
PS Sysmon
LPD temperature measurement : 26 C
FPD temperature measurement (REMOTE) : 26 C
VCC PS FPD voltage measurement (supply 2) : 841 mV
PS IO Bank 500 voltage measurement (supply 6) : 1784 mV
VCC PS GTR voltage : 851 mV
VTT PS GTR voltage : 1799 mV
PL Sysmon
PL temperature
To list the available apps:
root@xilinx-k26-starterkit-2020_2:~# xmutil listapps
Accelerator Type Active
kv260-dp XRT_FLAT 1
base XRT_FLAT 0
I particularly like the command that reads back the FRU identification EEPROM on each of the boards (SOM & carrier card), including product number, revision, and serial number, etc...
root@xilinx-k26-starterkit-2020_2:~# xmutil boardid -h
usage: fru-print.py [-h] [-b {som,cc}] [-f FIELD [FIELD ...]] [-s [SOMPATH]]
[-c [CCPATH]]
print fru data of SOM/CC eeprom
optional arguments:
-h, --help show this help message and exit
-b {som,cc}, --board {som,cc}
Enter som or cc
-f FIELD [FIELD ...], --field FIELD [FIELD ...]
enter fields to index using. (if entering one arg,
it's assumed the field is from board area)
-s [SOMPATH], --sompath [SOMPATH]
enter path to SOM EEPROM
-c [CCPATH], --ccpath [CCPATH]
enter path to CC EEPROM
root@xilinx-k26-starterkit-2020_2:~# xmutil boardid -b som
board:
date: 13127688
fileid: '00'
language: 0
manufacturer: XILINX
part: 5057-02ED
pcieinfo:
Device_ID: '0000'
SubDevice_ID: '0000'
SubVendor_ID: '0000'
Vendor_ID: 10ee
product: SM-K26-XCL2GC-ED
revision: A
serial: XFL1VJ2M4WKW
uuid: 9bbf688bb32042da9cff293128047758
common:
size: 8192
version: 1
multirecord:
DC_Load_Record:
max_V: '2602'
max_mA: a00f
min_V: c201
min_mA: '0000'
nominal_voltage: f401
output_number: '01'
ripple/noise pk-pk: '6400'
MAC_Addr:
MAC_ID_0: 000a3509d4da
Version: '31'
Xilinx_IANA_ID: da1000
SoM_Memory_Config:
Primary_boot_device: QSPI:512Mb
SOM_PL_DDR_memory: PLDDR4:None
SOM_PS_DDR_memory: PSDDR4:4GB
SOM_secondary_boot_device: eMMC:16GB
Xilinx_IANA_ID: da1000
root@xilinx-k26-starterkit-2020_2:~# xmutil boardid -b cc
board:
date: 13205619
fileid: '00'
language: 0
manufacturer: XILINX
part: 5066-01ED
pcieinfo:
Device_ID: '0000'
SubDevice_ID: '0000'
SubVendor_ID: '0000'
Vendor_ID: 10ee
product: SCK-KV-G
revision: B
serial: XFL1ANI12XZR
uuid: afee164eeb7a43339bf426426eed3b18
common:
size: 8192
version: 1
multirecord:
DC_Load_Record:
max_V: e204
max_mA: b80b
min_V: 7e04
min_mA: '0000'
nominal_voltage: b004
output_number: '01'
ripple/noise pk-pk: '6400'
root@xilinx-k26-starterkit-2020_2:~#
The xmutil can also query which apps are available from Xilinx.
xilinx-k26-starterkit-2020_2:~$ xmutil getpkgs
Searching package feed for packagegroups compatible with: kv260
packagegroup-kv260-smartcam.noarch 1.0-r0.0
oe-remote-repo-sswreleases-rel-v2020.2.2-generic-rpm-noarch
packagegroup-kv260-aibox-reid.noarch 1.0-r0.0
oe-remote-repo-sswreleases-rel-v2020.2.2-generic-rpm-noarch
packagegroup-kv260-defect-detect.noarch 1.0-r0.0
oe-remote-repo-sswreleases-rel-v2020.2.2-generic-rpm-noarch
The apps can be downloaded and installed with a seperate package management utility called "dnf".
dnf install packagegroup-kv260-smartcam.noarch
It is useful to know that, in addition to the many packages that are installed, many of the files specific to the app are placed in the /opt/xilinx directory.
xilinx-k26-starterkit-2020_2:~$ tree /opt/xilinx/
/opt/xilinx/
|-- README_SMARTCAM
|-- bin
| |-- 01.mipi-rtsp.sh
| |-- 02.mipi-dp.sh
| |-- 03.file-file.sh
| |-- 04.file-ssd-dp.sh
| `-- smartcam
|-- lib
| |-- libivas_airender.so
| `-- libivas_xpp.so
`-- share
|-- ivas
| `-- smartcam
| |-- facedetect
| | |-- aiinference.json
| | |-- drawresult.json
| | `-- preprocess.json
| |-- refinedet
| | |-- aiinference.json
| | |-- drawresult.json
| | `-- preprocess.json
| `-- ssd
| |-- aiinference.json
| |-- drawresult.json
| |-- label.json
| `-- preprocess.json
|-- notebooks
| `-- smartcam
| |-- LICENSE
| |-- images
| | `-- xilinx_logo.png
| `-- smartcam.ipynb
`-- vitis_ai_library
`-- models
`-- kv260-smartcam
|-- densebox_640_360
| |-- densebox_640_360.prototxt
| |-- densebox_640_360.xmodel
| `-- md5sum.txt
|-- refinedet_pruned_0_96
| |-- md5sum.txt
| |-- refinedet_pruned_0_96.prototxt
| `-- refinedet_pruned_0_96.xmodel
`-- ssd_adas_pruned_0_95
|-- label.json
|-- md5sum.txt
|-- ssd_adas_pruned_0_95.prototxt
`-- ssd_adas_pruned_0_95.xmodel
17 directories, 31 files
The downloaded apps can be lists, loaded, and unloaded with the xmutil utility.
As an example, for the "Smart Camera" app that we previously downloaded:
root@xilinx-k26-starterkit-2020_2:~# xmutil listapps
Accelerator Type Active
kv260-dp XRT_FLAT 1
base XRT_FLAT 0
kv260-smartcam XRT_FLAT 0
root@xilinx-k26-starterkit-2020_2:~# xmutil loadapp kv260-smartcam
Remove previously loaded accelerator, no empty slot
root@xilinx-k26-starterkit-2020_2:~# xmutil unloadapp
Removing accel /lib/firmware/xilinx/kv260-dp
root@xilinx-k26-starterkit-2020_2:~# xmutil loadapp kv260-smartcam
...
DFX-MGRD> Loaded kv260-smartcam successfully
root@xilinx-k26-starterkit-2020_2:~# xmutil listapps
Accelerator Type Active
kv260-dp XRT_FLAT 0
base XRT_FLAT 0
kv260-smartcam XRT_FLAT 1
The "loadapp" command performs the following operations:
- load bitstream for accelerated app
- load dynamic device tree content specific to accelerated app
- load device drivers specific to the accelerated app
XMUTIL Source Code
After some searching, I discovered that all the source code for the XMUTIL utility is available on the Xilinx github repository:
The main entry point for the XMUTIL utility is a bash script:
https://github.com/Xilinx/xmutil
https://github.com/Xilinx/xmutil/blob/release-2020.2.2_k26/xmutil
This script calls several other scripts and/or utilities:
- "board_id" command is implemented with the "fru_print.py" python script
- I did not find where this python script is located ...
- "bootfw_status", "bootfw_update" commands are implemented with the "image_update" utility
- "listapps", "unloadapp", and "loadapp" commands are implemented with the "dfx-mgr-client" utility
- "platformstats" command is implemented with the "platformstats" utility
- "ddrqos" command is implemented with the "ddr-qos" utility
- "axiqos" command is implemented with the "axi-qos" utility
- "pwrctl" command is implemented with the "som-pwrctl" script
What Next ?
I would like to know is anyone in the community sees any interest in investigation for porting of this utility, and the sub-utilities to a custom board..
What say you ?
Top Comments