9.7. microblaze (MicroBlaze)¶
9.7.1. KCU105 QEMU¶
The basic hardware initialization is performed by the BSP. This BSP supports the QEMU emulated Xilinx AXI Interrupt Controller v4.1.
220.127.116.11. Boot via ELF¶
The executable image is booted by QEMU in ELF format.
18.104.22.168. Clock Driver¶
The clock driver supports the QEMU emulated Xilinx AXI Timer v2.0. It is implemented as a simple downcounter.
22.214.171.124. Console Driver¶
The console driver supports the QEMU emulated Xilinx AXI UART Lite v2.0. It is initialized to a baud rate of 115200.
126.96.36.199. Network Driver¶
Support for networking is provided by the libbsd library. Network interface configuration is extracted from the device tree binary which, by default, is in <bsp/microblaze-dtb.h>. The device tree source for the default device tree is at dts/system.dts.
To replace the default device tree with your own, assuming
is the name of your device tree source file, first you must convert your device
tree to .dtb format.
$ dtc -I dts -O dtb my_device_tree.dts > my_device_tree.dtb
The device tree blob,
my_device_tree.dtb, can now be converted to a C file.
system_dtb is significant as it is the name expected by the BSP.
$ rtems-bin2c -C -A 8 -N system_dtb my_device_tree.dtb my_dtb
BSP_MICROBLAZE_FPGA_DTB_HEADER_PATH BSP configuration option can then be
set to the path of the resulting source file,
my_dtb.c, in the waf INI file
to include it in the BSP build.
BSP_MICROBLAZE_FPGA_DTB_HEADER_PATH = /path/to/my_dtb.c
188.8.131.52. Running Executables¶
.dtb (device tree blob) file should be provided to QEMU via the
option. In the example command below, the device tree blob comes from the Xilinx
Petalinux KCU105 MicroBlaze BSP (https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html).
Executables generated by this BSP can be run using the following command:
$ qemu-system-microblazeel -no-reboot -nographic -M microblaze-fdt-plnx -m 256 \ -serial mon:stdio -display none -hw-dtb system.dtb -kernel example.exe
184.108.40.206. Debugging with QEMU¶
To debug an application, add the option
-s to make QEMU listen for GDB
connections on port 1234. Add the
-S option to also stop execution until
a connection is made.
For example, to debug the hello sample and break at
Init, first start QEMU.
$ qemu-system-microblazeel -no-reboot -nographic -M microblaze-fdt-plnx -m 256 \ -serial mon:stdio -display none -hw-dtb system.dtb -kernel \ build/microblaze/kcu105_qemu/testsuites/samples/hello.exe -s -S
Then start GDB and connect to QEMU.
$ microblaze-rtems6-gdb build/microblaze/kcu105_qemu/testsuites/samples/hello.exe (gdb) target remote localhost:1234 (gdb) break Init (gdb) continue
The basic hardware initialization is performed by the BSP. This BSP supports the Xilinx AXI Interrupt Controller v4.1.
This BSP was tested using the Xilinx Kintex UltraScale FPGA KCU105 board configured with the default Petalinux KCU105 MicroBlaze BSP. The defaults may need to be adjusted using BSP configuration options to match the memory layout and configuration of your board.
220.127.116.11. Clock Driver¶
The clock driver supports the Xilinx AXI Timer v2.0. It is implemented as a simple downcounter.
18.104.22.168. Console Driver¶
The console driver supports the Xilinx AXI UART Lite v2.0.
The following debugging procedure was used for debugging RTEMS applications running on the Xilinx KCU105 board using GDB.
First send an FPGA bitstream to the board using OpenOCD.
$ openocd -f board/kcu105.cfg -c "init; pld load 0 system.bit; exit"
After the board has been programmed, start the Vivado
to serve as the debug server. Leave it running in the background for the rest of
With the debug server running, connect to the debug server with GDB, load the application, and debug as usual. By default the GDB server listens on port 3002.
$ microblaze-rtems6-gdb example.exe (gdb) target extended-remote localhost:3002 (gdb) load (gdb) break Init (gdb) continue