[RFQ] build: add bazel-orfs beta test for design builds#4094
Draft
oharboe wants to merge 20 commits intoThe-OpenROAD-Project:masterfrom
Draft
[RFQ] build: add bazel-orfs beta test for design builds#4094oharboe wants to merge 20 commits intoThe-OpenROAD-Project:masterfrom
oharboe wants to merge 20 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Add BUILD.bazel files for all asap7 and sky130hd designs using the orfs_design() macro from bazel-orfs, which auto-generates flow targets from existing config.mk files. Designs that don't yet work have the orfs_design() call commented out with a note explaining what's missing (typically a source BUILD.bazel with :verilog filegroup). Working designs: gcd, gcd-ccs, aes, aes-block, aes-mbff, aes_lvt, ethmac, ethmac_lvt (asap7); gcd, aes (sky130hd). Includes bazel-orfs.md guide for beta testers. The full 51-design patch set remains out-of-tree in bazel-orfs/orfs/ to minimize churn. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Collaborator
Author
|
@jhkim-pii Would you take it for a spin and comment? |
Collaborator
Author
|
@hzeller Thoughts? |
EQUIVALENCE_CHECK now only controls writing equivalence check files. The new RUN_EQY variable (default 0) gates actually executing the eqy tool, so builds don't fail when eqy is not installed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Cherry-pick from PRs The-OpenROAD-Project#4097 and The-OpenROAD-Project#4098. Removes unused compatibility_level from module() and updates rules_python version to match resolved dependency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Update rules-base.json via bazelisk run aes_cipher_top_update. Hierarchical synth produces no synth area metric and has no clock at block level, so timing thresholds are all 0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
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>
Update rules-base.json via bazelisk run aes_cipher_top_update. Restore synth__design__instance__area__stdcell check now that stat -hierarchy is used. Hierarchical block has no clock, so timing thresholds are all 0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The plot_congestion Bazel target and .bzl file are unused and cause a stale reference to @orfs-pip requirements. Cherry-pick of PR The-OpenROAD-Project#4096. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Use SDC_FILE_EXTRA variable instead of hardcoded paths to source mock-array/util.tcl. This works correctly in both Make and Bazel. Cherry-pick of PR The-OpenROAD-Project#4093. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The platform default BLOCKS_grid_strategy.tcl produces empty PDN grids. Use BLOCK_grid_strategy.tcl which has M4-M5 connections matching the block's MAX_ROUTING_LAYER=M4 constraint. Cherry-pick of PR The-OpenROAD-Project#4091. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Explicitly declare IO pad verilog, LEF, lib (all corners), and GDS files for robustness, rather than relying on platform config.mk conditional logic. Cherry-pick of PR The-OpenROAD-Project#4090. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Update rules-base.json via bazelisk run aes_cipher_top_update. Remove synth__design__instance__area__stdcell (not produced for hierarchical synth in cached build). Hierarchical block has no clock, so timing thresholds are all 0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Add documentation for updating metric thresholds via _update targets and the EQUIVALENCE_CHECK/RUN_EQY separation. Update status to reflect all 8 asap7 designs passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Explain that commits are spun off as separate PRs and this branch is rebased as they merge. 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>
e0b222d to
42d151d
Compare
Enable nangate45, gf180, ihp-sg13g2, and sky130hs platforms in MODULE.bazel and flow/BUILD.bazel. Create BUILD.bazel files for all design source directories and platform design directories. Unblock previously blocked asap7/sky130hd designs that only needed src/ BUILD.bazel files. Smoke-tested: gcd_test passes on all 4 new platforms. Skipped platforms without public PDK: gf12, gf55, rapidus2hp. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
|
ORFS bazel works. |
- Add exports_files(glob(["platforms/**"])) to flow/BUILD.bazel for ADDITIONAL_LEFS/LIBS from PLATFORM_DIR - Add :verilog filegroups to chameleon, cva6, microwatt subdirs - Add :include filegroups for VERILOG_INCLUDE_DIRS targets - Add :lef/:lib/:gds filegroups for design-local macro files - Add .cfg and .sv extensions to platform PDK globs - Add BUILD.bazel for riscv32i-mock-sram/fakeram7_256x32 sub-design - Add BUILD.bazel for src/mock-array (needed by mock-cpu) All 701 targets pass analysis, builds are running. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
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... 🤞 |
- Use specific file extensions in lef/lib/gds BUILD files to prevent BUILD.bazel from being picked up as a liberty/gds file - Remove common_cells/include/common_cells package boundary so parent include filegroup can glob recursively into subdirectories - Add allow_empty to gds globs (only .gds.gz files exist) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Update rules-base.json to match current flow output: - Remove synth__design__instance__area__stdcell (N/A with SYNTH_HIERARCHICAL=1) - Update constraints__clocks__count to 0 (hierarchical flow) - Update area, timing, and wirelength thresholds Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
…ket, sky130hd/microwatt Update rules-base.json to match current flow output for newly enabled bazel-orfs designs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
…orms - Replace old 10-design list with full 46-design table across asap7, sky130hd, nangate45, gf180, ihp-sg13g2, sky130hs - Document blocked designs with specific bazel-orfs fixes needed: hierarchical sub-design targets, specific file references, platform-local verilog, generated verilog - Add performance notes on thread overcommitment and --jobs flag - Update known limitations 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