ML (and C) to RISC-V Compiler written in Ocaml, using LLVM as the IR.
This was a project for Compiler Construction course.
- Clone the repository:
git clone https://github.com/cc0ffee/ML2RISCV-compiler.git
cd ML2RISCV-compiler- Run make:
make allNOTE: You might need to run
eval $(opam env)once you install dependencies
To compile an ML or C source file:
./main [ml-or-c-filepath]Within the repository includes two folders c-tests and ml-tests to be used as example compilations.
Use Venus Simulator or a local environment to run the RISC-V output. The result will be recorded in the a0 register.