Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1e98f3c
flow/README.md: document host-aware sweep + yosys-idempotency triage
oharboe May 14, 2026
833813c
bazel: bump yosys to 0.65 via BCR PR registry override
oharboe May 15, 2026
1507e84
bazel: bump bazel-orfs to c000cb3 (user_sources= is upstream)
oharboe May 15, 2026
9246202
flow/designs/asap7/uart: bump rules-base.json from classic make flow
oharboe May 15, 2026
04ad3da
flow/README.md: lead yosys-idempotency triage with the hash warning
oharboe May 15, 2026
2cf32de
flow: bisect bazel-vs-make yosys drift with a pre-ABC hash
oharboe May 15, 2026
6dbaac9
flow: capture yosys/abc versions + bump submodule to v0.65 for same-v…
oharboe May 15, 2026
3e57288
flow: drill down — non-determinism enters in read_design_sources
oharboe May 15, 2026
6686096
bazel: enable blender 3D-viewer targets on every supported-PDK design
oharboe May 16, 2026
378a3b3
fix(generate_klayout_tech): drop realpath() — breaks Bazel sandbox
oharboe May 16, 2026
c99df9b
MODULE.bazel: keep bazel_dep(bazel-orfs) non-dev for load() visibility
oharboe May 16, 2026
7d4c8ce
fix(generate_klayout_tech): write absolute LEF paths — klayout sandbox
oharboe May 16, 2026
bd816be
MODULE.bazel: bump bazel-orfs c000cb3 -> 68b3d4e (+3 commits)
oharboe May 16, 2026
97cd251
bazel-orfs: pull src OrfsDepInfo.files into source_inputs
oharboe May 16, 2026
cbb8d9a
test(generate_klayout_tech): expect abspath, not relpath
oharboe May 17, 2026
e03b998
bazel: vendor render_gds.py phase logging + dynamic drop-to-GLB-budget
oharboe May 17, 2026
93ed85a
designs/rules-base.json: absorb QoR drift from yosys 0.65 + OpenROAD …
oharboe May 17, 2026
03ed40d
bazel: bump bazel-orfs 68b3d4e -> ef90d6c (upstream main, ~30 commits)
oharboe May 17, 2026
f29247e
lint: black + tclfmt fixes from CI
oharboe May 17, 2026
239d47b
bazel: trim layerstack before Blender import (fast-turnaround viewer)
oharboe May 17, 2026
eafadcd
bazel: bump bazel-orfs ef90d6c -> 3a5ddd7, all vendored patches now u…
oharboe May 17, 2026
4a9daf3
bazel: re-vendor render_gds PDK_CONFIGS fix (addon UnboundLocalError)
oharboe May 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ build --cxxopt "-std=c++20" --host_cxxopt "-std=c++20"
# bazel-orfs itself does (its own .bazelrc:7).
common --lockfile_mode=off

# Test yosys 0.65 via the BCR PR (bazelbuild/bazel-central-registry#8863).
# Upstream BCR doesn't have 0.65 yet, so point at oharboe's fork branch
# as an additional registry; combined with single_version_override(yosys,
# "0.65") in MODULE.bazel this resolves yosys to 0.65 with the
# WRAPCELL/RTLIL-identifier corruption fix that was missing in 0.63.
common --registry=https://raw.githubusercontent.com/oharboe/bazel-central-registry/yosys-0.65/
common --registry=https://bcr.bazel.build/
Comment on lines +17 to +18
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Using a raw GitHub URL from a personal fork as a Bazel registry is insecure and fragile. It bypasses the official BCR's trust model and makes the build dependent on the availability and state of a specific branch in a third-party repository. For testing a pending BCR update, a more robust and secure approach is to use git_override or archive_override (with an integrity hash) for the yosys module in MODULE.bazel. This keeps the override localized to the project and avoids the need for global registry modifications.


try-import %workspace%/user.bazelrc
34 changes: 26 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ bazel_dep(name = "rules_shell", version = "0.6.1")
# dev_dependency = True makes those declarations no-ops in that case, so
# our MODULE.bazel doesn't need to be patched at non-root consumption
# time.
#
# Exception: bazel_dep(name = "bazel-orfs") is intentionally NOT dev-only,
# because flow/BUILD has `load("@bazel-orfs//:openroad.bzl", "orfs_pdk")`
# and load-visibility requires the bazel_dep to be honoured at non-root
# consumption time too. The companion git_override below is silently
# ignored by Bazel when @orfs is non-root, so the downstream module's
# own bazel-orfs pin still wins.

bazel_dep(name = "toolchains_llvm", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "openroad", dev_dependency = True)
Expand All @@ -33,25 +40,26 @@ git_override(
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
)

bazel_dep(name = "bazel-orfs", dev_dependency = True)
bazel_dep(name = "bazel-orfs")

bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)

BAZEL_ORFS_COMMIT = "ce6efd96dfe39a9c4ef244f8712386f071545d77"
BAZEL_ORFS_COMMIT = "3a5ddd7eb48c363717e65903ae4573d528327fd3"

BAZEL_ORFS_REMOTE = "https://github.com/The-OpenROAD-Project/bazel-orfs.git"

