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

Using own ELF results in an infinite loop #4

Open
MakisChristou opened this issue Jul 15, 2020 · 5 comments
Open

Using own ELF results in an infinite loop #4

MakisChristou opened this issue Jul 15, 2020 · 5 comments

Comments

@MakisChristou
Copy link

So as the title suggests, I am trying to simulate the CPU with my own ELF files. When doing so the simulator hangs in an infinite loop. I used riscv32-unknown-elf-gcc to compile the *.c code with no other flags or arguments. I've also tried using the example provided but it had the same result. Any ideas why that is?

@ultraembedded
Copy link
Owner

Can you attach the ELF and I’ll take a look.

@MakisChristou
Copy link
Author

Sure here is it. I've used the objdump command and I've realized that a difference between your provided binary and mine is the boot vector section at the begging. Yours starts from 0X80000000 and mine doesn't have that section at all. But I don't seem to be able to replicate that with the options that I use in my compile.sh script. Any help (or direction) would be appreciated!

@ultraembedded
Copy link
Owner

Ok. Your ELF is compiled and linked against newlib. This means that the entry point and memory layout are different, and it will also take quite a long time to run on simulation.

If you want to run a cutdown test elf, you could try starting from this project;
https://github.com/ultraembedded/minispartan6-audio/tree/master/src_c

It has a makefile, linker script (which starts from 0x80000000) and a tiny libc library which is more simulation friendly.

@MakisChristou
Copy link
Author

Thanks for the response! I tried using the project that you provided, but I've been unsuccessful at using the generated binary in biriscv. For the record, I just cloned the repository, run make and used the generated binary in the biriscv icarus simulation (but still with the same infinite loop result). Here is the generated binary and corresponding make output if that helps. What am I doing wrong? Again thanks for your time!

@Marytv
Copy link

Marytv commented Aug 14, 2021

Same issue for me also. Working with the given elf and not with my own.
https://github.com/ultraembedded/minispartan6-audio/tree/master/src_c
Tried the elf from above, but issue not solved.

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

3 participants