RARS
RISC-V ecosystemRARS is a Java RISC-V simulator used in university assembly courses. It is built on MARS, the MIPS simulator from Missouri State University.
How to install RARS
One line installs RARS on your machine. The installer fetches the latest release from GitHub, selects the file that matches your operating system and architecture, checks its sha256 checksum, and installs it in your home directory. It does not need administrator rights.
curl -fsSL https://lyszt.net/install.sh | sh -s -- rarsThe command works on Linux and macOS. On Windows, download the file manually as described below.
You can also download RARS yourself: choose your operating system in the download dialog and get the file from the official GitHub releases.
| Method | Requirements | How |
|---|---|---|
| Run the JAR file |
| java -jar rars_<version>.jar |
| Build from source |
| git clone https://github.com/TheThirdOne/rars --recursive./build-jar.sh |
Java 8 or newer must be installed on your machine for this tool to run.
Overview
RARS is a RISC-V assembler and simulator written in Java. An assembler translates assembly code, the readable text form of instructions, into machine code. A simulator runs that machine code by imitating a processor. RARS puts both in one desktop window together with an editor.
RARS supports the 32-bit and 64-bit base instruction sets with the M extension for multiplication and division, the F and D extensions for floating point and the N extension for user-level interrupts. It shows every pseudo-instruction next to the real instructions it becomes. A pseudo-instruction is a shorthand that the assembler expands into one or more real instructions. Programs print text and read input through system calls that match those of MARS and Spike.
History
Benjamin Landers created RARS in 2017 by adapting MARS 4.5. MARS is an assembler and simulator for MIPS, an older instruction set, built by Pete Sanderson and Kenneth Vollmar at Missouri State University, and it was a standard tool in assembly courses for many years.
The switch from MIPS to RISC-V dropped MIPS features such as delayed branches and added a test framework that checks RARS against the RISC-V specification. Instructions load as plugins, so a new extension can be supported by placing compiled classes in a folder.
Where it is used
A course that taught MIPS with MARS can move to RISC-V with RARS and keep a familiar interface and familiar system calls. RARS ships as a single file and runs on any computer with Java 8 or newer.
