hello world not working with spike

878 views
Skip to first unread message

Aylin Hannah

unread,
Feb 9, 2017, 11:56:42 AM2/9/17
to sw-...@groups.riscv.org
Hi All,
Please excuse me naivety, this is my first day with riscv software.
I am working on Linux 64 bit. I built spike, pk, gcc tool chain for RV32. When I am able to build executable fine using gcc, but when I run spike I am not getting any output. Absolutely nothing happens.

[pahmad@ibxdv-pahmad ~]$ riscv32-unknown-linux-gnu-gcc -o hello hello.c
[pahmad@ibxdv-pahmad ~]$ spike pk hello
[pahmad@ibxdv-pahmad ~]$ 

Anybody any idea what could be wrong?

Thanks
-Parvez

John Leidel

unread,
Feb 9, 2017, 11:58:44 AM2/9/17
to Aylin Hannah, RISC-V SW Dev
Parvez, Spike defaults to RV64IMAFD.  Try setting the ISA for your 32bit code.  Look at the Spike help menu.  There is a "--isa" option.  

$RISCV/bin/spike --isa=RV32I pk /path/to/foo.exe

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAN5ow1BGPNEOmn5NpmWVnqSwGsM2KjhSfgaEAAsr51kcS52g%3DQ%40mail.gmail.com.

Aylin Hannah

unread,
Feb 9, 2017, 12:05:53 PM2/9/17
to John Leidel, RISC-V SW Dev
Thanks John,
Here is the output with some of the options I tried. None is clean

[pahmad@ibxdv-pahmad ~]$ spike --isa=RV32I pk hello
terminate called after throwing an instance of 'trap_load_access_fault'

====================================================
[pahmad@ibxdv-pahmad ~]$ spike --isa=RV32G pk hello
z  00000000 ra 00010284 sp 7fbedda0 gp 00012814
tp 00000000 t0 00000000 t1 00000000 t2 00012240
s0 00000000 s1 00000000 a0 00010364 a1 00000001
a2 7fbedda4 a3 000103a0 a4 00010430 a5 00000000
a6 7fbedda0 a7 00000000 s2 00000000 s3 00000000
s4 00000000 s5 00000000 s6 00000000 s7 00000000
s8 00000000 s9 00000000 sA 00000000 sB 00000000
t3 ffffffff t4 00000000 t5 00000000 t6 00000000
pc 0001025c va fffffffe insn       ffffffff sr 80006000
Misaligned instruction access!
[pahmad@ibxdv-pahmad ~]$ 

===========================================
[pahmad@ibxdv-pahmad ~]$ spike --isa=RV32 pk hello
z  00000000 ra 00010284 sp 7fbedda0 gp 00012814
tp 00000000 t0 00000000 t1 00000000 t2 00012240
s0 00000000 s1 00000000 a0 00010364 a1 00000001
a2 7fbedda4 a3 000103a0 a4 00010430 a5 00000000
a6 7fbedda0 a7 00000000 s2 00000000 s3 00000000
s4 00000000 s5 00000000 s6 00000000 s7 00000000
s8 00000000 s9 00000000 sA 00000000 sB 00000000
t3 ffffffff t4 00000000 t5 00000000 t6 00000000
pc fffffffe va fffffffe insn       ffffffff sr 80006000
User fetch segfault @ 0xfffffffe
[pahmad@ibxdv-pahmad ~]$ 

On Thu, Feb 9, 2017 at 10:28 PM, John Leidel <john....@gmail.com> wrote:
Parvez, Spike defaults to RV64IMAFD.  Try setting the ISA for your 32bit code.  Look at the Spike help menu.  There is a "--isa" option.  

$RISCV/bin/spike --isa=RV32I pk /path/to/foo.exe
On Thu, Feb 9, 2017 at 10:56 AM, Aylin Hannah <aylin....@gmail.com> wrote:
Hi All,
Please excuse me naivety, this is my first day with riscv software.
I am working on Linux 64 bit. I built spike, pk, gcc tool chain for RV32. When I am able to build executable fine using gcc, but when I run spike I am not getting any output. Absolutely nothing happens.

[pahmad@ibxdv-pahmad ~]$ riscv32-unknown-linux-gnu-gcc -o hello hello.c
[pahmad@ibxdv-pahmad ~]$ spike pk hello
[pahmad@ibxdv-pahmad ~]$ 

Anybody any idea what could be wrong?

Thanks
-Parvez

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

Andrew Waterman

unread,
Feb 9, 2017, 1:59:08 PM2/9/17
to Aylin Hannah, John Leidel, RISC-V SW Dev
Reply all
Reply to author
Forward
0 new messages