Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiling and running a RISCV executable
This page is about using Sodor to run custom C programs. The page linked here says how to clone sodor, compile the verilog, and run the test suite.
This page says how to make your own program, compile it, and run it stand alone.
== This is a minimal (i.e. each parameter is required) command to compile a RISCV executable for sodor:
riscv64-unknown-elf-gcc -Ienv -static -std=gnu99 -mabi=ilp32 -march=rv32i -o helloworld.riscv helloworld.c common/syscalls.c common/crt.S -static -nostdlib -nostartfiles -lm -lgcc -T common/test.ld
To run an executable in sodor emulator, fesvr and sodor must be built (see https://github.com/librecores/riscv-sodor#building-the-processor-emulators). After successful
make step one can run
helloworld.riscv inside emulator using this command: