Skip to content

Commit a7528f5

Browse files
committed
Docs: update DFT status and baselines
1 parent d54712d commit a7528f5

File tree

2 files changed

+117
-15
lines changed

2 files changed

+117
-15
lines changed

doc-DFT.md

Lines changed: 108 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
This is a living worklog for DFT scan insertion + scan-chain stitching/optimization in ORFS. For historical comparisons, **OpenROAD `7bc521f36a` is treated as the “baseline DFT”** (often yields 0 chains due to scan-pin recognition failures). All work here assumes a **vanilla OpenSTA** requirement (no `src/sta` parser changes required).
44

5-
## Workspace snapshot (2026-02-07)
5+
## Workspace snapshot (2026-02-12)
66

7-
- ORFS (this repo): `e3fd2753805f` (dirty)
8-
- OpenROAD submodule: `9d5965b56818` (dirty; local patches under `tools/OpenROAD/src/dft/`)
9-
- OpenSTA submodule: `d7cb9be1ca02` (vanilla)
7+
Reproducible “clean DFT” baselines (PrecisEDAnon GitHub):
8+
- OpenROAD: `OpenROAD-clean-DFT` @ `b64941f4c9` (scan_enable buffering + strict polarity default)
9+
- ORFS: `ORFS-clean-DFT` (pins `tools/OpenROAD` to `b64941f4c9`)
10+
- OpenSTA: `d7cb9be1` (vanilla)
11+
12+
Active dev branches (PrecisEDAnon GitHub):
13+
- OpenROAD: `OpenROAD-toggle-rebased-DFT` @ `9b94d649ad`
14+
- ORFS: `ORFS-toggle-rebased-DFT`
15+
16+
Local note:
17+
- This repo’s working tree may be dirty; for reproducible DFT behavior (especially `buffer_scan_enable`), prefer the clean baselines above.
1018

1119
## Goal / Scope
1220

@@ -20,12 +28,95 @@ This is a living worklog for DFT scan insertion + scan-chain stitching/optimizat
2028
- **fixed DFT** (actually produces scan flops + stitched chains),
2129
- using QoR proxies and a scan-chain “TSP-like” cost metric.
2230

23-
## Status (as of 2026-02-07)
31+
## Status (as of 2026-02-12)
32+
33+
- ORFS hooks support `DFT_ENABLE=1` end-to-end: `scan_replace`, scan port creation, optional scan port placement, chain stitching, and reporting.
34+
- OpenROAD scan ordering:
35+
- `PLACEMENT` metric uses consistent pin-to-pin Manhattan distance (scan-out pin → next scan-in pin).
36+
- `SCANOPT` solver integrates UCLA ScanOptpack (`UCLApack-3-010411`), and the repo-root UCLApack sources match OpenROAD’s vendored copy used by DFT.
37+
- For A/B comparisons, fix `DFT_SCANOPT_SEED` and increase `DFT_SCANOPT_TIME_LIMIT` to reduce run-to-run variance from tight time budgets.
38+
- ORFS scan-chain tooling (cost + plotting + bundled external solver I/O) uses pin-level asymmetric costs (scan-out → scan-in) and includes Begin/End terms when endpoints are known.
39+
- Scan enable fanout control is handled in OpenROAD as `buffer_scan_enable`; ORFS calls it by default via `DFT_BUFFER_SCAN_ENABLE=1` (falls back to legacy `insert_buffer` if the command is unavailable).
40+
- `polarity_mode=strict` is the default (so mixed-edge flops are split across chains unless explicitly overridden).
41+
- ORFS `final_report.tcl` no longer hard-requires `orfs_write_db` (falls back to `write_db`), avoiding fork regressions.
42+
- When `DFT_SCAN_ORDER_CONSTRAINTS_FILE` is set, ORFS keeps OpenROAD’s ordering (does not apply external `scanopt_next` reorder) so groups/paths/before/fixed_edge constraints are preserved.
43+
- Verification smoke tests completed:
44+
- ORFS `nangate45/gcd` runs end-to-end through `finish` with `DFT_ENABLE=1` on `ORFS-clean-DFT`.
45+
- “DFT-only” planning on a pre-done `sky130hd/jpeg` placement validates with 0 broken links (including a multi-chain run).
46+
- `dft-verifier/DFTRepro` outputs were backed up and regenerated cleanly; prior invalid pin placement issues were traced to harness pin/endpoints setup and fixed.
47+
48+
## Verification (quick sanity)
49+
50+
### 0) Confirm the OpenROAD binary you are using
51+
52+
In this workstream there are often multiple OpenROAD builds in play. For DFT runs, the minimal sanity check is that your OpenROAD build has Python enabled and exposes the DFT commands you expect.
53+
54+
Example:
55+
56+
```tcl
57+
# check_dft.tcl
58+
puts "buffer_scan_enable: [info commands buffer_scan_enable]"
59+
puts "write_scandef: [info commands write_scandef]"
60+
exit
61+
```
62+
63+
Run with:
64+
65+
```bash
66+
$OPENROAD_EXE -exit check_dft.tcl
67+
```
68+
69+
### 1) ORFS end-to-end smoke test (Nangate45 `gcd`)
70+
71+
```bash
72+
make -C flow DESIGN_CONFIG=./designs/nangate45/gcd/config.mk FLOW_VARIANT=dft_gcd_smoke DFT_ENABLE=1 finish
73+
```
2474

