The Spike is a RISC-V ISA simulator which implements a functional model of one or more RISC-V harts. The Spike compatible virtual platform is also available on QEMU. In fact, we can use same OpenSBI firmware binaries on Spike simulator and QEMU Spike machine.
For more details, refer Spike on GitHub
To build the platform-specific library and firmware images, provide the
PLATFORM=generic parameter to the top level make
command.
The Spike platform does not have any platform-specific options.
No Payload Case
Build:
make PLATFORM=generic
Run:
spike build/platform/generic/firmware/fw_payload.elf
Linux Kernel Payload
Note: We assume that the Linux kernel is compiled using arch/riscv/configs/defconfig.
Build:
make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
Run:
spike -m256 \
--initrd <path_to_cpio_ramdisk> \
--bootargs 'root=/dev/ram rw console=hvc0 earlycon=sbi' \
build/platform/generic/firmware/fw_payload.elf
or
spike -m256 \
--kernel <linux_build_directory>/arch/riscv/boot/Image \
--initrd <path_to_cpio_ramdisk> \
--bootargs 'root=/dev/ram rw console=hvc0 earlycon=sbi' \
build/platform/generic/firmware/fw_jump.elf
No Payload Case
Build:
make PLATFORM=generic
Run:
qemu-system-riscv64 -M spike -m 256M -nographic \
-bios build/platform/generic/firmware/fw_payload.elf
Linux Kernel Payload
Note: We assume that the Linux kernel is compiled using arch/riscv/configs/defconfig.
Build:
make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
Run:
qemu-system-riscv64 -M spike -m 256M -nographic \
-bios build/platform/generic/firmware/fw_payload.elf \
-initrd <path_to_cpio_ramdisk> \
-append "root=/dev/ram rw console=hvc0 earlycon=sbi"
or
qemu-system-riscv64 -M spike -m 256M -nographic \
-bios build/platform/generic/firmware/fw_jump.elf \
-kernel <linux_build_directory>/arch/riscv/boot/Image \
-initrd <path_to_cpio_ramdisk> \
-append "root=/dev/ram rw console=hvc0 earlycon=sbi"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。