Skip to content

flow: repair egregious fanout when writing 1_synth.odb - #4327

Closed
oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:synth-repair-design
Closed

oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:synth-repair-design

Conversation

@oharboe

@oharboe oharboe commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Motivation / use-case

Synth is widely used as a fast signal for RTL changes: run make synth, look at the worst paths (gui_synth, STA on 1_synth.odb), improve the RTL, repeat. Today that signal is misleading: raw yosys/ABC output leaves egregious high-fanout nets unbuffered, so synth-stage STA charges the full unbuffered fanout load as delay. The worst reported paths are then dominated by fanout artifacts the place-stage resizer later repairs for free — they carry no actionable information, and they hide the real, RTL-actionable logic-depth paths behind them.

Lessons this encodes

Written down so others don't have to re-learn them:

  • Raw yosys/ABC output is electrically unrepaired. ABC's own buffering is layout-blind and treated as throwaway by the flow; OpenROAD does all real buffering/sizing later. STA on the raw synth netlist is dominated by fanout artifacts, not logic depth.
  • The floorplan stage does not fix this. Its repair sequence (unbuffer,sizeup,swap,vt_swap) upsizes drivers but deliberately never inserts buffers — buffer-tree construction is deferred to place, where real locations exist.
  • The first buffered netlist in the stock flow is therefore place, which is too slow for RTL iteration.
  • A context-free, DRC-only repair at synth is the cheapest point to make the signal honest — exactly where synth_syn.tcl already runs its repair_design -pre_placement unconditionally before writing 1_synth.odb.

What / how

After eliminate_dead_logic, before writing 1_synth.odb:

  • set_max_fanout (SYNTH_REPAIR_DESIGN_MAX_FANOUT, default 64) so only the truly egregious nets are DRC violations — the pass touches the artifacts, not the whole design;
  • estimate_parasitics -placement (handles unplaced cells);
  • repair_design -max_wire_length 1000000 — wire splitting disabled, since unplaced cells have no meaningful wire length.

Deliberately not repair_design -pre_placement: that is a whole-design gain-based round (slow on large merged netlists) and conflicts with -placement parasitics (EST-0104). The recipe here is DRC-only and bounded.

Default on, because this is stage semantics rather than an optional extra: the synth stage owns the electrical sanity of its product, matching synth_syn.tcl. SKIP_SYNTH_REPAIR_DESIGN=1 restores the previous behavior, following the SKIP_REPAIR_TIE_FANOUT convention.

The canonicalized 1_synth.sdc is written before the repair block so the repair-scoping set_max_fanout does not leak into the flow's SDC (there is no unset_max_fanout).

What this deliberately does not do

It does not touch the floorplan.tcl conditioning block (repair_tie_fanout, replace_arith_modules, remove_buffers/repair_timing_helper). Per PR #4187 those transforms depend on floorplan context (bterm placement from initialize_floorplan, layer stack from set_routing_layers) and regressed setup TNS 1.7–46x when moved to synth. This block is additive and context-free (no die/bterm/layer dependence), like eliminate_dead_logic before it.

QoR hypothesis

Neutral-to-better downstream: floorplan's repair_timing_helper and the place-stage repair_design start from an electrically sane netlist instead of one with unbuffered fanout-100 nets. This PR is a draft to let CI capture whether that holds across the design matrix. If it does, the question for maintainers is whether this matches the intention of the rest of the flow; if it doesn't, the per-design results are the data to decide between raising the fanout bound, defaulting off, or dropping the idea.

Raw yosys/ABC output leaves egregious high-fanout nets unbuffered, so
STA on 1_synth.odb reports fanout artifacts instead of logic depth.
This misleads anyone using synth as a fast signal for RTL changes: the
worst paths are dominated by unbuffered fanout that the place-stage
resizer later repairs for free, so they carry no actionable
information. The floorplan stage does not fix this either -- its
repair sequence (unbuffer,sizeup,swap,vt_swap) upsizes drivers but
never inserts buffers, so the first buffered netlist in the flow is
place, which is too slow for RTL iteration.

synth_syn.tcl already runs repair_design -pre_placement
unconditionally before writing 1_synth.odb. This gives the default
yosys path the same stage semantics with a fast, bounded, DRC-only
recipe: set_max_fanout (SYNTH_REPAIR_DESIGN_MAX_FANOUT, default 64) so
only the egregious nets are DRC violations, estimate_parasitics
-placement, and repair_design with wire splitting disabled (unplaced
cells have no meaningful wire length). -pre_placement itself is a
whole-design gain round and conflicts with -placement parasitics
(EST-0104).

The repair is context-free (no die area, bterm placement or routing
layers needed), so it is safe in synth_odb.tcl; the floorplan.tcl
conditioning block stays in floorplan per PR The-OpenROAD-Project#4187. The canonicalized
1_synth.sdc is written before the repair so the repair-scoping
set_max_fanout does not leak into the flow's SDC.

Default on; SKIP_SYNTH_REPAIR_DESIGN=1 restores the previous
behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@oharboe

oharboe commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

@maliberty Thoughts on this one? This is more of a question w measured data than a specific suggestion.

The QoR impact downstream seem neglible.

That some results are worse tells me little about whether it is an improvement.

@maliberty

Copy link
Copy Markdown
Member

estimate_parasitics -placement (handles unplaced cells);

Handles in the sense of doing nothing perhaps. There is no meaning to -placement without placement. I don't think this makes much sense.

@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you!

This prunes some of the paths that Claude wanted to take us down 👍

@oharboe oharboe closed this Jul 6, 2026
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