25-
- ORFS hooks support `DFT_ENABLE=1` end-to-end: scan replace, scan port creation, optional scan port placement, chain stitching, and reporting.
26-
- `execute_dft_plan` supports multi-chain planning with hard feasibility checks (`chain_count`, `max_length`, `max_imbalance`) and a constraints file for chain naming/endpoints/grouping/ordering/exclusion.
27-
- Multi-chain “big jumps” are reduced by (a) including Begin/End costs in ordering, (b) selecting between K-means vs X/Y/Hilbert sweep partitions using a “worst within-chain Manhattan diameter” objective (tie-break by worst X/Y gap), and (c) a stronger `SCANOPT` long-edge penalty + worst-edge local moves (including direction-preserving 3-opt segment swap).
28-
- Regressions + visualization live under `dft_artifacts/` plus convenience plots under `new_highlighter/` and `highlighter_flattened/`.
75+
### 2) “DFT-only” sanity on an existing `sky130hd/jpeg` placement (do not re-run the full flow)
76+
77+
Single-chain planning + validation:
78+
79+
```bash
80+
python3 flow/util/scan_chain_validate.py \
81+
--odb flow/results/sky130hd/jpeg/jpeg_real1_fresh_20260209/3_5_place_dp.odb \
82+
--openroad "$OPENROAD_EXE" \
83+
--liberty flow/platforms/sky130hd/lib/sky130_fd_sc_hd__tt_025C_1v80.lib \
84+
--sdc flow/results/sky130hd/jpeg/jpeg_real1_fresh_20260209/3_place.sdc \
85+
--scan-replace --execute-dft-plan --ensure-ports
86+
```
87+
88+
Multi-chain planning + validation:
89+
90+
```bash
91+
python3 flow/util/scan_chain_validate.py \
92+
--odb flow/results/sky130hd/jpeg/jpeg_real1_fresh_20260209/3_5_place_dp.odb \
93+
--openroad "$OPENROAD_EXE" \
94+
--liberty flow/platforms/sky130hd/lib/sky130_fd_sc_hd__tt_025C_1v80.lib \
95+
--sdc flow/results/sky130hd/jpeg/jpeg_real1_fresh_20260209/3_place.sdc \
96+
--max-chains 4 --max-length 1200 \
97+
--scan-replace --execute-dft-plan --ensure-ports --auto-chains
98+
```
99+
100+
### 3) `dft-verifier/DFTRepro` harness (packaged DB)
101+
102+
Location:
103+
- `dft-verifier/DFTRepro/` (OpenROAD Python-based harness atop a packaged `db/`).
104+
- Note: in this ORFS checkout, `dft-verifier/` may be a local/untracked workspace folder (not part of upstream ORFS).
105+
106+
Backups:
107+
- Existing prior outputs (other OpenROAD variants) are preserved under `dft-verifier/DFTRepro/backups/`.
108+
- Most recent backup during this work: `dft-verifier/DFTRepro/backups/20260212_072356/`.
109+
110+
Regenerate using a specific OpenROAD build:
111+
112+
```bash
113+
cd dft-verifier/DFTRepro
114+
OPENROAD_EXE="$OPENROAD_EXE" ./run_all.sh
115+
```
116+
117+
Notes:
118+
- The harness now clamps scan ports to the die area and avoids `(0,0)` endpoint collisions (which previously caused `GRT-0080 Invalid pin placement`).
119+
- The harness calls `buffer_scan_enable` (when available) to avoid GRT issues on very high scan_enable fanout.
29120

