This project consists of a 16-bit RISC-V Logisim CPU, an assembler for ARM-style assembly, and test files for various CPU components.
The Logisim CPU directory contains the CPU file named cpu.circ. Open this file using Logisim 3.8.0, included in the directory, or use the modified version Logisim 3.9.0dev, better suited for the lab.
The Test Files directory includes test files for the CPU components, such as the ALU, Register File, Programmable CPU, Data Memory, and Branching.
The Assembler directory contains a Python script that converts ARM-style assembly into hexadecimal code. The script writes the output to output.rom, which can be loaded into the CPU's ROM in Logisim.
The CPU, along with its assembler, can process the following instructions:
ADD(Signed Integer Addition)SUB(Signed Integer Subtraction)AND(Bitwise AND)OR(Bitwise OR)NOR(Bitwise NOR)LSL(Logical Shift Left)LSR(Logical Shift Right)ASR(Arithmetic Shift Right)
LD(Load)ST(Store)
EQ(Equal)NE(Not Equal)LT(Signed Less Than)LE(Signed Less or Equal)GT(Signed Greater Than)GE(Signed Greater or Equal)
-
Logisim CPU:
- Open
cpu.circusingLogisim 3.8.0or the modified versionLogisim 3.9.0dev.
- Open
-
Assembler:
- Run the Python script in the
Assemblerdirectory to convert ARM-style assembly into hexadecimal code. - Load the output (
output.rom) into the ROM module of the CPU in Logisim.
- Run the Python script in the
-
Simulation:
- Simulate the CPU by enabling and disabling
Auto-Tickto process the code in ROM or by using manual click cycles.
- Simulate the CPU by enabling and disabling
- Created: September 2023
- Last Updated: December 2023
- Update: Added Python assembler script (
assembler.py) to convert ARM-style assembly to hexadecimal instructions.