repositorypackage
0.0.0-20220215161347-42b9e718015f
Repository: https://github.com/code-hex/go-riscv.git
Documentation: pkg.go.dev
# README
RISC-V emulator
memo
- Writing a RISC-V Emulator in Rust
- HackerNews - Writing a RISC-V Emulator from Scratch
- The Adventures of OS: Making a RISC-V Operating System using Rust
- RISC-V ELF psABI
- riscv-emu (Go)
- RISC-V Instruction Formats
- github.com/johnwinans/rvalp - RISC-V Assemly Language Programming
- Writing a simple RISC-V emulator in plain C
- Japanese
Install tool-chain
- macOS should install using homebrew.
Instructions
RISC-V has been defined 6-type instructions
- R-format
- instructions using 3 register inputs
- add, xor, mul - arithmetic/logical ops
- I-format
- instructions with immediates, loads
- addi, lw, jalr, slli
- S-format
- store instructions
- sw, sb
- U-format
- instructions with upper immediates
- lui, auipc - upper immediate is 20-bits
- SB-format
- branch instructions
- beq, bge
- UJ-format
- jump instructions
- jal