From 2413f949705316b2c752afd1b099ebaa3e01a102 Mon Sep 17 00:00:00 2001 From: D4VID Date: Fri, 12 Sep 2025 19:57:19 +0200 Subject: [PATCH] Add README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8378c1 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# RISC-V 32-bit CPU - RV32I + +Since there is a target in LLVM for rv32i, this CPU is able to run any C or Rust compiled program. + +## How to program the RISC-V 32bit CPU with one of the provided programs + +*Only Linux is supported and you need to have cargo, make and other build tools installed with support for the riscv32i-unknown-none-elf target.* + +1. Go to a directory of a program. +2. Run `make` - it will put the output to `/tmp/text.bin` and `/tmp/rodata.bin`. +3. Select `LOAD .TEXT` in game. +4. Run the console command `loadram /tmp/text.bin` +5. Select `LOAD .RODATA` in game (unselect `LOAD .TEXT`). +6. Run the console command `loadram /tmp/rodata.bin` +7. Hit `RESET` + +## Running + +- Toggle the yellow lever to run the cpu continously or hit the button below it to step instructions. +- The gray lever activates stepping instructions using the Enter key (you must look at it) + +## Debugging + +- You can set a breakpoint on the left and the CPU will pause when the program counter reaches the target address