镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

bazel: retire bazel-orfs and test/orfs - #11546

Merged
maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:retire-bazel-orfs
Sep 28, 2026
Merged

maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:retire-bazel-orfs

Conversation

@oharboe

@oharboe oharboe commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Removes bazel-orfs, bazel-orfs-verilog and orfs (plus yosys, yosys-slang, rules_verilator and verilator, which only existed for them) from MODULE.bazel, and deletes test/orfs/ (gcd and mock-array), along with the two verilator dev-dep checks in test/BUILD.

Side effect on version selection: rules_bison/rules_flex 0.3.1 and rules_m4 0.2.x do not load under Bazel 9 (CcInfo removed, missing //bin:m4). yosys had been masking this by raising them through MVS. This PR declares the versions master actually resolved: rules_bison/rules_flex 0.4 and rules_m4 0.3. libffi resolves to 3.4.7.bcr.3 instead of bcr.4.

Testing strategy
From now on, OpenROAD relies on fast, single-concern tests for its promises, not on flow-level integration tests. Each test asserts one intended behavior on small inputs and runs in seconds. Writing such tests used to be the expensive part; with AI-assisted development it is now cheap, so we write them when we need them rather than keep a heavyweight integration suite that approximates them. Full-flow integration testing stays in ORFS, where the flow lives. OpenROAD CI stays fast and lightweight.

What prompted this
Regenerating rules-base.json used to be a local-only flow: bazelisk run //test/orfs/gcd:gcd_update, then commit the file. That is no longer possible.

  • ORFS [Docs] Fix OR messages glossary #4552 (76be2a8eb, merged 2026-09-23) removed the rules files, checkMetadata.py, genRuleFile.py and RULES_JSON. It replaced them with make metadata-check, which posts metadata.json to the QoR dashboard server and compares it with the dashboard's latest master build.
  • That check needs the network during the test, gives a different answer as the dashboard moves, and cannot compare a change with its merge base. bazel-orfs therefore dropped its rules-file test and update targets instead of adopting it (bazel-orfs 9347dbeb).
  • At our current pin, gcd_update already fails locally (cp: target '.../rules-base.json': Not a directory). bazel-orfs fixed that in bad2c699, after our pin 551d4c72, and picking up the fix means bumping into the ORFS change above.

Keeping test/orfs would mean either staying pinned to a stale ORFS/bazel-orfs indefinitely, or taking a server-dependent QoR gate into OpenROAD CI. The first leaves test/orfs going stale. The second adds more CI brittleness to an already fragile multi-repo chain. Neither is worth it.

About mock-array
mock-array has traditionally been a highly valuable regression test. Its regular N×N array of identical, abutted macros built from a hierarchical block is simple RTL, but it hits corners that production SoCs hit. It exposed:

It is, however, a poor fit for the ORFS Makefile flow. It needs bazel-orfs for:

  • a separate synthesis run per module, with netlists stitched together
  • a block → abstract → parent dependency
  • parameterized 4x4 and 8x8 variants
  • post-flow orfs_run checks

That is why it lived in OpenROAD, and why OpenROAD had to carry bazel-orfs.

If we find we need mock-array coverage again, we will resurrect mock-array in bazel-orfs, which already builds OpenROAD from source and owns the flow interface. We will then have AI generate specific single-concern OpenROAD test cases for whatever it catches.

What we get immediately

  • No more bazel-orfs/ORFS bumps in OpenROAD. There were 14 since 2025-09, and about 200 commits touched test/orfs/, many of them just regenerating rules-*.json after yosys and STA bumps.
  • No OpenROAD PR is needed when the ORFS interface changes, so Bazel-breaking-changes.md goes.
  • A smaller dependency graph: no git fetch of bazel-orfs during module resolution, and no yosys, slang or verilator.
  • bazelisk test ... gets faster; the mock-array 8x8 flow was the slowest target.
  • No dependency on the network-backed QoR dashboard check that ORFS [Docs] Fix OR messages glossary #4552 introduced.

Lost coverage: the risk we accept
Flow-level breakage in general is still caught by ORFS's daily OpenROAD-bump PR (github-actions-cron-update-OR.yml), within a day but after merge. The following is exercised by test/orfs and by nothing else in OpenROAD tests or public ORFS CI. It is lost until mined back.

Integration level

Lost Was exercised by
Pre-merge full-flow smoke test inside bazelisk test ... gcd, mock-array
End-to-end hierarchical macro-array flow: hierarchical block P&R → abstract → N×N abutted array → P&R → post-P&R STA handoff. No ORFS design has this shape MockArray_{4x4,8x8}_base_test
The same macro-array netlist in both hierarchical (OPENROAD_HIERARCHICAL=1) and flat mode MockArray_*_{base,flat}_test
CTS and hold repair through narrow channels into an array of macro clock pins, inside a real flow (cts/test/array* covers CTS alone) MockArray flow

Specific concerns

Lost Was exercised by
Determinism: identical runs give byte-identical .odb/.sdc at floorplan, place, cts, grt, route, final gcd_idempotent_test_* (check_same.*)
whittle.py end-to-end with the real openroad (etc/test_whittle.py only uses mocks) gcd_whittle_test
OpenROAD-written hierarchical Verilog + SPEF + SDC reload in a fresh OpenSTA session, read_spef -path per instance, no unexpected warnings (#8297, #8551). The existing tolerance of pin * not found (io_lsbOuts_0) needs a look MockArray_*_path_groups_test, load_mock_array.tcl, parasitics.tcl
find_timing_paths -from/-to and group_path -through on those reloaded outputs path_groups.tcl
place_macro with escaped hierarchical names (ces_row\[r\].ces_col\[c\].ces), exact location and orientation, grid invariants (count, one orientation, aligned rows and columns, X abutment) place_mock_array.tcl, check_macro_layout.tcl
write_macro_placement with escaped hierarchical names write_macros.tcl
-mirrored_pins spread over several layers per direction element-io.tcl
Abstract LEF of a hierarchical (OPENROAD_HIERARCHICAL=1) block used as a macro Element_*_generate_abstract
Connectivity by abutment of mirrored macro pins (zero-length nets, DRC = 0) MockArray flow
PDN over an abutted macro array with a tight channel ("PDN problems if it is smaller. Not investigated.") BLOCKS_grid_strategy.tcl, array_spacing_*

Accepted without replacement

Lost Was exercised by
QoR thresholds and netlist hashes in rules-*.json (they only record current output, and ORFS #4552 has retired rules files upstream) gcd, gcd_b, 4 MockArray variants
8x8 scale MockArray_8x8_*
DETAILED_ROUTE_END_ITERATION mock-array
gcd with OPENROAD_HIERARCHICAL=1, explicit die area, ABC_CLOCK_PERIOD_IN_PS and an env-driven SDC (ORFS/yosys features; ABC_CLOCK_PERIOD_IN_PS is only used by gf12) gcd_test
Slang frontend + SYNTH_BLACKBOXES + stitched SYNTH_NETLIST_FILES in one design (each is covered separately by ORFS asap7/uart and asap7/aes) mock-array synthesis

Everything else test/orfs touched is covered by existing OpenROAD tests or ORFS designs:

  • OpenROAD tests: ppl/test/write_pin_placement*, ppl/test/annealing*, tap/test/abutting_macros_step*, tap/test/cut_rows_halo, cts/test/array*, gpl/test at density 0.8, dbSta/test/read_vcd, OpenSTA search_timing_model_readback
  • ORFS designs: asap7/gcd, asap7/swerv_wrapper, asap7/aes-block, asap7/riscv32i-mock-sram, asap7/uart, asap7/aes, gf180/aes-hybrid

Not lost, because it never actually ran:

  • VCD power (power*.tcl) and Verilator netlist checks were skipped (needs_vcd → continue, ELEMENT_POWER_TESTS = []).
  • RTLMP was bypassed by MACRO_PLACEMENT_TCL, so the MPL fixes above are already unguarded.
  • path_groups ran under bare OpenSTA, not openroad, so reg2reg path group is missing with read_db -hier #8166 was not really covered.

Recovering coverage: mine on breakage
test/orfs stays in git history at this PR's parent commit (6e51da9). When master breaks on one of the concerns above (in the ORFS bump PR or a user report), the fix PR adds a single-concern regression test mined from that history with an AI coding assistant. If mock-array as a whole turns out to be needed, it is resurrected in bazel-orfs (see above). Suggested prompt:

Master broke on <concern / ORFS PR link>. Mine test/orfs at 6e51da991dcb
(git show 6e51da991dcb:test/orfs/...) for the matching case and write a
single-concern OpenROAD regression test: seconds to run, no yosys/ORFS,
checked-in or Tcl-generated inputs, asserts intended behavior
(check_log = False, check_passfail = True, or gtest; no new .ok/.defok
golden), registered in CMake and Bazel. Show it failing on the broken
commit and passing with the fix.

Verification

  • bazelisk build //:openroad and bazelisk test ... --keep_going pass locally (4437 pass; the 2 failures were the verilator dev-dep checks, removed in the second commit and re-verified with //test/...).
  • bazelisk mod graph has no orfs, yosys or verilator.
  • buildifier is clean.

oharboe and others added 2 commits September 28, 2026 11:11
OpenROAD CI relies on fast single-concern tests; flow-level integration
testing lives in ORFS and bazel-orfs.

Drop bazel-orfs, bazel-orfs-verilog, orfs, yosys, yosys-slang,
rules_verilator and verilator from MODULE.bazel and delete test/orfs.

rules_bison/rules_flex 0.3.1 and rules_m4 0.2.x do not load under
Bazel 9; yosys masked this by raising them via MVS. Declare the
versions that were actually resolved: rules_bison/rules_flex 0.4 and
rules_m4 0.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
rules_verilator and verilator are no longer dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested review from a team as code owners September 28, 2026 10:03
@oharboe
oharboe requested a review from maliberty September 28, 2026 10:03

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request completely removes the bazel-orfs integration, including its associated tests (such as mock-array and gcd), configurations, and documentation, from the OpenROAD repository. It cleans up the MODULE.bazel and .bazelrc files by removing dependencies like rules_verilator, verilator, and orfs, while upgrading rules_bison and rules_flex to version 0.4 and adding rules_m4. The remaining documentation is updated to guide developers on how to run ORFS flows externally. The reviewer suggested clarifying the instructions for running the whittle.py script in docs/user/Bazel.md by specifying the correct working directory and paths.

Comment thread docs/user/Bazel.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe

oharboe commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@maliberty @jhkim-pii Drinking my own cool-aid: drop heavy duty integration tests that nobody but the author will run in favour of extracted single concern working as intended tests.

@maliberty

Copy link
Copy Markdown
Member

@gadfort FYI

@maliberty
maliberty merged commit d1b185d into The-OpenROAD-Project:master Sep 28, 2026
20 checks passed
maliberty pushed a commit that referenced this pull request Oct 7, 2026
Chesterton's fence: 6977921 moved regression_rule_test's openroad
to cfg=exec so that `bazelisk test -c opt ...` built OpenROAD once,
because bazel-orfs flow tests in this repo also ran openroad as a
build tool (exec). Those tests are gone (#11546); nothing here uses
//:openroad as a tool any more.

The fence now causes the duplicate build it was put up to avoid:
cc_tests, hier_case_test's runner and the openroadpy extension that
the Python regression tests load are all cfg=target, so a mixed test
run compiled the OpenROAD libraries in both configurations. cquery of
//src/gpl/test:ar01-tcl_test + //src/odb/test:test_block-py_test:

  before: //src/gpl:gpl in 2 configurations (exec + target)
  after:  //src/gpl:gpl in 1 configuration  (target)

It also needed ba87b1b's workaround, since the sanitizer configs
only instrument the target configuration: a second openroad_sanitized
attr, a select() pair and //bazel:sanitizer_build. With the binary
under test in cfg=target, all of that goes away and the sanitizer
configs instrument the Tcl tests without a special case.

POLA: `bazelisk build :openroad` followed by `bazelisk test` now
reuses the same binary; drop the docs explaining why it did not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants