[RFQ] build: add bazel-orfs beta test for design builds#4094
Draft
oharboe wants to merge 9 commits intoThe-OpenROAD-Project:masterfrom
Draft
[RFQ] build: add bazel-orfs beta test for design builds#4094oharboe wants to merge 9 commits intoThe-OpenROAD-Project:masterfrom
oharboe wants to merge 9 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Collaborator
Author
|
@jhkim-pii Would you take it for a spin and comment? |
Collaborator
Author
|
@hzeller Thoughts? |
e0b222d to
42d151d
Compare
Contributor
|
ORFS bazel works. |
Collaborator
Author
Not without making the use-case worse, you'd have to write something like I think on the balance we're better off with having these copy and paste BUILD files. Over time, they will grow extra features I believe so they won't just be copy and paste. Yes they pollute a bit, but the cognitive load should be small otherwise... 🤞 |
9922302 to
5e676e5
Compare
Collaborator
Author
|
@MrAMS Thoughts? |
When SYNTH_HIERARCHICAL=1, the yosys stat command reports zero area for the top module because all cells are in submodules. Adding -hierarchy makes stat include submodule area, so synth__design__instance__area__stdcell is no longer N/A. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Updates rules-base.json for: asap7/aes-block, asap7/riscv32i, asap7/mock-alu, gf180/aes-hybrid, gf180/uart-blocks, nangate45/tinyRocket, nangate45/ariane133, nangate45/ariane136, nangate45/bp_be_top, nangate45/bp_fe_top, nangate45/swerv_wrapper, sky130hd/microwatt.
- Bump bazel-orfs to d998bbff78c4557 - Add bazel-orfs-verilog transitive dependency - Update rules_python to 1.8.5, remove compatibility_level - Bump ORFS Docker image to 26Q1-816-gf40d2f346 - Add variables_yaml to orfs.default() - Add orfs_designs() repo rule for all 6 public-PDK platforms - Add commented-out OpenROAD-from-source instructions
Add orfs_design() targets and exports_files() to all design directories across asap7, gf180, ihp-sg13g2, nangate45, sky130hd, and sky130hs platforms, plus their source directories.
Add bazel-orfs.md with quick start guide, available targets, build results for 59 designs across 6 platforms, and status of blocked designs.
Add transitive dependency overrides required by the new bazel-orfs: openroad, qt-bazel, mock-klayout, glpk, and toolchains_llvm. The new bazel-orfs builds OpenROAD from source by default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
5e676e5 to
9e801c4
Compare
Use local_path_override to point the openroad module at the tools/OpenROAD submodule rather than fetching from GitHub. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The rules_python bootstrap wrapper sets RUNFILES_DIR to its own runfiles tree. When run_command.py spawned OpenROAD, it inherited that variable and looked for Tcl init files in the Python runfiles instead of its own, causing "application-specific initialization failed" in Bazel builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bazel-orfs Beta Test
This is an early integration of bazel-orfs
into OpenROAD-flow-scripts. It lets you build ORFS designs with Bazel
using the same
config.mkfiles you already have.Status: beta -- 46 designs across 6 public PDK platforms build and
pass QoR tests. Platforms without public PDK files (gf12, gf55,
rapidus2hp) are not wired up.
Quick Start
Available Targets Per Design
Each enabled design gets these targets automatically from its
config.mk:_synth_floorplan_place_cts_grt_route_final_generate_abstract_generate_metadata_testEach stage depends on the previous one, so building
_finalruns theentire flow.
Working Designs (46 passing tests)
All designs below have
orfs_design()enabled and passbazelisk testwith QoR regression checks.asap7 (16 designs)
gcdgcd-ccsaesaes-blockaes-mbffaes_lvtethmacethmac_lvtibexjpegjpeg_lvtuartriscv32imock-cpuswerv_wrappercva6sky130hd (7 designs)
gcdaesibexjpegriscv32ichameleonmicrowattnangate45 (7 designs)
gcdaesibexjpegdynamic_nodeswervtinyRocketgf180 (5 designs)
aesaes-hybridibexjpegriscv32iihp-sg13g2 (6 designs)
gcdaesibexjpegriscv32ispisky130hs (5 designs)
gcdaesibexjpegriscv32iDesigns Blocked on bazel-orfs Changes
These designs have BUILD.bazel with a commented-out
orfs_design()and a
TODO(bazel-orfs)note. They need changes in bazel-orfs beforethey can be enabled.
Hierarchical sub-design targets (riscv32i-mock-sram)
asap7/riscv32i-mock-sramusesinclude designs/asap7/riscv32i/config.mkin its config.mk and has a
fakeram7_256x32/sub-design directory.The
orfs_designsrule generates spuriousriscv_top_*targets inthe sub-design package from the parent config. This causes a build
failure because the sub-design lacks the parent's
rules-base.json.Fix:
orfs_designsshould only generate targets from config.mkfiles that are directly in the scanned directory, not from included
configs resolved at Make-time.
Specific file references in VERILOG_FILES
Several designs list individual files in
VERILOG_FILESfrom directoriesother than the design's own
src/tree (e.g.$(DESIGN_HOME)/src/ariane133/ariane.sv2v.vor
$(DESIGN_HOME)/src/$(DESIGN_NAME)/pickled.v). Theorfs_designsrule resolves
$(wildcard ...)patterns but does not handle explicitfile paths that use
$(DESIGN_NAME)or$(DESIGN_NICKNAME).Affected: nangate45: ariane133, ariane136, black_parrot, bp_be_top,
bp_fe_top, bp_multi_top, bp_quad, mempool_group, swerv_wrapper.
Fix: Extend the
orfs_designsconfig.mk parser to resolve$(DESIGN_NAME)and$(DESIGN_NICKNAME)variable references inexplicit file paths, not just in
$(wildcard ...)patterns.VERILOG_FILES from non-matching src directory
gf180/uart-blocksreferencessrc/uart-no-param/*.v-- a differentsrc directory than its own name.
Fix: The parser already handles
$(DESIGN_NICKNAME)in wildcardpatterns; verify it also resolves when the source directory name
differs from the design directory name.
Platform-local verilog in VERILOG_FILES
ihp-sg13g2/i2c-gpio-expanderadds$(PLATFORM_DIR)/verilog/sg13g2_io.vto VERILOG_FILES and also references verilog from its own platform
design directory (
$(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/*.v).Fix: Support
$(PLATFORM_DIR)/...file references in VERILOG_FILESby resolving them against the PDK target.
Generated verilog (mock-alu)
asap7/mock-alugenerates its verilog viasrc/mock-alu/generate_*.pyscripts. Needs a Bazel
genruleto run the Python generator beforesynthesis.
No VERILOG_FILES (minimal)
asap7/minimalis a test design with noVERILOG_FILESin config.mk(empty SDC). Not expected to work with
orfs_designs.Platforms without public PDK
gf12, gf55, and rapidus2hp have design directories but no platform
files in the open-source repo. These are skipped entirely.
How to Add More Designs
flow/designs/<platform>/<design>/BUILD.bazel:flow/designs/src/<name>/BUILD.bazeldoesn't exist, create it:bazelisk query //flow/designs/<platform>/<design>:allto verify.Using a Local bazel-orfs Checkout
To iterate on bazel-orfs rules locally, replace the
git_overrideinMODULE.bazel:Also update the
bazel-orfs-verilogoverride:Key Differences from Make
PLACE_DENSITYin
config.mkrebuilds only floorplan onward -- synthesis is cached.No
make installorPATHsetup needed.Performance Notes
Each OpenROAD invocation uses
-threads <nproc>(all available cores).When Bazel runs many designs in parallel, the machine becomes heavily
overcommitted. On a 48-core machine, 50+ OpenROAD instances may run
simultaneously during a full
bazelisk test ..., each requesting 48threads.
To limit parallelism:
A full test suite run (46 designs, 6 platforms) takes roughly 3-4 hours
on a 48-core machine with default parallelism (overcommitted). Individual
design times vary from ~1 minute (gcd) to ~63 minutes (cva6 on asap7).
Updating Metric Thresholds
When OpenROAD or flow scripts change, metric thresholds in
rules-base.jsonmay go stale. To update them for a specific design:# Rebuilds the design and writes updated thresholds back to source bazelisk run //flow/designs/asap7/aes-block:aes_cipher_top_updateThe target name follows the pattern
<design_name>_updatewhere<design_name>comes fromDESIGN_NAMEinconfig.mk.Equivalence Checking (eqy)
Some designs (e.g.
aes) setEQUIVALENCE_CHECK=1in theirconfig.mkto enable equivalence checking of repair_timing. Theactual
eqytool invocation is gated by a separateRUN_EQYvariable (default 0), so builds don't fail when eqy is not installed.
CI sets
RUN_EQY=1when eqy is available.Workflow: Unmerged Commits
This PR serves as a working branch against master. Commits here are
spun off as separate, focused PRs for review. Once a PR merges, this
branch is rebased on master to drop the merged commit. The branch is
force-pushed after each rebase so the PR commit list is always the
source of truth for what's pending.
Filing of PRs is throttled to avoid overwhelming maintainers --
submitting too many at once just causes "maintainer packet dropping"
where reviews stall.
Known Limitations
MODULE.bazel.supported.
riscv32i-mock-sramhierarchical flow does not work yet.https://github.com/The-OpenROAD-Project/bazel-orfs/issues