Hacker News new | ask | show | jobs
by raible 1297 days ago
This is an awesome project. In the video you mention that you might drop it... please don't!
1 comments

Just curious but as someone who doesn't understand the awesomeness, can you explain what it's useful for? I can't think of what I might use this for.
One could use it to test (embedded) code targetting RISC-V, without needing to use hardware. Unit tests is the easiest, since they preferably do no I/O. But also integration test by providing an I/O implementation (using a Hardware Abstraction Layer), and driving I/O from the tests. Such testing is easier to do when one has C access to the simulator, and not having to implement the I/O via some virtual device shuffling bytes etc.

And since its just a C header/library, on can just distribute, include and build the simulator alone with the project/tests. As opposed to relying on the user having qemu (or similar) installed.

I will consider using it for emlearn (a Machine Learning Library for microcontrollers).

This is a full system simulator with an emulated RISC-V CPU in under a 1000 lines of clean C, in two files, so you can include it basically any program (STB style FTW).
I mean, any program can include any program, why go to the extra layer of doing it inefficiently?
It allows you to run it in a protected environment. Think scripting languages.