Let's Play with Hardcaml!

Posted on November 28, 2026 / Tags: , , ,

Table of contents


I prepared a five-minute lightning talk for the 8th Homebrew CPU Meetup on November 28, 2026. The slides are below.

This talk is a gentle introduction to Hardcaml, an RTL design library embedded in OCaml. Rather than discussing advanced verification techniques, I wanted to share the fun of building digital circuits in an interactive programming environment.

We start with a simple 5-bit counter and do everything inside utop, an OCaml REPL:

No FPGA, external Verilog simulator, or even a separate OCaml project is needed to try this example. I tested the installation steps and the REPL session in a Docker environment, so you can follow along with the slides.

And what happens if we keep playing with Hardcaml?

With the help of AI coding agents, I ended up building a dual-core RISC-V SoC that boots Linux 6.18 with SMP on a Colorlight i9 FPGA board.

I hope this talk encourages more people to give Hardcaml a try and enjoy building their own digital circuits.