AMD EDF - Dynamic Function eXchange Using AMD’s Yocto Project Recipes

Overview

This page describes how to implement Dynamic Function eXchange (DFX) on AMD devices using AMD Yocto Project recipes. It focuses on automating the device tree and dfx-mgr setup so partial bitstreams can be loaded and swapped at runtime in a Linux system.

Dynamic Function eXchange Flow Steps

Generate the PL Overlay

Tool: gen-machine-conf.

For more background, see Generating a new Yocto Project Machine Configuration and Overview of gen-machine-conf.

Using the --template option:

$ gen-machine-conf parse-sdt \
    --template <../sources/meta-amd-adaptive-socs/meta-amd-adaptive-socs-bsp/conf/machineyaml/template-yaml-file> \
    --hw-description <path-to-sdt-handoff-dir> \
    -g dfx \
    -O <machine-override> \
    --machine-name <machine-name>

Or, without a template, with a custom layer:

$ gen-machine-conf parse-sdt \
    --hw-description <path-to-sdt-handoff-dir> \
    -c <path-to-layer>/sources/meta-custom-bsp/conf \
    -g dfx \
    -O <machine-override> \
    --machine-name <machine-name>
  • The -g dfx option generates the static PL overlay in pl-overlay-dfx/pl.dtso under the generated device tree directory.

  • The output pl.dtso must match the hardware described in your post-boot module.

  • Use the partial overlays and matching partial PDI or bitstream files from the SDT handoff for the reconfigurable modules; gen-machine-conf does not generate these partial overlays.

Tip

Finalize your hardware design before generating the pl.dtso.

Integrate Dynamic Function eXchange with dfx-user-dts

Yocto class: dfx_user_dts.bbclass.

Instructions: README.dfx.user.dts.md.

Steps:

  1. Add the dfx-user-dts class to your Yocto recipe.

  2. Create a shell.json for the parent (static) design. Unlike the segmented-configuration flow, DFX requires a shell.json so dfx-mgr can describe the loadable region to the kernel and to user-space clients.

  3. Follow the README instructions to update your device tree for DFX. See Build Instructions to create Firmware Recipes using dfx_user_dts.bbclass.

Deploy and Run dfx-mgr

dfx-mgr manages loading of DFX configuration data at runtime. Place your partial bitstreams or configuration files (and the matching shell.json) in /lib/firmware/xilinx on the target device, then run dfx-mgr-client against the bundle:

# dfx-mgr-client -loadByName <package-name>
# dfx-mgr-client -load <ID>

If a partition was built against a different base design, dfx-mgr records the mismatch in a log message and continues; the PLM then refuses the load itself in the cases it checks, and the accelerator misbehaves with no error to point at in the cases it does not. To check compatibility before loading, see PDI Unique ID Compatibility.

Building a Compatible PL Design Payload and Creating a Firmware Bundle

For a VEK385 example showing how to build a compatible PL design payload and create a firmware bundle (device tree overlay), see Building a Compatible PL Design Payload and Creating a Firmware Bundle (Device Tree Overlay) in Hardware Application Development.

For deploying the PL firmware application onto a target, see Deploying the PL Firmware Application Onto Target in the same document.

References and Further Reading