Zynq UltraScale+ MPSoC PS and PMU Arguments for QEMU - 2023.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2023-12-13
Version
2023.2 English

The Zynq UltraScale+ MPSoC PS(a53) is emulated by qemu-system-aarch64 and PMU is emulated by qemu-system-microblazeel. Most common command line switches of PS are captured in qemu_args.txt and PMC command line switches are captured in pmu_args.txt.

Tip: You can add comments to the pmc_args.txt, qemu_args.txt, and pmu_args.txt files using the '#' symbol at the start of the line.
Table 1. Zynq UltraScale+ MPSoC Options for qemu_args.txt
Switch Name Value Description Source of the Config How to Extract the Info
-M arm-generic-fdt This specifies the QEMU machine to create. arm-generic-fdt machine option tells QEMU to parse dtb for machine generation, passes by -hw-dtb user.dtb. Static Hard-coded for Zynq UltraScale+ MPSoC devices
-serial mon:stdio -serial is a positional argument. Redirect the serial port to specified char dev (i.e., stdio, tcp port, file, etc.). Based on UART configuration on Zynq UltraScale+ MPSoC

Zynq UltraScale+ MPSoC has two UARTs.

When enabling UART0:
CONFIG.PSU__UART0__PERIPHERAL__ENABLE = 1
CONFIG.PSU__UART1__PERIPHERAL__ENABLE = 0 or 1

Then specify: -serial mon:stdio

When enabling only UART1:
CONFIG.PSU__UART0__PERIPHERAL__ENABLE = 0 
CONFIG.PSU__UART1__PERIPHERAL__ENABLE = 1

Then specify: -serial null -serial mon:stdio

-global xlnx,zynqmp-boot.cpu-num=0 Make the specified CPU come out of reset. Static Hard coded for Zynq UltraScale+ MPSoC devices
-net -net nic -net nic -net nic -net nic -net user

-net is positional argument. Initialize network interfaces gem3. Connect the specified network adapter to user mode network.

Tip: -net none will disable all Ethernet interfaces.
Static

Based on Ethernet configurations:

If gem0(eth0) is enabled:
CONFIG.PSU__ENET0__PERIPHERAL__ENABLE =1

Then specify -net nic -net user

If gem1 is enabled:
CONFIG.PSU__ENET1__PERIPHERAL__ENABLE = 1

Then specify -net nic -net nic -net user

If gem2 is enabled:
CONFIG.PSU__ENET2__PERIPHERAL__ENABLE = 1

Then specify -net nic -net nic -net nic -net user

If gem 3 is enabled:
CONFIG.PSU__ENET3__PERIPHERAL__ENABLE = 1

Then specify -net nic -net nic -net nic -net nic -net user

Tip: If no -net (and/or -netdev) is mentioned then by default QEMU will enable the first Ethernet (gem0) and map it to user mode backend.
-m 4G Enabling 4 GB DDR on Zynq UltraScale+ MPSoC. Static Emulating full DDR on Zynq UltraScale+ MPSoC
-device loader,file=<bl31.elf>,cpu-num=0 Load bl31.elf file on A53 core 0. Static v++ --package should replace bl31.elf with absolute path of bl31.elf
-device loader,file=<u-boot.elf> Loading u-boot.elf. Static v++ --package should replace bl31.elf with absolute path of u-boot.elf
-hw-dtb <ps-dtb-file> dtb file which describes PS which is emulated by QEMU can be specified using -hw-dtb. Static

Hard coded for Zynq UltraScale+ MPSoC devices:

<ps-dtb-file>=/proj/xbuilds/HEAD_daily_latest/installs/lin64/Vitis/HEAD//data/emulation/dtbs/zynqmp/zynqmp-arm-cosim.dtb

Table 2. Zynq UltraScale+ MPSoC Options for pmu_args.txt
Switch Name Value Description Source of the Config How to Extract the Info
-M microblaze-fdt This specifies the QEMU machine to create. microblaze-fdt tells QEMU to parse dtb for machine generation, passes by -hw-dtb user.dtb. Static Hard coded for Zynq UltraScale+ MPSoC devices
-device loader,file=<pmufw.elf> Load pmufw.elf file on PMU RAM. Static Hard coded for Zynq UltraScale+ MPSoC devices
-machine-path <path-to-xsim-dir> Point -machine-path to folder to create shared RAM and remote-port sockets. Static launch_emulator command will set this machine path
-display none By default, QEMU creates display for user I/O. This option disables the display. Static Hard coded for Zynq UltraScale+ MPSoC devices
-hw-dtb <pmu-dtb-file> dtb file which describes PMU which is emulated by QEMU can be specified using -hw-dtb. Static <pmu-dtb-file>=/proj/xbuilds/HEAD_daily_latest/installs/lin64/Vitis/HEAD//data/emulation/dtbs/zynqmp/zynqmp-pmu.dtb
Tip: Although the file is called pmu_args.txt here, the file is specified for launch_emulator using the -pmc-args-file command.