Xilinx QEMUにおけるCortex-R5コードの実行

前回noteの続き

Cortex-R5の実行が目的であるが、よいサンプルはXilinxのQEMUにある。以下のURL

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/822312999/Building+and+Running+QEMU+from+Source+Code

にしたがってまずチュートリアルを実行できることを確認する。

環境

WSL 2, Ubuntu 22.04.2 LTS

QEMUのビルド

cd $WORKSPACE
git clone https://github.com/Xilinx/qemu.git
cd qemu
git checkout tags/xilinx-v2023.1
git submodule update –init dtc
mkdir build
cd build
sudo apt-get update
sudo apt install libglib2.0-dev libgcrypt20-dev zlib1g-dev autoconf automake libtool bison flex libpixman-1-dev build-essential gdb ninja-build
../configure --target-list="aarch64-softmmu,microblazeel-softmmu" --enable-fdt --disable-kvm --disable-xen --enable-gcrypt
make -j16

QEMU devicetreeのビルド

cd $WORKSPACE
git clone https://github.com/Xilinx/qemu-devicetrees.git
cd qemu-devicetrees
make

examplesのDL

cd $WORKSPACE
git clone https://github.com/Xilinx/qemu-ug-examples

examplesの実行(bare_metal_r5)

cd $WORKSPACE/qemu-ug-examples/BareMetal_examples/bare_metal_r5
./test.sh $WORKSPACE/qemu/build/aarch64-softmmu $WORKSPACE/qemu-devicetrees/LATEST/SINGLE_ARCH

結果

Hello WorldHello Test Passed
Successfully ran UartPsv Hello World Example

examplesの実行(bare_metal_r5_zynqmp)

cd $WORKSPACE/qemu-ug-examples/BareMetal_examples/bare_metal_r5_zynqmp
./test.sh $WORKSPACE/qemu/build/aarch64-softmmu $WORKSPACE/qemu-devicetrees/LATEST/SINGLE_ARCH

結果

###########################
 TESTLIB (C)GREENSOCS 2016
###########################

Started with VINITHI bit HIGH.

 RPU TESTS
===========
 * testing R5_0 atcm accessibility in lockstep mode
   --> skipped: succeed
 * testing R5_0 btcm accessibility in lockstep mode
   --> skipped: succeed
 * testing R5_0 atcm alias in lockstep mode
   --> skipped: succeed
 * testing R5_0 btcm alias in lockstep mode
   --> skipped: succeed
 * testing R5_1 atcm accessibility with TCM COMB
   --> skipped: succeed
 * testing R5_1 btcm accessibility with TCM COMB
   --> skipped: succeed
 * testing R5_1 atcm alias with TCM COMB
   --> skipped: succeed
 * testing R5_1 btcm alias with TCM COMB
   --> skipped: succeed
 * testing R5_0 icache accessibility in split mode
   --> succeed
 * testing R5_0 dcache accessibility in split mode
   --> succeed
 * testing R5_1 icache accessibility in split mode
   --> succeed
 * testing R5_1 dcache accessibility in split mode
   --> succeed
Result: SUCCESS

 SLCR TESTS
============
 * check that write protect works on mutex 0 register
   --> succeed
 * reinitialize the mutexes
   --> succeed
 * check mutex lock
   --> succeed
 * check mutex relock
   --> succeed
 * check mutex unlock
   --> succeed
 * check irq masks
   --> succeed
Result: SUCCESS

 CRL TESTS
===========
 * check the register mask
   --> succeed
 * check the irq trigger
   --> succeed
Result: SUCCESS

 PMU TESTS
===========
 * check the mbist trigger
   --> succeed
 * check the mbist done bit
   --> succeed
Result: SUCCESS


補足

Xilinx QEMUのtags/xilinx-v2021.1をcheckoutしてビルドを試みたが、block/vpc.cでコンパイルエラー(outside array bounds)が出た。


この記事が気に入ったらサポートをしてみませんか?