|
|
|
|
|
by a-priori
2248 days ago
|
|
It looks like it's the season for hobby RISC-V emulators, because I've also been working on one. https://github.com/michaelmelanson/riscy The tricky part here comes when you have to run non-trivial programs. Mine currently passes the basic test suites, but it still fails in the C runtime startup when executing programs compiled with GCC. My next step is to do co-simulation with another emulator in order to find out where their execution states diverge. |
|
The tests in riscv-tests are not complete enough to indicate strong compliance. I have found several bugs in my implementation that were not caught by them.
> but it still fails in the C runtime startup when executing programs compiled with GCC
The biggest issue I have seen with running C programs is that people don't have the system calls that C runs on startup. In a log from rv8, you need brk, uname, readlinkat, and mprotect. So without those you shouldn't be able to get a program into user code unless you make a custom entry point.
Source: I am the maintainer of RARS (https://github.com/TheThirdOne/rars)