Spike simulation problem with the proxy kernel

236 views
Skip to first unread message

Rafael

unread,
Mar 21, 2018, 4:13:45 PM3/21/18
to RISC-V SW Dev
Hello all,

I've compiled both the riscv64-unknown-elf-* and riscv64-unknown-linux-gnu-* toolchain in order to simulate RISCV application with spike.
I have compiled the proxy kernel (pk) with the riscv64-unknown-elf-gcc compiler.

When an application is compiled like riscv64-unknown-elf-gcc hello.c -o hello.out, then I can properly run spike pk hello.out

The problem arises when the application is compiled with riscv64-unknown-linux-gnu-gcc hello.c -o hello.out.
When I execute spike pk hello.out I get the assertion ../pk/elf.c:46: assertion failed: !(eh.e_flags & EF_RISCV_RVC).

Both riscv64-unknown-elf-gcc and  riscv64-unknown-linux-gnu-gcc compilers support rv64imafd RISCV extensions (no RVC!), but in a proxy kernel source file (elf.h) there's  EF_RISCV_RVC defined as 1 (I changed it to 0 but it didn't solve the problem).

I've built both compilers from the same commit branch, so I think this is not an ISA version problem. Honestly, I've no clue about what's going on as I fallowed all the steps to build the tools properly.
I've even tried to compile pk with the riscv64-unknown-linux-gnu-gcc compiler, but the problem persists.

I noticed there's more people having this sort of problem, but none of the answers helped. As I'm using the linux compiler, I thing this is a different issue from the previous topics on this error.

Thank you in advance.

Jim Wilson

unread,
Mar 21, 2018, 6:55:57 PM3/21/18
to Rafael, RISC-V SW Dev
On Wed, Mar 21, 2018 at 1:13 PM, Rafael <rafael.bil...@gmail.com> wrote:
> The problem arises when the application is compiled with
> riscv64-unknown-linux-gnu-gcc hello.c -o hello.out.
> When I execute spike pk hello.out I get the assertion ../pk/elf.c:46:
> assertion failed: !(eh.e_flags & EF_RISCV_RVC).

Linux applications require a linux environment to run in. They won't
work on a bare metal simulator like spike. Use user-mode qemu
instead.

You apparently tried to disable C support and failed, but you didn't
state what exactly you did, so I can't tell what you did wrong. I
would guess that you have compressed instructions in libraries and/or
startfiles. You can disassemble code in your binary to check.

Jim
Reply all
Reply to author
Forward
Message has been deleted
0 new messages