Hacker News new | ask | show | jobs
by YorkshireSeason 1303 days ago
Nice work!

How did you debug it? Did you run it against the 'official' RISC-V models Spike [1] or Sail [2]?

[1] https://github.com/riscv-software-src/riscv-isa-sim

[2] https://github.com/riscv/sail-riscv

1 comments

Yes, I used Spike quite a bit in the beginning. I also compared with my own instruction logging with objdump -drl program | less.

These days I have a decent test suite. I verify Go and Zig hello worlds (both running through a surprising amount of code): https://github.com/fwsGonzo/libriscv/blob/master/tests/unit/...

And I generate a mandelbrot that I compare: https://github.com/fwsGonzo/libriscv/blob/master/tests/unit/...

While most tests produce RISC-V programs which are run to completion as part of the test, that still might not cover every edge case, though. I have tried to integrate with the riscv-tests repository, but it uses a lot of privileged instructions. After I have implemented more of the supervisor extension I will be able to run those tests.