west lopper-install and west lopper-command Overview
This page provides an overview of the west lopper-install and west
lopper-command, which are used to install and run lopper to generate
Zephyr device trees for AMD-based designs.
Functionality
west lopper-install
(link)
checks west.yml for a
lopper commit hash
and installs the
corresponding version
of lopper to be used by west lopper-command.
west lopper-command
(link)
calls lopper under the hood and performs the following commands:
$ lopper -f --enhanced -O {workspace} -i {lops_file} {sdt} {workspace}/system-domain.dts -- gen_domain_dts {proc}
$ lopper -f --enhanced -O {workspace} -i {lops_file} {workspace}/system-domain.dts {workspace}/system-zephyr.dts -- gen_domain_dts {proc} zephyr_dt
$ lopper -f --enhanced -O {workspace} -i {lops_file_intc} {workspace}/system-zephyr.dts {workspace}/<board>.dts
Integration and Usage
Before invoking west lopper-command, you must use
SDTGen
on your design’s XSA file in the following manner:
$ . /tools/Xilinx/Vivado/2026.1/settings64.sh
$ xsct -eval "sdtgen set_dt_param -dir <XSA_directory> -xsa <file_name>.xsa ; sdtgen generate_sdt"
west lopper-command is then invoked in the following manner:
$ LOPPER_DTC_FLAGS="-b 0 -@" west lopper-command -p <processor_instance_name> -s <system_dts> -w <zephyr_repo_path>
For example:
$ LOPPER_DTC_FLAGS="-b 0 -@" west lopper-command -p cortexr52_0 -s design_1_wrapper/system-top.dts -w ~/zephyrproject/zephyr
After lopper-command is invoked, the Zephyr environment is ready to build kernel tests/apps for the targeted hardware design. Build an example test using the following commands:
$ cd zephyr
$ west build -p -b <board> tests/misc/test_build/
The executable is generated at the following location:
<zephyr repository path>/build/zephyr/zephyr.elf
The expected output for an example application follows:
*** Booting Zephyr OS build 43e80ea32443 ***
threadA: Hello World from arm!
threadB: Hello World from arm!
threadA: Hello World from arm!
threadB: Hello World from arm!
Conclusion
west lopper-install and west lopper-command integrate lopper into
Zephyr-based project targeting AMD designs. These commands let developers
generate the necessary device trees and proceed to build and debug
Zephyr applications. This streamlined process ensures a more efficient path from
design creation to hardware testing.