riscv-test-env
riscv-test-env copied to clipboard
Unable to run tests in QEMU (HTIF tohost must be 8 bytes)
I am not sure whether this issue is related to QEMU for RISC-V or the test infrastructure.
When I am trying to run a test (e.g. one from riscv-tests/isa or one generated by riscv-torture) in QEMU for RISC-V, I get the following error:
HTIF tohost must be 8 bytes
When I comment out the following lines of code in the riscv_test.h file and recompile the test, the problem disappears:
.pushsection .tohost,"aw",@progbits; \
.align 6; .global tohost; tohost: .dword 0; \
.align 6; .global fromhost; fromhost: .dword 0; \
.popsection;`
It's been 4 years. I see the same issue. However if I comment it out, tests dont compile because they're referencing this symbols.
Anyone else faced this issue with qemu and know how to get past it?
6 years, I got here. Sad to see no progress.
I'm trying to test qemu with riscof, but
cmd:
qemu-riscv32-static ./qemu/riscof_work/rv32i_m/I/src/add-01.S/ref/ref.elf
It's just stuck.
cmd:
# riscv32-xxxxxxxxxx-objcopy -I demo.elf demo.img
qemu-system-riscv32 -bios none -serial stdio -display none -kernel ./qemu/riscof_work/rv32i_m/I/src/add-01.S/ref/ref.img
output:
qemu-system-riscv32: HTIF tohost must be 8 bytes
spike can handle tohost
correctly, qemu-system-riscv32 use spike as machine by default, but it doesn't work