Venus
Awesome RISC-V

Venus

RISC-V ecosystem

Venus is a teaching simulator for RV32IM assembly from UC Berkeley, used in CS 61C.

Overview

Venus is a RISC-V simulator that runs in a web browser. A simulator is a program that imitates a processor, so you can run machine code without owning RISC-V hardware. Venus reads assembly code written for RV32IM. Assembly code is the readable text form of machine instructions. RV32I is the basic 32-bit RISC-V instruction set, and the M extension adds multiplication and division.

The editor and the simulator share one page. Programs request services through ecall, the RISC-V instruction that asks the environment for something. Venus handles ecalls for printing values and for allocating more memory.

History

Keyhan Vakil started Venus in 2017 at UC Berkeley. The project is written in Kotlin, a programming language that can be compiled to JavaScript. That compilation is what lets the simulator run inside a browser with nothing to install.

UC Berkeley adopted Venus for CS 61C, its course on machine structures, where students write their first RISC-V programs. The course later kept its own fork at venus.cs61c.org. A fork is a copy of a project that is developed separately from the original. Another fork, Venus164, adds features for the ChocoPy compiler project in Berkeley's compilers course.

Where it is used

Venus fits a first course in assembly. A student opens a page, pastes a program and runs it. Its instruction set stays at RV32IM, a small set that keeps the first lessons focused on registers, memory and control flow.

Sources

  1. kvakil/venus README
  2. CS 61C Lab 3, UC Berkeley
  3. Venus164 fork