Skip to content

flow: move eliminate_dead_logic into synth_odb.tcl#4190

Open
oharboe wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
oharboe:orfs-synth-eliminate-dead-logic
Open

flow: move eliminate_dead_logic into synth_odb.tcl#4190
oharboe wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
oharboe:orfs-synth-eliminate-dead-logic

Conversation

@oharboe
Copy link
Copy Markdown
Collaborator

@oharboe oharboe commented Apr 25, 2026

Summary

  • Move eliminate_dead_logic from floorplan.tcl into synth_odb.tcl so 1_synth.odb reflects the live design.
  • Add a docstring above the remaining synthesis-looking transforms in floorplan.tcl (repair_tie_fanout, replace_arith_modules, remove_buffers, repair_timing_helper) explaining why they cannot follow: synthesis is not I/O-pin-aware, and these calls depend on initialize_floorplan having placed bterms on the die boundary and set_routing_layers having set up the layer stack used for parasitic estimation.

Why only eliminate_dead_logic

eliminate_dead_logic is a pure netlist transform — it does not read pin locations or routing layers, so the move is safe. It also matters for parallel synthesis flows (e.g., MegaBoom) where yosys only sees a slice of the design and cannot prune logic that is dead only when viewed whole; in those flows this step has historically pruned ~50% of the design.

Why the other four stay in floorplan.tcl

This was attempted in #4187 (closed). Empirical result vs. master/1387 (deterministic baseline across multiple master CI runs):

design metric master/1387 with PR #4187 (build #8) Δ
asap7/aes-block cts setup TNS −4119 ps −10309 ps 2.5× worse
asap7/jpeg_lvt grt setup TNS −26 ps −951 ps 37× worse
asap7/swerv_wrapper finish hold TNS −194 ps −9009 ps 46× worse
nangate45/ariane133 cts setup TNS −478 ps −819 ps 1.7× worse
asap7/ibex cts setup TNS −961 ps −975 ps unchanged

I/O-heavy designs regress materially when timing-aware transforms run before bterm placement and routing-layer setup; internal-logic-dominated designs are unaffected. Splitting eliminate_dead_logic (which is pure netlist) from the rest of the block (which is timing-aware) keeps the only safe move from #4187 and documents the constraint inline so the next attempt avoids the same pitfall.

Test plan

  • CI green on the public design matrix.
  • 1_synth.odb instance count for asap7/ibex drops to its post-pruning value (no surprise instance-count drop between synth and floorplan).
  • No QoR change vs. master on the public matrix (within run-to-run noise).

🤖 Generated with Claude Code

eliminate_dead_logic is a pure netlist transform: it does not need a
die area, bterm placement or routing layers. Running it in synth_odb.tcl
means 1_synth.odb already reflects the live design instead of dropping
its instance count between synth and floorplan.

This matters for parallel synthesis flows (e.g., MegaBoom) where yosys
only sees a slice of the design at a time and cannot prune logic that
is dead only when looking at the whole design. In those flows this
step has historically eliminated ~50% of the design.

Add a docstring above the remaining synthesis-looking transforms in
floorplan.tcl (repair_tie_fanout, replace_arith_modules, remove_buffers,
repair_timing_helper) explaining why they cannot follow:
initialize_floorplan and set_routing_layers above set up the bterm
boundary placement and the routing layer stack that timing-aware
optimization relies on for parasitic estimation. Moving these calls
into synth_odb.tcl was tried in PR The-OpenROAD-Project#4187 and regressed setup TNS by
1.7-46x on I/O-heavy designs (asap7/aes-block 2.5x, asap7/jpeg_lvt 37x,
asap7/swerv_wrapper 46x finish-hold-TNS, nangate45/ariane133 1.7x);
internal-logic-dominated designs like asap7/ibex were unaffected once
the tie-fanout ordering was preserved, but the I/O-heavy regressions
made the broader move untenable.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Copy link
Copy Markdown

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

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 moves the eliminate_dead_logic command from the floorplan stage to the synthesis stage to optimize parallel synthesis flows and adds documentation explaining the move. The feedback suggests wrapping the command in log_cmd to ensure its execution and duration are properly logged, maintaining consistency with other major flow commands.

Comment thread flow/scripts/synth_odb.tcl Outdated
# stay in floorplan.tcl — moving them here was tried in PR #4187 and
# regressed setup TNS by 1.7-46x on I/O-heavy designs (asap7/aes-block,
# asap7/jpeg_lvt, asap7/swerv_wrapper, nangate45/ariane133).
eliminate_dead_logic
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since eliminate_dead_logic is a significant netlist transformation that can be time-consuming (as noted in the comments, it can prune up to 50% of some designs), it should be wrapped in log_cmd. This ensures that its execution is recorded in the logs along with its duration, maintaining consistency with how other major tool commands (like link_design, read_db, etc.) are handled in the flow.

log_cmd eliminate_dead_logic

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@maliberty
Copy link
Copy Markdown
Member

I think the above conclusions are just a symptom of the issue codex pointed out in your other PR

eliminate_dead_logic can prune up to ~50% of a parallel-synth design
(e.g., MegaBoom). log_cmd echoes the command line and reports duration
when it exceeds 5 s, matching how other potentially expensive flow
commands (link_design, read_db, repair_timing, write_db, etc.) are
logged.

Reported by gemini-code-assist on PR The-OpenROAD-Project#4190.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Apr 26, 2026

I think the above conclusions are just a symptom of the issue codex pointed out in your other PR

I backed down from moving more stuff into synth_odb.tcl.

The main confusion came from a massive drop in instances from synth to floorplan, fixed here.

@oharboe oharboe requested a review from maliberty April 26, 2026 07:30
@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Apr 26, 2026

@maliberty A much less ambitious PR that minimizes surprises.

There's synthesis like work done in floorplan.tcl, like swap arith operators, leave that be for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants