|
| 1 | +# Surrogate autotuner (OpenROAD + ORFS) — status / handoff (2026-01-10) |
| 2 | + |
| 3 | +Canonical end-to-end guides (these are what we expect users to follow): |
| 4 | + |
| 5 | +- ORFS normal branch: `surrogate_autotuner_guide.md` |
| 6 | +- ORFS rebased branch: `flow/surrogate_autotuner_guide.md` |
| 7 | + |
| 8 | +This `doc.md` is a “current status” handoff that ties together the 4 branches, |
| 9 | +their pairing rules, gating, and known limitations/results. |
| 10 | + |
| 11 | +Note: upstream `.gitignore` ignores `doc.md`, but in these surrogate branches the |
| 12 | +file is intentionally tracked (gitignore does not apply to tracked files). |
| 13 | + |
| 14 | +## Current branch set (precisedanon) |
| 15 | + |
| 16 | +The deliverable is **four branches total** (two repos × normal/rebased): |
| 17 | + |
| 18 | +### ORFS (OpenROAD-flow-scripts) |
| 19 | + |
| 20 | +- `orfs-surrogate-normal` |
| 21 | + - Base: `93c42b2e6` + **1 commit** (minimal surrogate integration + docs) |
| 22 | + - OpenROAD submodule pin: `tools/OpenROAD @ 0b3616e102` (`openroad-surrogate-normal`) |
| 23 | + - Guide: `surrogate_autotuner_guide.md` |
| 24 | +- `orfs-surrogate-rebased` |
| 25 | + - Rebased on The-OpenROAD-Project `master` (then surrogate plumbing + docs) |
| 26 | + - OpenROAD submodule pin: `tools/OpenROAD @ f5de6e7462` (`openroad-surrogate-rebased`) |
| 27 | + - Guide: `flow/surrogate_autotuner_guide.md` |
| 28 | + |
| 29 | +### OpenROAD (tools/OpenROAD) |
| 30 | + |
| 31 | +- `openroad-surrogate-normal` |
| 32 | + - Base: `7bc521f36a` + **1 commit** `0b3616e102` (“surrogate: add autotune support”) |
| 33 | + - Surrogate commands are compiled in and available without extra gating. |
| 34 | +- `openroad-surrogate-rebased` |
| 35 | + - Base: OpenROAD `upstream/master` + `a04f00a450` + `f5de6e7462` |
| 36 | + - Compile-time gate: `-D ENABLE_SURROGATE=ON` (default `OFF`) |
| 37 | + - Runtime gate: `OPENROAD_ENABLE_SURROGATE=1` (default `OFF`) |
| 38 | + - Surrogate TCL commands are only registered when both gates are enabled. |
| 39 | + |
| 40 | +Pairing rules: |
| 41 | + |
| 42 | +- `orfs-surrogate-normal` ↔ `openroad-surrogate-normal` |
| 43 | +- `orfs-surrogate-rebased` ↔ `openroad-surrogate-rebased` |
| 44 | + |
| 45 | +## Quick run (normal vs rebased) |
| 46 | + |
| 47 | +Normal: |
| 48 | + |
| 49 | +```bash |
| 50 | +git checkout orfs-surrogate-normal |
| 51 | +git submodule update --init --recursive |
| 52 | +./build_openroad.sh --local |
| 53 | + |
| 54 | +# Baseline logs (recommended for calibration) |
| 55 | +make -C flow finish DESIGN_CONFIG=designs/<platform>/<design>/config.mk |
| 56 | + |
| 57 | +# Surrogate autotune (example) |
| 58 | +make -C flow surrogate_autotune DESIGN_CONFIG=designs/<platform>/<design>/config.mk \ |
| 59 | + SURROGATE_VALIDATE=1 SURROGATE_VALIDATE_N=14 |
| 60 | +``` |
| 61 | + |
| 62 | +Rebased: |
| 63 | + |
| 64 | +```bash |
| 65 | +git checkout orfs-surrogate-rebased |
| 66 | +git submodule update --init --recursive |
| 67 | +./build_openroad.sh --local --openroad-args "-D ENABLE_SURROGATE=ON" |
| 68 | + |
| 69 | +# Surrogate targets on this branch run OpenROAD with OPENROAD_ENABLE_SURROGATE=1 |
| 70 | +make -C flow surrogate_autotune DESIGN_CONFIG=designs/<platform>/<design>/config.mk \ |
| 71 | + SURROGATE_VALIDATE=1 SURROGATE_VALIDATE_N=14 |
| 72 | +``` |
| 73 | + |
| 74 | +## What is shipped (ORFS surface area) |
| 75 | + |
| 76 | +New `flow/Makefile` targets: |
| 77 | + |
| 78 | +- `make -C flow surrogate_tune` (calls OpenROAD `surrogate_optimize` on the current synthesized netlist) |
| 79 | +- `make -C flow surrogate_tune_synthaware` (clock sweep: rewrite SDC + re-synth per clock, then tune) |
| 80 | +- `make -C flow surrogate_autotune` (orchestrates synth-aware tuning; can optionally run `finish` validations) |
| 81 | + |
| 82 | +Implementation entry points: |
| 83 | + |
| 84 | +- ORFS: `flow/scripts/surrogate_tune.tcl`, `flow/scripts/surrogate_tune_synthaware.py`, `flow/scripts/surrogate_autotune.py` |
| 85 | +- OpenROAD: `surrogate_optimize` and `surrogate_supported_features` (C++: `tools/OpenROAD/src/Surrogate.cc`) |
| 86 | + |
| 87 | +## Supported values (objectives + knobs) |
| 88 | + |
| 89 | +### Objectives (`SURROGATE_OBJECTIVE`) |
| 90 | + |
| 91 | +Supported objective names (minimize): |
| 92 | + |
| 93 | +- `effective_clock_period` (default) |
| 94 | +- `routed_wirelength` |
| 95 | +- `power` |
| 96 | +- `instance_area` |
| 97 | +- `area` |
| 98 | + |
| 99 | +Note: empirical “expected gains” are currently only characterized on disk for |
| 100 | +`effective_clock_period` and `routed_wirelength` at ~`600s` and `K=14` (see below). |
| 101 | + |
| 102 | +### Knob space keys |
| 103 | + |
| 104 | +This integration is intentionally **restricted** vs ORFS’s baseline autotuner. |
| 105 | +Only a small fixed set of knob names is supported; unknown keys are ignored. |
| 106 | + |
| 107 | +See the guides for the full “supported knob → ORFS variable” table and valid ranges. |
| 108 | + |
| 109 | +## Expected gains (what users should expect) |
| 110 | + |
| 111 | +From on-disk runs with `SURROGATE_TIME_BUDGET_S=600` and `SURROGATE_VALIDATE_N=14` |
| 112 | +(K=14), across `{asap7,nangate45,sky130hd} × {aes,ibex,jpeg}`: |
| 113 | + |
| 114 | +- `routed_wirelength`: median gain `3.35%` (p25 `0.96%`, p75 `7.37%`), best observed `15.78%`, worst `0%` |
| 115 | +- `effective_clock_period`: median gain `2.99%` (p25 `1.61%`, p75 `4.71%`), best observed `11.58%`, worst `0%` |
| 116 | + |
| 117 | +Not yet characterized at ~`600s` on disk: `power`, `instance_area`, `area`. |
| 118 | + |
| 119 | +## Outputs / artifacts |
| 120 | + |
| 121 | +Outputs: |
| 122 | + |
| 123 | +- `flow/results/<platform>/<design>/<variant>/surrogate_optimize.json` |
| 124 | +- `flow/results/<platform>/<design>/<variant>/surrogate_synthaware.json` |
| 125 | +- `flow/results/<platform>/<design>/<variant>/surrogate_autotune.json` |
| 126 | + |
| 127 | +Logs: |
| 128 | + |
| 129 | +- `flow/logs/<platform>/<design>/<variant>/surrogate_tune.log` |
| 130 | +- `flow/logs/<platform>/<design>/<variant>/surrogate_tune_synthaware.log` |
| 131 | +- `flow/logs/<platform>/<design>/<variant>/surrogate_autotune.log` |
| 132 | + |
| 133 | +## Known limitations / TODOs (explicit) |
| 134 | + |
| 135 | +- Objective support beyond `{effective_clock_period, routed_wirelength}` is **not yet validated** with enough on-disk runs to quote expected gain ranges. |
| 136 | +- The knob space is intentionally restricted; this is not a drop-in replacement for baseline ORFS autotuning. |
| 137 | + |
| 138 | +## Disk footprint (practical note) |
| 139 | + |
| 140 | +Full `finish` runs can generate large artifacts under `flow/results/**` (e.g. `.odb`, `.def`, `.gds`, `.spef`). |
| 141 | +If you need to reclaim disk, the safest first pass is to keep `flow/logs/**` and remove large, reproducible outputs |
| 142 | +under `flow/results/**` for old variants you don’t need. |
0 commit comments