Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike pk doesn't work #269

Open
hasver opened this issue Feb 21, 2022 · 4 comments
Open

Spike pk doesn't work #269

hasver opened this issue Feb 21, 2022 · 4 comments

Comments

@hasver
Copy link

hasver commented Feb 21, 2022

Hi all
I installed pk and spike both in my RISCV_TOOLCHAIN path and according to the instructions provided.
I tried to run spike pk hello on an arbitrary c file but it just stops and doesn't show anything for a while
Is there any solution for that?
Thanks

@tak-ka3
Copy link

tak-ka3 commented Nov 27, 2022

Hi, @hasver
I have the same problem like this(riscv-software-src/riscv-isa-sim#1152). How did you resolve it?

@mhamdan91
Copy link

It seems pk falls in bad_trap! running into the same problem

@adamsir32
Copy link

I have the same question,that's terrible:(

@kaichsu
Copy link

kaichsu commented Jul 8, 2024

I've run into the problem, the situation is weird.
I compile and install pk like

../configure --prefix=$RISCV --host=riscv64-unknown-elf --with-arch=rv64gc_zifencei
make
make install

And I write a simple hello world program

#include <stdio.h>
int main(){
    printf("hello riscv!\n");
    return 0;
}

Compile the hello.c program with the following command and run

riscv64-unknown-elf-gcc -g -march=rv64gc_zifencei hello.c -o hello
spike --isa=rv64gc pk hello

The terminal show the following and then stuck

bbl loader

If I run debug mode with spike -d --isa=rv64gc pk hello and let it run
The terminal eventually shows exception and stuck.

core   0: exception trap_instruction_page_fault, epc 0x00000000800019d0
core   0:           tval 0x00000000800019d0

However, if I remove the newline \n in printf() function. Recompile and run.

bbl loader
hello riscv!{my user name}:/tmp$

I have no idea why newline matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants