Example - 2025.2 English - UG1647

Porting Guide for embeddedsw Components System Device Tree Based Build Flow (UG1647)

Document ID
UG1647
Release Date
2025-12-03
Version
2025.2 English

How to add conditions under “examples” section of a library YAML:

examples:
  xilpuf_enc_dec_data_example.c:
  xilpuf_example.c:
    - dependency_files:
      - xilpuf_example.h
  xilpuf_enc_dec_data_client_example.c:
  xilpuf_client_example.c:
    - dependency_files:
      - xilpuf_example.h
  xilpuf_versal_net_example.c:
    - dependency_files:
      - xilpuf_versal_net_example.h
  xilpuf_spartan_ultrascale_plus_example.c:
    - dependency_files:
      - xilpuf_spartan_ultrascale_plus_example.h
  xilpuf_ssit_client_example.c:
    - dependency_files:
      - xilpuf_example.h

  condition : |
    examples = []
    if platform in ["Versal", "VersalNet", "Versal_2VE_2VM"]:
      if proc in ["microblaze", "psv_cortexa72", "psv_cortexr5", "psx_cortexa78", "psx_cortexr52", "cortexa78", "cortexr52"]:
        examples += ["xilpuf_enc_dec_data_example.c", "xilpuf_example.c", "xilpuf_client_example.c",
                     "xilpuf_enc_dec_data_client_example.c"]
    if platform in ["VersalNet", "Versal_2VE_2VM"]:
      if proc in ["microblaze", "psx_cortexa78", "psx_cortexr52", "cortexa78", "cortexr52"]:
        examples += ["xilpuf_versal_net_example.c"]
    if platform in ["Versal"]:
      if proc in ["microblaze", "psv_cortexa72", "psv_cortexr5"]:
        examples += ["xilpuf_ssit_client_example.c"]
    if "spartanuplus" in variant:
        examples += ["xilpuf_spartan_ultrascale_plus_example.c"]

How the Condition Works:

xilpuf_enc_dec_data_example.c, xilpuf_example.c, xilpuf_client_example.c, xilpuf_enc_dec_data_client_example.c
These examples are valid for APU, RPU and Soft MB of all the Versal, Versal Net and Versal 2VE and 2VM devices. These are not supported for PMC, PSM, and ASU processors.
xilpuf_versal_net_example.c
This example is valid for Versal Net and Versal 2VE and 2VM devices and are supported for APU, RPU and Soft MBs only.
xilpuf_ssit_client_example.c
This example is valid only for Versal devices and are supported for APU, RPU and Soft MBs only.
xilpuf_spartan_ultrascale_plus_example.c
This example is supported only for spartanuplus variant of MicroBlaze/MicroBlaze RISCV devices.

Other Examples can be referred from the following links:

https://github.com/Xilinx/embeddedsw/blob/xlnx_rel_v2025.2/lib/sw_services/xilmailbox/data/xilmailbox.yaml#L23

https://github.com/Xilinx/embeddedsw/blob/xlnx_rel_v2025.2/lib/sw_services/xilsem/data/xilsem.yaml#L18