Using Mainline QEMU in Yocto 2.3 (Pyro)

If using meta-xilinx with Pyro you can just use the runqemu command and it will default to using the Xilinx fork of QEMU.
See the help inside runqemu for information on how to run this.

Using Mainline QEMU in Yocto 2.2 (Morty)

As of Yocto release 2.2 meta-xilinx and open-embedded support running MicroBlaze, Zynq-7000 and ZynqMP machines on mainline QEMU. They also build a fork of Xilinx's QEMU which can be used.
To do this first use bitbake to build the yocto images targeting a QEMU machine. These machines support runninng on QEMU:
  • zcu102-zynqmp
  • ep108-zynqmp
  • qemu-zynq7
  • ml605-qemu-microblazeel
  • s3adsp1800-qemu-microblazeeb
An example of builidng a Zynq-7000 iamge is shown below.
$ MACHINE=qemu-zynq7 bitbake core-image-minimal
To run the new images on QEMU use the runqemu script.
$ runqemu qemu-zynq7

Using Mainline QEMU in Yocto 2.1 (Krogoth)

As of Yocto release 2.1 meta-xilinx and open-embedded support running MicroBlaze and Zynq-7000 machines on mainline QEMU.
To do this first use bitbake to build the yocto images targeting a QEMU machine. The two QEMU machines supported are: qemumicroblaze and qemuzynq. An example of builidng a Zynq-7000 iamge is shown below.
$ MACHINE=qemuzynq bitbake core-image-minimal
To run the new images on QEMU use the runqemu script.
$ runqemu qemuzynq

Using Xilinx's Fork of QEMU with Xilinx's Yocto 2017.1 Release

As of Xilinx's meta-xilinx release 2017.1 meta-xilinx also supports using the Xilinx fork of QEMU in the Yocto flow. This includes more features compared to the mainline QEMU as we are still working on upstreaming these features.
Using Xilinx's fork of QEMU is not enabled by default, you can enable it by setting the following settings in your local.conf:
#Using Xilinx QEMU, need to enable QEMUBOOT and provide path to PMU ROM
XILINX_QEMUBOOT = "1"
XILINX_QEMUBOOT_MULTI = "1"
QB_OPT_XILINX_PMU_ROM = "/<path-to-rom>/pmu_rom_qemu_sha3.elf"
QB_OPT_XILINX_PMU_ROM is only required if XILINX_QEMUBOOT_MULTI is set and is only applicable for ZynqMP targets. For details of how to get the PMU ROM see the documentation on mainline meta-xilinx: http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/README.qemu.md. Note that on the Xilinx fork you can specify where the PMU ROM is and it doesn't have to be inside the deploy directory.
XILINX_QEMUBOOT_MULTI is also only applicable for ZynqMP targets.

Once that is set follow the Morty steps above to build the images for the applicable board. In the example below we are targetting the ZynqMP architecture and the ZCU102 board.
$ MACHINE=zcu102-zynqmp bitbake core-image-minimal
Now instead of using the default runqemu script use the script in meta-xilinx/scripts/runqemu the same way as before.
$ runqemu zcu102-zynqmp
This will start Xilinx's fork of QEMU with the appripriote commmand line arguments.

This command will boot into u-boot, where the user can then boot into an appripriote kernel.
NOTE: That u-boot uses some hardcoded filenames which might not match the output of bitbake. If this is the case rename, copy or link the original file to the name that u-boot expects.

Using Xilinx's Fork of QEMU with Xilinx's Yocto 2016.3 Release

As of Xilinx's meta-xilinx release 2016.3 meta-xilinx also supports using the Xilinx fork of QEMU in the Yocto flow. This includes more features compared to the mainline QEMU as we are still working on upstreaming these features.
Follow the Krogoth steps above to build the images for the applicable board. In the example below we are targetting the ZynqMP architecture and the ZCU102 board.
$ MACHINE=qemuzynqmp bitbake core-image-minimal # On Xilinx's meta-xilinx layer the qemuzynqmp machine is based on the ZCU102
Now instead of using the default runqemu script use the script in meta-xilinx/scripts/runqemu the same way as before.
$ ../sources/meta-xilinx/scripts/runqemu qemuzynqmp
This will start Xilinx's fork of QEMU with the appripriote commmand line arguments.

This command will boot into u-boot, where the user can then boot into an appripriote kernel.
NOTE: That u-boot uses some hardcoded filenames which might not match the output of bitbake. If this is the case rename, copy or link the original file to the name that u-boot expects.

For more information on using the runqemu command just run the script without any arguments and a help text will be printed.