# To bump version, run: bazelisk run @bazel-orfs//:bump
#
# `patches =` keeps small bazel-orfs fixes vendored in this repo
# while we iterate, instead of round-tripping every change through a
# bazel-orfs PR + pin bump. When a patch lands upstream, drop the
# entry here and bump BAZEL_ORFS_COMMIT.
git_override(
module_name = "bazel-orfs",
commit = BAZEL_ORFS_COMMIT,
patch_strip = 1,
patches = [
# Adds orfs_design(user_sources=[VAR,...]) / orfs_flow(user_sources={...})
# so design-private SOURCE_VARS path hooks (e.g. SDC_FILE_EXTRA in
# flow/designs/asap7/mock-cpu) bypass the variables.yaml validator
# without polluting the ORFS-wide variable schema. Drop once upstream
# bazel-orfs lands the user_sources= API.
"//bazel:0001-orfs_design-add-user_sources.patch",
"//patches/bazel-orfs:0001-render_gds-monkey-patch-PDK_CONFIGS-not-gdsii_use_custom_config.patch",
],
remote = BAZEL_ORFS_REMOTE,
)
Expand All @@ -63,6 +71,16 @@ git_override(
strip_prefix = "verilog",
)

# Force yosys to 0.65 (from BCR PR #8863, picked up via the custom
# registry in .bazelrc). 0.65 fixes the WRAPCELL/RTLIL-identifier
# memory corruption that produces garbage like `\<garbage>_KOGGE_STONE`
# strings in cva6 / ibex synthesis on 0.63. bazel-orfs pins yosys=0.63
# in its MODULE.bazel; this root override wins.
single_version_override(
module_name = "yosys",
version = "0.65",
)

# yosys-slang is not on BCR. Pin to a commit on povik/yosys-slang master
# that has the upstream Bazel build (povik/yosys-slang#310) and the
# slang.so visibility fix (povik/yosys-slang#311). Submodules pull in
Expand Down
153 changes: 0 additions & 153 deletions bazel/0001-orfs_design-add-user_sources.patch

This file was deleted.

88 changes: 88 additions & 0 deletions flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,91 @@ the generated targets get `tags = ["manual"]`.
Each OpenROAD invocation takes `-threads <nproc>`. 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 `<design>_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).** `rules-base.json` carries three SHA-1
fingerprints of yosys' internal state at warning level so a
bazel-yosys vs make-yosys drift surfaces in `checkMetadata.py`
as three buckets:

[WARN] synth__canonical_netlist__hash differs test: <bazel> == <make> # front-end + opt_clean
[WARN] synth__preabc_netlist__hash differs test: <bazel> == <make> # mid-level synth, immediately pre-ABC
[WARN] synth__netlist__hash differs test: <bazel> == <make> # post-ABC `1_2_yosys.v`

The bucket(s) that DIFFER bisect where drift entered: front-end
already differing means iteration-order non-determinism is firing
in `read_design_sources`/`hierarchy`/`opt_clean`; pre-ABC matching
but post-ABC diverging means the bazel-pinned vs make-pulled ABC
are different revisions. A QoR threshold breaking together with
any of these is almost always yosys-env drift. Confirm with the per-stage `.odb` SHA
matrix from `@bazel-orfs//:make-yosys-netlist` (feeds make's
netlist into bazel) or its reverse-direction sibling
`@bazel-orfs//:yosys-check` (bazel's netlist into make):

```bash
bazelisk run @bazel-orfs//:make-yosys-netlist \
//flow/designs/asap7/<design>:<design>_test
```

All stages MATCH → yosys-only drift, relax the threshold; any
DIFFER → real bazel-vs-make OpenROAD divergence, file the matrix
as an issue. Full workflow lives 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 <stage>_issue DESIGN_CONFIG=designs/<plat>/<design>/config.mk \
ISSUE_TAG=<plat>-<design>-<short>
```

`flow/util/utils.mk` auto-generates `<script>_issue` targets for
every script in `flow/scripts/` (`floorplan_issue`,
`global_route_issue`, `detail_route_issue`, `final_issue`, …).
6 changes: 3 additions & 3 deletions flow/designs/asap7/aes-block/rules-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"compare": "<="
},
"cts__timing__setup__ws": {
"value": -113.0,
"value": -118.3,
"compare": ">="
},
"cts__timing__setup__tns": {
"value": -7390.0,
"value": -7549.7,
"compare": ">="
},
"cts__timing__hold__ws": {
Expand Down Expand Up @@ -99,4 +99,4 @@
"value": 7205,
"compare": "<="
}
}
}
10 changes: 5 additions & 5 deletions flow/designs/asap7/ethmac_lvt/rules-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"compare": "<="
},
"cts__timing__setup__ws": {
"value": -21.7,
"value": -22.7,
"compare": ">="
},
"cts__timing__setup__tns": {
"value": -113.0,
"value": -310.4,
"compare": ">="
},
"cts__timing__hold__ws": {
Expand All @@ -52,7 +52,7 @@
"compare": ">="
},
"globalroute__timing__setup__tns": {
"value": -263.0,
"value": -344.0,
"compare": ">="
},
"globalroute__timing__hold__ws": {
Expand Down Expand Up @@ -84,7 +84,7 @@
"compare": ">="
},
"finish__timing__setup__tns": {
"value": -94.2,
"value": -199.8,
"compare": ">="
},
"finish__timing__hold__ws": {
Expand All @@ -99,4 +99,4 @@
"value": 8537,
"compare": "<="
}
}
}
Loading