Versal PS and PMC 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

In the AMD Versal™ device, the PS(a72) is emulated by qemu-system-aarch64 and PMC 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 pmc_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. Versal Options for qemu_args.txt
Arg Name Value Description Source How to Extract the Info
-boot

mode=<boot-number>

Ex. for sd1 -boot mode=5

Specify boot mode on your platform:

  • qspi24 = 1
  • qspi32 = 2
  • sd0 = 3
  • sd1 = 5
  • emmc0 = 6
  • ospi = 8
v++ -p DRC needed between CIPS enabled boot modes and v++ -p selection
-display none By default QEMU creates display for user I/O. This option disables the display Static Specify none to disable the display
-hw-dtb <ps-dtb-file> Device tree file which describes the PS (a72). The Vitis compiler --package command generates the dtb file and appends it to qemu-args.txt. v++ -p  
-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.

Device specific Hard coded for Versal
-serial -serial null -serial null -serial mon:stdio

By default, QEMU connects invoking terminal to UART0 for user I/O operations. You can override this behavior by specifying this option. Versal platforms have four UARTs specified using positional arguments: the first two are for debug and the last two are UART0 and UART1.

To connect UART0 to the terminal, specify -serial null -serial null -serial mon:stdio which ignores debug related UARTS and connects to UART0 to terminal.

Similarly to connect only UART1 to terminal specify -serial null -serial null -serial null -serial mon:stdio

Based on UARTs enabled on CIPS configuration.

The Versal device has four UARTs. The first two are debug related UARTs.

When enabling UART0:
CONFIG.PS_UART0_PERIPHERAL_ENABLE = 1
CONFIG.PS_UART1_PERIPHERAL_ENABLE =0 or 1

Then specify -serial null -serial null -serial mon:stdio

When enabling only UART1:
CONFIG.PS_UART0_PERIPHERAL_ENABLE = 0 
CONFIG.PS_UART1_PERIPHERAL_ENABLE = 1

Then specify: -serial null -serial null -serial null -serial mon:stdio

-sync-quantum Time in milliseconds Specifies how frequently QEMU will sync with the RTL simulator. Modifying this can have an impact on the speed of simulation. Static Hard coded for Versal devices (user need to change)

Versal CIPS has two Ethernet interfaces. Most of AMD Versal CIPS board has eth0 enabled. If no -net or -netdev is specified then QEMU by default enables eth0 and maps to user mode backend.

Table 2. Versal Options for pmc_args.txt
Switch Name Value Description Source of the Config How to Extract the Info
-M microblaze-fdt Specifies the QEMU machine to create. QEMU creates MicroBlaze™ with nodes from dtb. Static Hard coded for Versal Devices
-display none By default, QEMU creates display for user I/O. This option instructs QEMU that there is no need for display. Static Hard coded for Versal Devices
-device loader,file=<BOOT_bh.bin>,addr=0xf201e000,force-raw Specifies Boot header file with load address as 0xF201E000 (BOOT_bh.bin is loaded at address 0xF201E000). This is fixed argument in pmc_args.txt which is processed by v++ -p for final argument which has absolute path of BOOT_bh.bin file. BOOT_bh.bin is generated by v++ -p from final PDI. BOOT_bh.bin is directly loaded onto QEMU because there is no BOOT ROM access for QEMU to load boot header from PDI. v++ -pack v++ pack extracts BOOT_bh.bin and generates this switch
-device loader,file=<pmc_cdo.bin>,addr=0xF2000000,force-raw Specifies pmc_cdo.bin with load address as 0xF2000000. This is fixed argument in pmc_args.txt. This is processed by v++ -p for final argument which has absolute path of pmc_cdo.bin file. v++ -pack v++ pack extracts pmc_cdo.bin and generates this switch
-device loader,file=<plm.bin>,addr=0xF0200000,force-raw Specifies plm binary firmware with load address as 0xF0200000. This is a fixed argument in pmc_args.txt which is processed by v++ -p for final argument. This has an absolute path of plm.bin file. This plm is executed by PPU1 when it is out of reset. v++ -pack v++ pack extracts plm.bin and generates this switch
-device loader,addr=0xf0000000,data=0xba020004,data-len=4 -device loader,addr=0xf0000004,data=0xb800fffc,data-len=4 Specifies PPU0 process to be in boot loop. As there is no BOOTROM access for QEMU, PPU0 is put in bootloop which generally loads BOOT header from PDI to memory. Static Hard coded for Versal Devices
-device loader,addr=0xF1110624,data=0x0,data-len=4 -device loader,addr=0xF1110620,data=0x1,data-len=4 Makes PPU1 out of reset and puts in executing mode. Static Hard coded for Versal Devices
-hw-dtb <ps-dtb-file> dtb file which describes aout PS(a72). v++ pack generates this dtb file and appends to qemu-args.txt. v++ pack v++ pack generates dtb files based on DDR config on device