No description
Find a file
Oliver Thomas d061041c81 Merge branch '8-init-stack-pointer-to-last-4-bytes-of-main-memory' into 'main'
Resolve "Init stack pointer to last 4 bytes of main memory"

Closes #8

See merge request OFThomas/niscv!6
2023-04-27 22:03:23 +00:00
docs trying loops 2023-04-08 20:03:26 +01:00
objects added objects so that CI test pass... 2023-04-27 23:01:23 +01:00
src Changed default mem to 128 bytes, changed sp to be init half of main memory 2023-04-26 19:30:55 +01:00
tests added objects so that CI test pass... 2023-04-27 23:01:23 +01:00
.gitignore added objects so that CI test pass... 2023-04-27 23:01:23 +01:00
.gitlab-ci.yml please 2023-04-08 13:37:29 +01:00
.tmp build problems 2023-04-03 21:25:38 +01:00
config.nims Fixed repo structure 2023-04-08 11:18:52 +01:00
LICENSE Add LICENSE 2023-04-22 13:13:05 +00:00
Makefile added cpp bindings, test works, elf doesn't 2023-03-02 20:03:41 +00:00
mkdocs.yml Added notes on Functional and Performance simulators 2023-01-23 21:40:13 +00:00
niscv added objects so that CI test pass... 2023-04-27 23:01:23 +01:00
niscv.nimble added register value printing for each instruction decode 2023-04-23 22:13:16 +01:00
README.md Merge branch 'main' of gitlab.com:OFThomas/niscv 2023-04-20 19:38:05 +01:00
riscv-spec-20191213.pdf Messed up gitignore, all good now 2023-02-24 16:11:59 +00:00

Nisc-V

This repo contains minimal code to emulate small parts of the RISC-V ISA.

Documentation is here.

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

  1. 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.