Open ghost opened 6 years ago
This issue is related.
https://github.com/riscv/riscv-pk/issues/39
It looks like spike
does not find pk
at its expected location. So I assume the problem is more on spike
's side.
Any hints?
I think I had the same issue you described, the thing is that spike uses the RV64IMAFDC
ISA by default. If I attempt to invoke a hello word program cross compiled with riscv32-unknown-elf-gcc
with this ISA spike doesn't terminate on my system either.
I managed to fix this by invoking spike as spike --isa=RV32IMAFDC pk test
where test is a hello world program cross compiled with riscv32-unknown-elf-gcc
.
spike --isa=RV32IMAFDC pk test
works, but the --isa=RV32IMAFD
doesn't!
I recheck my riscv-gnu-toolchain
, it was compiled with --with-arch=rv32gc
as mentioned by the readme.md
while my spike
was compiled with --with-isa=rv32ima
because i was using riscv-tools
's build-rv32ima.sh
So the exception trap_illegal_instruction
was because the program has compressed instruction that's not supported by the spike
hello,
I have a gcc toolchain built for RV32IM. I experienced the "no termination problem" (e.g. as reported here https://github.com/riscv/riscv-pk/issues/92) and investigated a bit.
A possible explanation for this issue is that Spike looks for the 64bit version of
pk
even though we run a 32-bit executable.Spike is configured/built with
--prefix=$RISCV --with-fesvr=$RISCV --with-isa=rv32im
The gcc toolchain is configured/built with
--prefix=$RISCV --with-arch=rv32im --with-abi=ilp32 --disable-linux
PK is configured/built with
--prefix=$RISCV --host=riscv32-unknown-elf --enable-32bit
.Here I suspect that Spike finds
pk
in the current directory, built for 32bit, and everything is fine:If I run Spike from another directory, spike fallbacks to the 64bit version of
pk
:Renaming the 64bit version of
pk
makes Spike unhappy:Last, copying the 32-bit version of
pk
in the current directory makes Spike happy again: