Bottom-up design-technology co-optimization (DTCO) on an open stack. This repo connects transistor-level changes to chip-level PPA using only open tools: ngspice + sky130 BSIM4 models → cell characterization → Yosys/ABC synthesis → OpenSTA on the PicoRV32 RISC-V core. The end goal is ML-driven optimization across all layers.
The ML layers live in sibling repos:
gym-yosys-synth: an RL environment for logic synthesis.openroad-rl-timer: an RL environment for gate sizing in OpenROAD.
The program plan is in docs/program/ROADMAP.md.
To our knowledge, no open-source, reproducible pipeline couples device models, cell characterization and open-PDK synthesis/timing under ML-driven optimization. That is a web-search absence, not a proof.
Setup:
- Vth knob: the sky130
nfet_01v8andpfet_01v8_hvtvth0are shifted by a calibrated ΔV ∈ {−60, −30, 0, +30, +60} mV. The knob is verified within 0.34 mV on held-out points. - Cell set: 7 cells (inv_1, inv_2, buf_2, nand2_1, nor2_1, a21oi_1, o21ai_0) are re-characterized from Magic-extracted netlists with
lctime+ ngspice. - Design: PicoRV32 is synthesized once against the ΔV = 0 library, buffered (max fanout 16), frozen, and timed with OpenSTA against each library.
| ΔV (mV) | critical path D (ns) | vs 0 mV | leakage of the 7 cells (nW) |
|---|---|---|---|
| −60 | 3.131 | −8.6 % | 9.31 |
| −30 | 3.271 | −4.5 % | 4.09 |
| 0 | 3.424 | — | 1.80 |
| +30 | 3.590 | +4.8 % | 0.79 |
| +60 | 3.773 | +10.2 % | 0.35 |
- Delay: +4.8 % at +30 mV, inside the pre-registered +2…+8 % band.
- Leakage: falls 26× from −60 to +60 mV. It stays within 2× of the 10^(−ΔV/SS) prediction, using the measured device SS of 96.5 mV/dec.
- Self-consistency: our characterized path delay matches OpenSTA within −2.9 % (rise) and −2.3 % (fall), against a ±10 % gate.
Every criterion was written down before its run, in docs/PREREG*.md. Failures are kept in results/run1..run4.
| run | stopped at | cause | fix (pre-registered amendment) |
|---|---|---|---|
| 1 | G1(b) | The pfet_01v8_hvt vth0 offset moves the extracted Vth by only 0.95×. |
1b: calibrated knob |
| 2 | G2 | The PDK liberty is not reproducible from the open models (23.7 % median error). | 1c: self-consistency gate G2′ on extracted netlists |
| 3 | G2′ | The characterizer's slew stimulus used 0–100 % ramps while the library uses 20–80 %. | RUN4_BUGFIX.md |
| 4 | G4 | The netlist was unbuffered (fanout 681), so STA extrapolated far outside the characterized tables. | 1d: frozen buffering plus a table-range validity check |
| 5 | — | all pass | — |
Disclosure: a run-4 diagnostic on in-range paths was seen before run 5, so the P1 delay prediction in run 5 is not blind.
- This is a sky130-derived BSIM4-perturbation study at the typical corner: no FinFET, no PDK sign-off claim.
- The flip-flops (
dfxtp_1) are deliberately not re-characterized. Their leakage (≈13.5 nW) exceeds that of the 7 tuned cells, so chip-level leakage gains are much smaller than 26×. - Timing is pre-placement with zero wire RC.
- The PDK's own pfet-off leakage is 30–150× higher than what the open models give; the cause is open.
src/p4slice/: model rewriting, ngspice drivers, lctime driver, liberty parsing.scripts/: per-run gate scripts (*4.py/*5.pyare the current ones).docs/: pre-registrations and amendments.results/runN/: gate outputs per run, withresults/run5/phase1_results.mdas the final report.diag/: extraction diagnostics.netlists/: extracted cells and the frozen buffered PicoRV32.docs/program/: roadmap, toolchain versions, venv freeze.
Requirements:
- the toolchain in
docs/program/TOOLCHAIN.md: OpenLane 2.3.10 nix env, ngspice-42, Python venv as invenv-freeze.txt; lctime0.0.26 in its own venv;SKY130Apointing to the sky130A PDK (volare hash0fe599b2).
Run pytest -q (29 tests). Run 5 = scripts/char_lib4.py + build_libs4.py (libraries), synth4.py + buffer5.py + buf5_check.py (frozen buffered netlist, equivalence), sta5.py (G3/G4/P1/P2). run_all.sh reproduces run 2 only. Characterization takes about 18 min per ΔV point on 16 cores.
- ML on top of the loop: BO over device knobs → PPA (Project 4 outer loop).
- A DEVSIM device front end (Project 1).
- Feeding in the synthesis and sizing agents from the sibling repos.
License: Apache-2.0 (see NOTICE for the third-party material).