mirror of
https://gitlab.com/OFThomas/niscv
synced 2026-01-14 21:21:39 +00:00
No description
Resolve "Init stack pointer to last 4 bytes of main memory" Closes #8 See merge request OFThomas/niscv!6 |
||
|---|---|---|
| docs | ||
| objects | ||
| src | ||
| tests | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .tmp | ||
| config.nims | ||
| LICENSE | ||
| Makefile | ||
| mkdocs.yml | ||
| niscv | ||
| niscv.nimble | ||
| README.md | ||
| riscv-spec-20191213.pdf | ||
Nisc-V
This repo contains minimal code to emulate small parts of the RISC-V ISA.
To install dependencies and build the emulator
nimble install
External requirements
sudo apt-get install libelf-dev
Installing the riscv toolchain
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=/opt/riscv --with-arch=rv32i --with-abi=ilp32
make linux
To build and run the tests
nimble test
You can test on a RV32I object file using
niscv ./pathtofile.o
Next steps
I think we've got all of the RV32I instructions
- Generate integer instruction subset
To test
Write a C program, compile it to RISC-V assembly, then compile the assembly to an object file.
Test the c program using the riscv toolchain. Then run the object file through the emulator.