element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs XMUTIL ... a new platform and app management utility from Xilinx
  • Blogs
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: albertabeef
  • Date Created: 26 Apr 2021 3:24 PM Date Created
  • Views 1081 views
  • Likes 8 likes
  • Comments 3 comments
  • xilinx-linux
  • xilinx;
  • xilinx fpga
  • xmutil
Related
Recommended

XMUTIL ... a new platform and app management utility from Xilinx

albertabeef
albertabeef
26 Apr 2021

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:

http://avnet.me/kria-tutorial

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
    • https://github.com/Xilinx/linux-image_update
  • "listapps", "unloadapp", and "loadapp" commands are implemented with the "dfx-mgr-client" utility
    • https://github.com/Xilinx/dfx-mgr
  • "platformstats" command is implemented with the "platformstats" utility
    • https://github.com/Xilinx/platformstats
  • "ddrqos" command is implemented with the "ddr-qos" utility
    • https://github.com/Xilinx/ddr-qos
  • "axiqos" command is implemented with the "axi-qos" utility
    • https://github.com/Xilinx/axi-qos
  • "pwrctl" command is implemented with the "som-pwrctl" script
    • https://github.com/Xilinx/xmutil/blob/release-2020.2.2_k26/som-pwrctl

 

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 ?

Anonymous

Top Comments

  • robbyshorts
    robbyshorts over 1 year ago +1

    Hi Mario, thank you for this very informational and helpful blog about the xmutil tool. I'm also currently using the Kria kv260 board but I'm having a weird issue with trying to use the xmutil…

  • robbyshorts
    robbyshorts over 1 year ago in reply to albertabeef

    Hi again Mario, thanks for the swift response I appreciate it a lot!

     

    Unless my understanding is flawed, I don't think I'm executing the commands from a SSH console.

    To give you some hindsight, I'm following this tutorial https://xilinx.github.io/kria-apps-docs/docs/smartcamera/docs/app_deployment.html in order to try and set up this board. I have the KV260 board set up where it's connected to an independent monitor via HDMI, and a computer via a USB cable for a serial connection. I also gave the board a ethernet connection for installing these packages.

     

    If my understanding is flawed, and I am indeed using a SSH console for entering commands, is there a fix/solution/work-around for this issue?

    I would love to be able to continue working with this board!

     

    Again thanks for the response Mario!

     

    Best,

    Robert

    • Cancel
    • Vote Up 0 Vote Down
    • Reply
    • More
    • Cancel
  • albertabeef
    albertabeef over 1 year ago in reply to robbyshorts

    Roberto,

    This is an excellent question.

    The verbose output will only display on the serial console.

     

    You are probably executing the commands from an network (ssh) console.

     

    My understanding is that the command is still being executed,
    but the output is being sent to the serial console.

    This is a known issue, and will probably be resolved in a future version.

    Regards,
    Mario.




    • Cancel
    • Vote Up 0 Vote Down
    • Reply
    • More
    • Cancel
  • robbyshorts
    robbyshorts over 1 year ago

    Hi Mario, thank you for this very informational and helpful blog about the xmutil tool. I'm also currently using the Kria kv260 board but I'm having a weird issue with trying to use the xmutil listapps command. Upon trying to do this command, nothing seems to happen, and the console feed simply goes to a new line as if I had just pressed "enter". This is very frustrating as it it preventing me from using the smartcam app, as I am unable to see what apps are currently installed.

    As a side note, skipping this step and just doing xmutil loadapp kv260-smartcam produces the same result, in which nothing happens. I am currently the root user "root@xilinx-k26-starterkit-2020_2:~# " and I am certain that the smartcam app is installed, as doing dnf install packagegroup-kv260-smartcam.noarch tells me that this application is already installed. Please help!

    • Cancel
    • Vote Up +1 Vote Down
    • Reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube