1

I just got the source from github and built pk with 32bit option and ran spike with following command:

$ spike --isa=RV32 pk hello

I got the following error:

terminate called after throwing an instance of 'std::runtime_error' what(): could not open pk

I used riscv32-unknown-elf-gcc to compile pk for the 32b RISC-V target processor as follows:

$ ../configure --prefix=$RISCV/riscv32-unknown-elf --host=riscv32-unknown-elf

The old spike program which I got from the first RISCV workshop(last January) works ok.

bisv
  • 11
  • 3

2 Answers2

1

The error message suggests that spike can't find the pk. Try and provide an absolute path to the pk you compiled.

Spike assumes the pk is in a particular path relative to it. It's probably looking in ($RISCV/riscv64-unknown-elf/bin/pk).

Chris
  • 3,827
  • 22
  • 30
  • After I specify the absolute path to the pk, I got the following error: assertion failed @ 0x000052bc: ntohl(hdr->magic) == FDT_MAGIC – bisv Jan 24 '16 at 05:17
0

Confirmed. The following code is a workaround:

mkdir -p $RISCV/riscv64-unknown-elf/bin
cp $RISCV/riscv32-unknown-elf/bin/pk $RISCV/riscv64-unknown-elf/bin/pk