Skip to contentSkip to conversation

docs/platform: spike: Enhance Spike examples

PATCH New Tsukasa OI 2 participants 4 messages Dec 3, 2021 – Dec 11, 2021

lore
Share & tools
lore

Tsukasa OI

author
#0 lore raw

cover docs/platform: spike: Enhance Spike examples

I mainly use Spike rather than QEMU for small tests and I find that setting up Spike (with OpenSBI + Linux + initramfs) is not easy enough.

This commit makes Spike examples usable as QEMU ones. This is not a full tutorial (totally lacks initramfs, which is out of scope in the OpenSBI documentation) but better than nothing.

Note: This is the same changeset as:
<https://github.com/riscv-software-src/opensbi/pull/232> (but rebased)

Tsukasa OI (1):
docs/platform: spike: Enhance Spike examples

 docs/platform/spike.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

base-commit: 14faee6916bc973b9fdb816c5f4a45096e3f645a

Signature · 1 line
2.32.0
author
#1 lore raw

PATCH 1/1 docs/platform: spike: Enhance Spike examples

This commit makes Spike usable as QEMU (in fact, those are based on QEMU examples).

---
 docs/platform/spike.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
docs/platform/spike.md +12 -1
index 79e2eb2..bde9e13 100644
@@ -43,7 +43,18 @@ make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Im
 
 Run:
 ```
-spike --initrd <path_to_cpio_ramdisk> build/platform/generic/firmware/fw_payload.elf
+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
 ```
 
 Execution on QEMU RISC-V 64-bit
Signature · 1 line
2.32.0
#2 lore raw

PATCH 1/1 docs/platform: spike: Enhance Spike examples

Quoted 5 lines · Tsukasa OI

This commit makes Spike usable as QEMU (in fact, those are based on QEMU examples).

Looks good to me.

Regards,
Anup

Quoted 31 lines
---
 docs/platform/spike.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
docs/platform/spike.md +12 -2
index 79e2eb2..bde9e13 100644
@@ -43,7 +43,18 @@ make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Im
 
 Run:
 ```
-spike --initrd <path_to_cpio_ramdisk> build/platform/generic/firmware/fw_payload.elf
+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
 ```
 
 Execution on QEMU RISC-V 64-bit
--

2.32.0

Applied
#3 lore raw

PATCH 1/1 docs/platform: spike: Enhance Spike examples

Quoted 11 lines · Anup Patel
Quoted 5 lines · Tsukasa OI

This commit makes Spike usable as QEMU (in fact, those are based on QEMU examples).

Looks good to me.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 35 lines

Regards,
Anup

Quoted 31 lines
---
 docs/platform/spike.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
docs/platform/spike.md +12 -2
index 79e2eb2..bde9e13 100644
@@ -43,7 +43,18 @@ make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Im
 
 Run:
 ```
-spike --initrd <path_to_cpio_ramdisk> build/platform/generic/firmware/fw_payload.elf
+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
 ```
 
 Execution on QEMU RISC-V 64-bit
--

2.32.0