From 1e98f3c0366dcb3f24f01240bb474c77c3052524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Thu, 14 May 2026 21:37:11 +0200 Subject: [PATCH 01/22] flow/README.md: document host-aware sweep + yosys-idempotency triage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore the sweep recipe (per-platform --keep_going, big designs solo, small designs batched) and the triage decision tree for failing _tests. The yosys-environment false-positive check now points at @bazel-orfs//:make-yosys-netlist (and the reverse @bazel-orfs//:yosys-check), which moved upstream in 432edcd63; the full workflow lives in @bazel-orfs//:TESTING.md "Debugging OpenROAD determinism (bazel vs make)". Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: Øyvind Harboe --- flow/README.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/flow/README.md b/flow/README.md index 9c4f2ff678..63621a894a 100644 --- a/flow/README.md +++ b/flow/README.md @@ -56,3 +56,82 @@ the generated targets get `tags = ["manual"]`. Each OpenROAD invocation takes `-threads `. A wildcard `bazelisk test` runs designs in parallel and overcommits the host. Cap with `--jobs=N`. + +## Running a full sweep without overburdening the host + +To verify every design under one or more platforms (e.g. before +bumping `bazel-orfs` or `tools/yosys`), drive `bazelisk test` per +platform with `--keep_going` so one failure doesn't mask the rest, +and split big designs into their own invocations so routing/synth +don't overcommit RAM. + +```bash +# 1. Install the make-flow toolchain too, so failures can be +# cross-checked against `make DESIGN_CONFIG=...`. +(cd tools/OpenROAD && bazelisk run //:install) + +# 2. List actual test targets per platform (capture before running +# so the sweep is reproducible). +bazelisk query 'tests(//flow/designs/asap7/...)' +bazelisk query 'tests(//flow/designs/sky130hd/...)' + +# 3. Small/fast designs in one parallel invocation; each big design +# in its own sequential invocation. 16-core / 30 GiB box: +bazelisk test --keep_going \ + //flow/designs/asap7/aes/... //flow/designs/asap7/gcd/... \ + //flow/designs/asap7/uart/... //flow/designs/sky130hd/gcd/... # etc. + +for big in cva6 ibex jpeg riscv32i swerv_wrapper; do + bazelisk test --keep_going //flow/designs/asap7/${big}/... +done +``` + +Heuristic: hierarchical / RISC-V cores / image-processing designs +run solo; everything else batches. Use `--jobs=N` to cap parallel +OpenROAD invocations if the host still thrashes. + +## Triaging a failing `_test` + +For each failing `_test`, decide which bucket it falls into: + +1. **Trivial config fix.** Missing variable in + `flow/scripts/variables.yaml`, a typo in `config.mk`, a missing + `exports_files()` for a cross-design SDC/Verilog reference, etc. + Fix in place; `variables.yaml` is the single source of truth + bazel-orfs validates against. + +2. **Yosys-environment false positive (OpenROAD is idempotent given + the same netlist).** Bazel-built yosys and make-built yosys + produce different `1_2_yosys.v` for the same RTL, and that + netlist drift can move QoR past `rules-base.json` thresholds + even when OpenROAD itself is bit-deterministic. Confirm with: + + ```bash + bazelisk run @bazel-orfs//:make-yosys-netlist \ + //flow/designs/asap7/:_test + ``` + + All stages MATCH in the `bazel+make-netlist` column → false + positive, ignore (or relax the threshold). Any DIFFER → real + bazel-vs-make OpenROAD divergence — file the per-stage SHA + matrix as an issue. `@bazel-orfs//:yosys-check` is the + reverse-direction wrapper (bazel's netlist into make). + + Full workflow + interpretation, the `SYNTH_NETLIST_FILES` manual + override, and the `BLOCKS=` caveat live in + [`@bazel-orfs//:TESTING.md`](https://github.com/The-OpenROAD-Project/bazel-orfs/blob/main/TESTING.md) + under "Debugging OpenROAD determinism (bazel vs make)". + +3. **Real bug (both flows fail at the same stage).** `.odb` SHAs may + still differ (yosys version) but the failure mode matches. + Generate an issue tarball from the make flow: + + ```bash + cd flow + make _issue DESIGN_CONFIG=designs///config.mk \ + ISSUE_TAG=-- + ``` + + `flow/util/utils.mk` auto-generates `