Repository navigation
synth: single writer for 1_synth.sdc + single-process flow test that enforces it #4333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maliberty
merged 19 commits into
The-OpenROAD-Project:master
from
oharboe:synth-single-writer-1synth-sdc
Jul 13, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
58fab1c
synth: single writer for 1_synth.sdc
oharboe 840af79
Merge remote-tracking branch 'origin/master' into synth-single-writer…
oharboe 6da7ca5
bazel: mirror tools/OpenROAD's rules_pycross Python 3.8 workaround
oharboe 1268384
flow: gate every stage .odb/.sdc file product on WRITE_ODB_AND_SDC_EA…
oharboe 506260d
synth: keep the 1_synth.odb/.sdc writes behind WRITE_ODB_AND_SDC_EACH…
oharboe f75083e
flow: single-process flow.tcl + gcd equivalence test with no-write as…
oharboe 640e205
flow: fix the grt-stage single-process divergence via an OpenSTA patch
oharboe 87b6286
flow: fix the route-stage single-process divergence via a drt patch
oharboe a9deded
flow: route stage byte-identical; the residue was stale bterm access …
oharboe 4567701
flow: split final_report.tcl around the 6_final.odb write
oharboe abb514c
flow: file join for single-process flow output paths
oharboe 7780f82
flow: don't exit the process on SKIP_DETAILED_ROUTE
oharboe 898c39f
drt: strict weak ordering for the canonical via sort
oharboe 0b58bdc
bazel: patch sed's gnulib memchr for glibc >= 2.42
oharboe 93b9992
deps: bump OpenROAD to master; adopt the hermetic-llvm toolchain
oharboe f3fcd90
flow: update rules-base.json for QoR shift from the OpenROAD bump
oharboe 63e365c
update OR
maliberty ffdf48c
Merge remote-tracking branch 'origin' into synth-single-writer-1synth…
maliberty adaa6a9
bazel: drop OpenROAD pinning, keep local_path_override
oharboe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Placeholder directory for the @slang alias build file to internally | ||
| manifest. tools/OpenROAD's MODULE.bazel declares | ||
| new_local_repository(name="slang", path="bazel/slang-compat"); the | ||
| relative path resolves against the root workspace, so when ORFS is the | ||
| root module consuming openroad via git_override the directory must | ||
| exist here too. Mirrors tools/OpenROAD/bazel/slang-compat. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,168 @@ | ||
| load("@bazel-orfs//:openroad.bzl", "orfs_run") | ||
| load("@orfs_designs//:designs.bzl", "DESIGNS") | ||
| load("@rules_shell//shell:sh_test.bzl", "sh_test") | ||
| load("//flow/designs:design.bzl", "design") | ||
|
|
||
| design(config = "config.mk") | ||
| # SYNTH_USE_SYN is make-only for now: bazel-orfs's synth stage always | ||
| # runs the yosys flow and neither stages the Verilog sources nor sets | ||
| # VERILOG_FILES for the OpenROAD synthesis step, so the built-in | ||
| # synthesizer opt-in must not reach the bazel arguments. | ||
| design( | ||
| config = "config.mk", | ||
| local_arguments = ["SYNTH_USE_SYN"], | ||
| ) | ||
|
|
||
| # Stage-boundary .odb/.sdc stems shared by the normal per-stage flow | ||
| # targets and the single-process flow below; the gcd_single_flow_test | ||
| # suite compares each of these files pairwise between the two flows. | ||
| SINGLE_FLOW_STAGES = { | ||
| "synth": "1_synth", | ||
| "floorplan": "2_floorplan", | ||
| "place": "3_place", | ||
| "cts": "4_cts", | ||
| "grt": "5_1_grt", | ||
| "route": "5_route", | ||
| "final": "6_final", | ||
| } | ||
|
|
||
| # Substep files the single-process flow also writes, declared so the | ||
| # action keeps them and a human can inspect them on failure. | ||
| SINGLE_FLOW_EXTRA_OUTS = [ | ||
| "2_1_floorplan.odb", | ||
| "2_1_floorplan.sdc", | ||
| "2_2_floorplan_macro.odb", | ||
| "2_3_floorplan_tapcell.odb", | ||
| "2_4_floorplan_pdn.odb", | ||
| "3_1_place_gp_skip_io.odb", | ||
| "3_2_place_iop.odb", | ||
| "3_3_place_gp.odb", | ||
| "3_4_place_resized.odb", | ||
| "3_5_place_dp.odb", | ||
| "4_1_cts.odb", | ||
| "5_2_route.odb", | ||
| "5_3_fillcell.odb", | ||
| "6_1_fill.odb", | ||
| "6_1_fill.sdc", | ||
| ] | ||
|
|
||
| # The whole flow, yosys netlist through finish, as one Tcl script in a | ||
| # single OpenROAD process (scripts/flow.tcl) with | ||
| # WRITE_ODB_AND_SDC_EACH_STAGE=0: the stage scripts write no .odb/.sdc | ||
| # files (flow.tcl errors if one does), the top level writes every file | ||
| # the per-stage flow produces via explicit write_db/write_sdc. The | ||
| # synth stage config only carries synth-scoped variables, so the | ||
| # design's full argument set rides along; FLOW_VARIANT=single keeps the | ||
| # output paths clear of the regular stage targets' declared outputs in | ||
| # this package. | ||
| orfs_run( | ||
| name = "gcd_single_flow", | ||
| src = ":gcd_synth", | ||
| outs = [ | ||
| "results/asap7/gcd/single/{}.{}".format(stem, ext) | ||
| for stem in SINGLE_FLOW_STAGES.values() | ||
| for ext in [ | ||
| "odb", | ||
| "sdc", | ||
| ] | ||
| ] + [ | ||
| "results/asap7/gcd/single/" + name | ||
| for name in SINGLE_FLOW_EXTRA_OUTS | ||
| ], | ||
| arguments = { | ||
| k: v | ||
| for k, v in DESIGNS["asap7/gcd"]["arguments"].items() | ||
| if k != "SYNTH_USE_SYN" | ||
| } | { | ||
| "FLOW_VARIANT": "single", | ||
| }, | ||
| script = ":single_flow.tcl", | ||
| variant = "single", | ||
| ) | ||
|
|
||
| # Normal-flow stage outputs, one filegroup per compared file. | ||
| [ | ||
| filegroup( | ||
| name = "gcd_base_{}_{}".format(stage, ext), | ||
| srcs = [":gcd_" + stage], | ||
| output_group = "{}.{}".format(stem, ext), | ||
| ) | ||
| for stage, stem in SINGLE_FLOW_STAGES.items() | ||
| for ext in [ | ||
| "odb", | ||
| "sdc", | ||
| ] | ||
| ] | ||
|
|
||
| # Byte-compare each stage boundary's .odb/.sdc between the per-stage | ||
| # flow and the single-process flow: equal files prove the | ||
| # single-process mode is equivalent to the per-stage flow, not merely | ||
| # that it runs to completion. check_same.sh takes file pairs: | ||
| # file_a file_b ... (.sdc pair first: check_same.sh stops at a binary | ||
| # diff, and the .sdc verdict should be reported before that). | ||
| # | ||
| # The synth through grt boundaries are byte-identical. The grt stage | ||
| # used to diverge (an extra repair_timing buffer): STA endpoint state | ||
| # for CTS dummy-load pins differed between a process that inserted them | ||
| # and a process that read the same design from disk, and | ||
| # resistance-aware global routing consumed the resulting bogus net | ||
| # slacks — fixed by patches/openroad/0001-sta-register-new-instance- | ||
| # pin-vertices-as-endpoints.patch. | ||
| # | ||
| # The route stage used to route differently in-process (net/instance | ||
| # iteration order and via emission order in drt reflected the process | ||
| # history) — fixed by patches/openroad/0002-drt-make-incremental- | ||
| # design-updates-match-a-fresh-read.patch; the routed layout is now | ||
| # identical (equal DEF). | ||
| # | ||
| # The route .odb byte difference was NOT an odb id/freelist issue | ||
| # (free lists serialize and reload): the per-stage flow accumulated | ||
| # stale block-terminal access points on every pin access rerun — fixed | ||
| # by patches/openroad/0003-drt-do-not-duplicate-bterm-access-points. | ||
| # patch; route is byte-identical now. | ||
| # | ||
| # The final stage used to diverge because the per-stage flow writes | ||
| # 6_final.odb mid-final_report (before the RCX extraction reorders | ||
| # every dbWire via odb orderWires) while this flow wrote at end of | ||
| # script — resolved by splitting final_report.tcl around its write so | ||
| # flow.tcl writes at the same point. All seven stage boundaries are | ||
| # byte-identical between the two flows. | ||
| [ | ||
| sh_test( | ||
| name = "gcd_single_flow_{}_test".format(stage), | ||
| srcs = ["@openroad//test/orfs:check_same.sh"], | ||
| args = [ | ||
| arg | ||
| for ext in [ | ||
| "sdc", | ||
| "odb", | ||
| ] | ||
| for arg in [ | ||
| "$(location :gcd_base_{}_{})".format(stage, ext), | ||
| "$(location :results/asap7/gcd/single/{}.{})".format(stem, ext), | ||
| ] | ||
| ], | ||
| data = [ | ||
| ":gcd_base_{}_{}".format(stage, ext) | ||
| for ext in [ | ||
| "sdc", | ||
| "odb", | ||
| ] | ||
| ] + [ | ||
| ":results/asap7/gcd/single/{}.{}".format(stem, ext) | ||
| for ext in [ | ||
| "sdc", | ||
| "odb", | ||
| ] | ||
| ], | ||
| tags = ["orfs"], | ||
| ) | ||
| for stage, stem in SINGLE_FLOW_STAGES.items() | ||
| ] | ||
|
|
||
| test_suite( | ||
| name = "gcd_single_flow_test", | ||
| tests = [ | ||
| ":gcd_single_flow_{}_test".format(stage) | ||
| for stage in SINGLE_FLOW_STAGES | ||
| ], | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Seed this variant's results dir with the yosys synthesis outputs, | ||
| # then run the whole flow in this single OpenROAD process. Under | ||
| # bazel-orfs the synthesis results are staged in the src stage's | ||
| # variant folder and its odb is exposed via ODB_FILE, while RESULTS_DIR | ||
| # points at this run's own variant folder. | ||
| file mkdir $::env(RESULTS_DIR) | ||
| set src_results [file dirname $::env(ODB_FILE)] | ||
| file copy -force $src_results/1_2_yosys.v $::env(RESULTS_DIR)/1_2_yosys.v | ||
| file copy -force $src_results/1_2_yosys.sdc $::env(RESULTS_DIR)/1_2_yosys.sdc | ||
|
|
||
| source $::env(SCRIPTS_DIR)/flow.tcl |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these changes related to the stated topic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's where the whole thing started. I found we were missing tests for this stuff, then I added tests, then I found more yaks to shave.
Would you prefer this split into one PR per concern or just do a big review?