A few years ago [Takaya Saeki] and fellow students of the University of Tokyo, were given a very limited instruction during their ‘CPU exercise’ class, along the lines of:
Take this ray-tracing program written in OCaml and run it on your CPU implemented on an FPGA
Splitting into groups to cover the CPU, FPU, simulator tool, and compiler toolchain, the students started with designing a RISC ISA, then designed a CPU around that. You can follow along with the retrospective writeup of the class, then dive into the GitHub pages for each of the components of the system, although the commentary is mainly in Japanese. Hey, you can google translate right?
The original task was to run a raytracing demo on the FPGA-hosted CPU, but the students went much further, porting Xv6, which is a Unix-like OS intended for educational use, provided by MIT, then ran the OCaml raytracing demo on top of that. Xv6 is intended for x86, not their own ISA, so a significant amount of work was needed on the compiler toolchain. The obvious path would be to port LLVM or GCC, but the group decided it would be more fun to make their C89-compliant toolchain from scratch, and UCC was born!
Now, we know what you’re thinking — the number one question — can it run doom? We don’t know yet, but here on Hackaday, there’s always another one around the corner that can.