Lab
A terminal into macro_gen, ngspice and SKY130, running on your machine.
This page is a terminal into a small Linux box with macro_gen, ngspice and the SKY130 device models in it. The box runs on your computer, in Docker. Nothing runs on my server, and nothing here is canned: you get the same binary I use, with the same models, and it’s yours to poke at. Size the benchmarks, change their configs, write your own designs, rerun the dev log numbers, and take the whole workspace home when you’re done.
-
Install Docker
Install Docker Engine for your distribution. If you'd rather not use
sudofor every command, follow the post-install steps.Install Docker Desktop and start it. On Apple Silicon (M1 and later) the image runs under emulation, because it's built for x86-64 for now: it works, just a few times slower.
Install Docker Desktop with the WSL 2 backend and start it, then use PowerShell or a WSL terminal for the next step.
-
Start the lab
docker run --rm -it -p 127.0.0.1:7681:7681 ghcr.io/joyenbenitto/macro-gen-labThe first run downloads about 115 MB. It prints a link: open it, or paste the token below. The port is only reachable from your own machine, and only this page, holding the token, can connect.
Keep your work in a folder on your machine
With
--rm, the container's files go away when you stop it, unless you export them first. To work in a real folder instead, mount one:docker run --rm -it -p 127.0.0.1:7681:7681 -v "$PWD/macro-gen-work:/home/lab/work" ghcr.io/joyenbenitto/macro-gen-labAn empty folder gets the examples copied in. On Apple Silicon, add
--platform linux/amd64. -
Connect
Chrome will ask whether this site may access apps on your device. That's the container: allow it. I've tested this in Chrome; Firefox should work the same way. Safari may refuse to let a website reach
localhost, so if it does, use Chrome or Firefox.
What’s in the box
macro_gen, built with the CIRCT backend. It readshw+combMLIR, sizes every transistor by logical effort against a reference inverter it characterizes in ngspice, and writes SPICE, structural Verilog and a report.ngspice, to simulate what it writes.- The SKY130 device models for the tt corner (Apache-2.0).
- A workspace with ten benchmarks and the reproduction bundles from Dev Log #1 and Dev Log #2, plus vim, nano, python3 and git.
Some things to try once you’re in:
macro_gen --config benchmarks/c17/c17.toml --emit-verilog --add-buffer, thenless build/spice/c17.spice- Raise
cload_cinvin that config and watch the buffering change. - Long lines widen the terminal on their own, and the box scrolls sideways. You can also maximize the terminal to use the whole window.
cd dev-logs/02-sizing-logic && benchmarks/run.py, which regenerates the table from the post.