30121
## Baselines, Branches, and Key Commits (history)
31122

@@ -39,8 +130,8 @@ This is a living worklog for DFT scan insertion + scan-chain stitching/optimizat
39130
- Older variant (kept for history): `orfs-dft-scan-with-opensta`
40131
- `5d3e1e243c`
41132

42-
- Current base used in this workspace: `OpenROAD-clean-DFT-next`
43-
- `9d5965b56818` + local patches (see `git -C tools/OpenROAD status`)
133+
- Clean DFT baseline (PrecisEDAnon): `OpenROAD-clean-DFT` @ `b64941f4c9`
134+
- Active dev baseline (PrecisEDAnon): `OpenROAD-toggle-rebased-DFT` @ `9b94d649ad`
44135

45136
### OpenSTA submodule (`tools/OpenROAD/src/sta`)
46137

@@ -120,6 +211,10 @@ Implemented in `tools/OpenROAD/src/dft/src/config/ScanArchitectConfig.cpp` (see
120211
- exact: `exclude <inst/group...>`
121212
- patterns: `exclude_instance_pattern <glob...>` (alias: `exclude_name_pattern`) and `exclude_master_pattern <glob...>` (aliases: `exclude_master`, `exclude_master_patterns`) (`*`/`?` supported)
122213

214+
Name escaping (important):
215+
- Instance tokens in constraints must match OpenDB instance names exactly. In DEF/ODB, bus indices are typically escaped (e.g. `foo\\[0\\]`), so a Verilog-style token like `foo[0]` will not match.
216+
- For `inst/pin` terms, escape literal slashes as `\\/` (OpenROAD treats unescaped `/` as the inst/pin separator).
217+
123218
Planner sanity:
124219
- If the constraints file defines chain names, their count must match the DFT plan’s total chain count (after domain splitting), otherwise `execute_dft_plan` errors instead of silently producing fewer chains.
125220

@@ -252,7 +347,7 @@ Routing robustness:
252347

253348
### OpenROAD executables used
254349

255-
- OpenROAD under test: `tools/OpenROAD/build/bin/openroad` (build of `tools/OpenROAD`, currently `9d5965b56818` + local patches)
350+
- OpenROAD under test: `$(pwd)/tools/OpenROAD/build/bin/openroad` (build of the `tools/OpenROAD` submodule pinned by your ORFS checkout; use `ORFS-clean-DFT` for the clean baseline pinned to `b64941f4c9`)
256351
- Baseline OpenROAD (historical): build OpenROAD at `7bc521f36a` (ideally in a separate clone/worktree/build dir) and point `OPENROAD_EXE` at that binary
257352
- Example build (separate build dir): `git -C tools/OpenROAD checkout 7bc521f36a && cmake -S tools/OpenROAD -B tools/OpenROAD/build_7bc521 && cmake --build tools/OpenROAD/build_7bc521 -j"$(nproc)"`
258353

@@ -533,7 +628,7 @@ For a placed `*.odb` + `*.sdc` where scan flops already exist, `flow/util/dft_pr
533628
Example (ibex, Nangate45):
534629
- `python3 flow/util/dft_preplaced_regress.py --openroad tools/OpenROAD/build/bin/openroad --liberty flow/platforms/nangate45/lib/NangateOpenCellLibrary_typical.lib --odb flow/results/nangate45/ibex/qor_scan_dft_maxlen200_20260106/3_place.odb --sdc flow/results/nangate45/ibex/qor_scan_dft_maxlen200_20260106/3_place.sdc --scan-order-metric PIN_TO_NET --scan-order-solver SCANOPT --scanopt-rounds 500000 --scanopt-time-limit 600 --chain-counts 4 --max-imbalances 30 --out-prefix dft_artifacts/preplaced_runs/ibex_k4_sweepselect_t600/preplaced_ibex_p2n --out-json dft_artifacts/preplaced_runs/ibex_k4_sweepselect_t600/summary.json`
535630

536-
Current regression results (OpenROAD `9d5965b56818` + local patches; `PIN_TO_NET` + `SCANOPT`; `scanopt_time_limit=600` total budget):
631+
Regression results (2026-02-07 snapshot; OpenROAD `9d5965b56818` + local patches; `PIN_TO_NET` + `SCANOPT`; `scanopt_time_limit=600` total budget):
537632

538633
| design | chains | max_imbalance | max_step (um) | p99_step (um) | run |
539634
| --- | ---: | ---: | ---: | ---: | --- |

doc.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,15 @@ Validation:
7272
- Preplaced regress: `python3 flow/util/dft_preplaced_regress.py ...` (see `doc-DFT.md`)
7373
- Plots: `python3 highlighter.py --def ... --verilog ... --output-plot ...` (dashed black edges are scan I/O port→chain-endpoint “stems”, not intra-chain edges; use `flow/util/scan_chain_plot.py --no-io-edges` to hide them)
7474

75-
Status (2026-02-07):
76-
- Multi-chain “big jumps” reduced via Hilbert/axis sweep partition selection + SCANOPT worst-edge direction-preserving 3-opt; k=22 example plots are in `dft_artifacts/preplaced_runs/ibex_k22_hilbert_20260207/` (see `doc-DFT.md`).
75+
Status (2026-02-12):
76+
- Clean baselines are pushed and reproducible:
77+
- OpenROAD: `OpenROAD-clean-DFT` @ `b64941f4c9` (adds `buffer_scan_enable`, defaults `polarity_mode=strict`)
78+
- ORFS: `ORFS-clean-DFT` (pins `tools/OpenROAD` to `b64941f4c9`, guards `orfs_write_db`, prefers local `tools/OpenROAD/build/bin/openroad`)
79+
- `UCLApack-3-010411` (repo root) matches OpenROAD’s vendored copy under `tools/OpenROAD/src/dft/third_party/UCLApack-3-010411` for the ScanOpt sources used by DFT.
80+
- ORFS end-to-end DFT smoke test passes: `nangate45/gcd` completes `finish` with `DFT_ENABLE=1` on `ORFS-clean-DFT`.
81+
- “DFT-only” sanity on a pre-done `sky130hd/jpeg` placement passes: `scan_replace + execute_dft_plan` validates with 0 broken links (including a 4-chain run).
82+
- `dft-verifier/DFTRepro`: backed up old outputs, fixed harness pin placement + endpoint constraints + scan_enable buffering; suite regenerates without the prior `GRT-0080 Invalid pin placement` failures.
83+
- Multi-chain “big jumps” remain reduced via Hilbert/axis sweep partition selection + SCANOPT worst-edge direction-preserving 3-opt (see `dft_artifacts/preplaced_runs/ibex_k22_hilbert_20260207/`).
7784

7885
---
7986

0 commit comments

Comments
 (0)