An instruction set simulator for the RISC-V architecture written in Java. Written as the last assignment for the course "02155: Computer Architecture and Engineering" at the Technical University of Denmark
Simulates the RV32I Base Instruction Set (excluding EBREAK, CSR*, fence* and some environment calls)
ID x10 |
Name | Description |
---|---|---|
1 | print_int | Prints integer in x11 |
4 | print_string | Prints null-terminated string whose address is in x11 |
10 | exit | Stops execution |
11 | print_char | Prints character in x11 |
If you haven't run a JavaFX application on Ubuntu before run the following command:
sudo apt-get install openjfx
Assuming no other Java files present:
cd path/to/package/files
javac *.java
Assuming current work directory contains RISCVSimulator package directory:
cd path/to/package/
java RISCVSimulator.Main
As OpenJDK no longer supplies a runtime environment or JavaFX, it is required to have OpenJFX downloaded.
The path to OpenJFX will be referred to as %PATH_TO_FX%
.
cd path/to/package/files
javac --module-path %PATH_TO_FX% --add-modules javafx.fxml,javafx.base,javafx.controls,javafx.graphics *.java
Requires a Java 11 Runtime Environment. This is easily obtained on Ubuntu through apt, but Windows users will need to use jlink
to build their own. See Releases
for example.
Assuming current work directory contains RISCVSimulator package directory:
cd path/to/package
java --module-path %PATH_TO_FX% --add-modules javafx.fxml,javafx.base,javafx.controls,javafx.graphics RISCVSimulator.Main
Unfortunately, the program was not written with modular Java support in mind. For this reason, there is no better way of running the program, as it's not possible to use jlink
in order to build the application with all dependencies bundled. Writing batch files or shell scripts is adviced.