RISC-V Online
1.0.1
RISC-V Web assembly interpreter in C++, that runs on the Raspberry Pi Pico W
|
RISC-V Assembly Web Interpreter written in C++ for the Raspberry Pi Pico W.
The board will try to connect by default to an open Wi-Fi named "RISC-V Online". This can be best setup using a phone's network tethering ability, such as on Android. Create this Wi-Fi network, name it "RISC-V Online" and make it open.
There should now be a *.uf2
file located in you binary tree : src/*.uf2
After locating it, plug in the MCU while holding the button on board, drag and drop that file.
You now need to find the IP address of the board, which is best done just checking the list of connection in your AP. If using android tethering, this should be in your settings next to the AP settings.
The builtin web interface support very basic assembly parsing:
Loading storing from memory is supported. To allocate stack memory, you would usually use .data
directives in assembly language. To achieve zeroed memory regions, you have to leave some lines empty, to act as padding.
RISC-V Online has two API endpoints:
To submit an emulation state/job, the payload would look like this:
We send the register states, a random ID and program encoded in the ram.
To encode the RAM, you need to encode each 32-bit memory regions as an integer, then, represented base 36. Each of these memory regions will be suffixed by the |
delimiter. Concatenating all of these, and sending them within the ram
parameter/field via POST. Everything being sent to /submit
.
To retrieve back the result, just POST
the original ID
to /return
.
This will return a JSON object with all the original fields updated. On error, from submit or during execution, this will return an empty object, { }
.