Generating a Device Tree - Generating a Device Tree - 2026.1 English - UG1400

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document_ID
UG1400
Release_Date
2026-07-31
Version
2026.1 English
The Vitis tool extracts the System Device Tree (SDT) from the XSA and uses it to generate a Linux Device Tree Blob (DTB). The Vitis Unified IDE supports two flows. Use the Vitis CLI flow when you want the platform creation step to generate the DTB automatically. Use the SDT and Lopper flow when you need full control of device tree generation, such as customizing the Linux domain or applying overlays outside of the platform flow.

Generate a DTB Using the Vitis CLI

The Vitis CLI generates a DTB as part of platform creation when you set generate_dtb=True. This flow integrates DTB generation into the standard platform component flow, so you do not need to run sdtgen or Lopper separately.

Before you begin, make sure you have an XSA file, a Linux operating system target, the target CPU, and an optional custom DTSI directory if you need to inject custom device tree fragments.

To generate the DTB, launch the Vitis CLI Python client, create an advanced options dictionary that points to your DTSI directory and configures overlay and ZOCL behavior, then create the platform component with generate_dtb=True. The following example creates a platform for psv_cortexa72 with DTB generation enabled:

adv_options = client.create_advanced_options_dict(
    user_dtsi=dtsi_dir,
    dt_overlay="0",
    dt_zocl="1",
)

platform = client.create_platform_component(
    name="pfm",
    hw_design=curr_dir + "/" + xsa_fixed,
    os="linux",
    cpu="psv_cortexa72",
    domain_name="linux_xrt",
    generate_dtb=True,
    advanced_options=adv_options,
)

After you create the platform component, the Vitis tool writes the DTB to the generated platform output directory. You can also enable this option from the Create Platform Component wizard by selecting Generate Device Tree Blob (DTB) on the OS and Processor page.

Figure 1. Generating Device Tree

Generate a DTB Using SDT and Lopper (Advanced)

This flow separates SDT generation from DTB generation and gives you direct control over each stage. Use it when the Vitis CLI flow does not expose the customization you need.

First, generate the SDT from the XSA by using sdtgen. The following command extracts the SDT for a VCK190 design and writes the output to the sdt_out directory:

sdtgen -dir sdt_out -xsa design_1_wrapper.xsa -board_dts versal-vck190-rev1.1
sdtgen generate_sdt

This step produces system-top.dts, which Lopper uses in the next step.

Next, configure Lopper by exporting the device tree compiler flags that Lopper passes to dtc:

export LOPPER_DTC_FLAGS="-b 0 -@"

Finally, run Lopper on the SDT with the Linux domain configuration to generate the DTB.

lopper -f --enhanced \
  -i lop-a72-imux.dts \
  ./linux_ws/platform/hw/sdt/system-top.dts \
  system.dtb \
  -- gen_domain_dts psv_cortexa72_0 linux_dt
Note: The DTB must match the hardware described in the XSA. The CPU and domain names that you pass to the platform component or to Lopper must exactly match the entries in the SDT. Custom DTSI fragments must remain compatible with the generated SDT. Otherwise, Lopper or dtc reports merge errors when building the DTB.