This repository includes a basic implementation of the RISC-V architecture using
the RV32I base integer instructions (R, I, S, B, U and J) - except ebreak.
The simulator reads, executes and prints the resulting registers using a binary instruction file.
To use this simulator, a Java-21 environment is recommended. Earlier versions might work, but haven't been tested.
A precompiled .jar archive is available in to project root, however the source code can be compiled by the user as well.
To compile the simulator via the java compiler, simply compile the SimTop.java file with the command javac SimTop.java.
To compile the simulator via make, you should:
- Navigate to the
./srcfolder in your terminal. - Execute
make- to will compile the files.
- To simulate a given binary file, it simply has to be entered as an argument when executing the simulator:
java SimTop <path-to-binary>orjava -jar RISC-V_Sim.jar <path-to-binary>. - The input binary will be simulated, and resulting registers will be printed as well as dumped to the inputs directory as
<path-to-binary>_Sim.res.
A tester has been written that executes all the tests in the ./tests directory and compares with the given .res files.
To execute this tester, simply compile and run the TestAll class with the tests directory path given as an argument.
This project is a fork of cae-lab/finasgmt.