riscvarchive / riscv-linux

RISC-V Linux Port
606 stars 209 forks source link

Running "spike bbl" command freezing in the current build #94

Closed vinodganesan closed 6 years ago

vinodganesan commented 7 years ago

Hello, I built the complete Linux environment by following the steps provided in this as well as the ones given in riscv-tools repository. I did the following steps.

  1. Built the busybox utility with all the suggested menu-configurations. There were two ways of getting the initramfs.txt and inittab files (one in riscv-tools and the other here). I used the steps from this repository.
    1. Successfully built the linux kernel image (vmlinux) and bbl (after recompiling both riscv-linux and riscv-pk). However, When I run the command spike bbl, it just freezes instead of the debug printk's on the screen and when you try to come out (forcefully - upon ctrl+C), Spike goes to debug mode. There also seems to be a trap instruction access fault when you try to execute it in debug mode.
    2. I have another build where I followed the same steps, on a previous version of the riscv-tools which seems to work fine, where the bootup process goes till the ash terminal invocation. Please help.
palmer-dabbelt commented 7 years ago

This is usually a version mismatch between Spike and Linux. Can you try the versions tagged on the "new" branch of github.com/sifive/freedom-u-sdk?

vinodganesan commented 7 years ago

Thanks for the reply Palmer. I will try and let you know.

On Tue, Oct 31, 2017 at 12:11 AM, Palmer Dabbelt notifications@github.com wrote:

This is usually a version mismatch between Spike and Linux. Can you try the versions tagged on the "new" branch of github.com/sifive/freedom-u-sdk ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/riscv/riscv-linux/issues/94#issuecomment-340544469, or mute the thread https://github.com/notifications/unsubscribe-auth/AOcABrB_ou4enyY9RgbDWhyC-p6hKbYhks5sxhhwgaJpZM4QKLSY .

palmer-dabbelt commented 6 years ago

There's a coherent set of versions tagged in freedom-u-sdk, if that doesn't work then feel free to re-open the bug.

edcote commented 6 years ago

this is a failure in my CI system, any tips on how one would root cause the issue? or, at the very least, get a trace, error msg, that I can use for triage?

edited: here's what I'm getting

core 0: 0xffffffe000161c66 (0xc01027f3) csrr a5, time core 0: exception trap_illegal_instruction, epc 0xffffffe000161c66 core 0: tval 0x0000000000000000

core 0: 0xffffffe000161c66 (0xc01027f3) csrr a5, time core 0: exception trap_illegal_instruction, epc 0xffffffe000161c66 core 0: tval 0x0000000000000000

palmer-dabbelt commented 6 years ago

Well, you've got the illegal instruction right there in epc. You should be able to figure out what function it's in by looking at your Linux binary, if you can upload an "riscv*-objdump -d vmlinux" then I can take a look.