diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 78871f1552..d112753ca0 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -288,6 +288,7 @@ configuration file. | SKIP_PIN_SWAP| Do not use pin swapping as a transform to fix timing violations (default: use pin swapping).| | | SKIP_REPAIR_TIE_FANOUT| Skip repair_tie_fanout at floorplan step.| 0| | SKIP_REPORT_METRICS| If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds.| 0| +| SKIP_SYNTH_REPAIR_DESIGN| Skip the DRC-only repair_design of egregious high-fanout nets when writing 1_synth.odb.| 0| | SKIP_VT_SWAP| Do not perform VT swap to improve QoR (default: do VT swap).| | | SLANG_PLUGIN_PATH| Path to the slang plugin for Yosys. This can be a full path to a custom-built plugin (e.g. for Bazel builds) or just the plugin name.| slang| | SLEW_MARGIN| Specifies a slew margin when fixing max slew violations. This option allows you to overfix.| | @@ -309,6 +310,7 @@ configuration file. | SYNTH_NETLIST_FILES| Skips synthesis and uses the supplied netlist files. If the netlist files contains duplicate modules, which can happen when using hierarchical synthesis on indvidual netlist files and combining here, subsequent modules are silently ignored and only the first module is used.| | | SYNTH_OPERATIONS_ARGS| Extra arguments appended to the Yosys synth command operations list. When set, replaces the default Kogge-Stone adder extra-map.| | | SYNTH_OPT_HIER| Optimize constants across hierarchical boundaries.| | +| SYNTH_REPAIR_DESIGN_MAX_FANOUT| Fanout above which a net is considered an egregious violation to be buffered by the synth stage repair_design.| 64| | SYNTH_REPEATABLE_BUILD| License to prune anything that makes builds less repeatable, typically used with Bazel to ensure that builds are bit-for-bit identical so that caching works optimally. Removes debug information that encodes paths, timestamps, etc.| 0| | SYNTH_RETIME_MODULES| *This is an experimental option and may cause adverse effects.* *No effort has been made to check if the retimed RTL is logically equivalent to the non-retimed RTL.* List of modules to apply automatic retiming to. These modules must not get dissolved and as such they should either be the top module or be included in SYNTH_KEEP_MODULES. The main use case is to quickly identify if performance can be improved by manually retiming the input RTL. Retiming will treat module ports like register endpoints/startpoints. The objective function of retiming isn't informed by SDC, even the clock period is ignored. As such, retiming will optimize for best delay at potentially high register number cost. Automatic retiming can produce suboptimal results as its timing model is crude and it doesn't find the optimal distribution of registers on long pipelines. See OR discussion # 8080.| | | SYNTH_SKIP_KEEP| Only meaningful together with SYNTH_CHECKPOINT. When set, signals that the supplied checkpoint is still canonical RTLIL (coarse synth and `keep_hierarchy` have not been run yet), so synth.tcl runs the full coarse+fine synthesis flattened. When unset and SYNTH_CHECKPOINT is used, synth.tcl assumes the checkpoint already has coarse synth + `keep_hierarchy` done and resumes from `coarse:fine`.| 0| @@ -353,6 +355,7 @@ configuration file. - [SDC_FILE](#SDC_FILE) - [SDC_GUT](#SDC_GUT) - [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS) +- [SKIP_SYNTH_REPAIR_DESIGN](#SKIP_SYNTH_REPAIR_DESIGN) - [SLANG_PLUGIN_PATH](#SLANG_PLUGIN_PATH) - [SYNTH_ARGS](#SYNTH_ARGS) - [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES) @@ -371,6 +374,7 @@ configuration file. - [SYNTH_NETLIST_FILES](#SYNTH_NETLIST_FILES) - [SYNTH_OPERATIONS_ARGS](#SYNTH_OPERATIONS_ARGS) - [SYNTH_OPT_HIER](#SYNTH_OPT_HIER) +- [SYNTH_REPAIR_DESIGN_MAX_FANOUT](#SYNTH_REPAIR_DESIGN_MAX_FANOUT) - [SYNTH_REPEATABLE_BUILD](#SYNTH_REPEATABLE_BUILD) - [SYNTH_RETIME_MODULES](#SYNTH_RETIME_MODULES) - [SYNTH_SKIP_KEEP](#SYNTH_SKIP_KEEP) diff --git a/flow/scripts/synth_odb.tcl b/flow/scripts/synth_odb.tcl index 63bdc98cda..5207e9620d 100644 --- a/flow/scripts/synth_odb.tcl +++ b/flow/scripts/synth_odb.tcl @@ -28,9 +28,35 @@ report_design_area report_design_area_metrics source_step_tcl POST SYNTH -orfs_write_db $::env(RESULTS_DIR)/1_synth.odb # Canonicalize 1_synth.sdc. The original SDC_FILE provided by # the user could have dependencies, such as sourcing util.tcl, # which are read in here and a canonicalized version is written # out by OpenSTA that has no dependencies. +# +# Written before the fanout repair below so that its repair-scoping +# set_max_fanout does not leak into the flow's SDC. orfs_write_sdc $::env(RESULTS_DIR)/1_synth.sdc + +# The synth stage owns the electrical sanity of its product. Raw yosys/ABC +# output leaves egregious high-fanout nets unbuffered; STA on 1_synth.odb +# then reports fanout artifacts instead of logic depth, which misleads +# anyone using synth as a signal for RTL changes. synth_syn.tcl already +# runs repair_design -pre_placement unconditionally before writing +# 1_synth.odb; this is the yosys-path analog, but DRC-only and bounded: +# -pre_placement is a whole-design gain round and conflicts with +# -placement parasitics (EST-0104). set_max_fanout makes only the +# egregious nets DRC violations; -max_wire_length large disables wire +# splitting (unplaced cells have no meaningful wire length). Like +# eliminate_dead_logic above, this is context-free (no die/bterm/layer +# dependence) -- the floorplan.tcl conditioning block stays in floorplan +# per PR #4187. +if { !$::env(SKIP_SYNTH_REPAIR_DESIGN) } { + if { [env_var_exists_and_non_empty DONT_USE_CELLS] } { + set_dont_use $::env(DONT_USE_CELLS) + } + set_max_fanout $::env(SYNTH_REPAIR_DESIGN_MAX_FANOUT) [current_design] + log_cmd estimate_parasitics -placement + log_cmd repair_design -max_wire_length 1000000 +} + +orfs_write_db $::env(RESULTS_DIR)/1_synth.odb diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index 3a2db59d7f..ca40c31d06 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -1220,6 +1220,13 @@ "final" ] }, + "SKIP_SYNTH_REPAIR_DESIGN": { + "default": 0, + "description": "Skip the DRC-only repair_design of egregious high-fanout nets when writing 1_synth.odb.\n", + "stages": [ + "synth" + ] + }, "SKIP_VT_SWAP": { "description": "Do not perform VT swap to improve QoR (default: do VT swap).\n", "stages": [ @@ -1355,6 +1362,13 @@ "synth" ] }, + "SYNTH_REPAIR_DESIGN_MAX_FANOUT": { + "default": 64, + "description": "Fanout above which a net is considered an egregious violation to be buffered by the synth stage repair_design.\n", + "stages": [ + "synth" + ] + }, "SYNTH_REPEATABLE_BUILD": { "default": 0, "description": "License to prune anything that makes builds less repeatable, typically used with Bazel to ensure that builds are bit-for-bit identical so that caching works optimally. Removes debug information that encodes paths, timestamps, etc.\n", diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index 8bca003947..cb49ada4fc 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -448,6 +448,20 @@ SWAP_ARITH_OPERATORS: Improve timing QoR by swapping ALU and MULT arithmetic operators. stages: - All stages +SKIP_SYNTH_REPAIR_DESIGN: + description: > + Skip the DRC-only repair_design of egregious high-fanout nets when + writing 1_synth.odb. + stages: + - synth + default: 0 +SYNTH_REPAIR_DESIGN_MAX_FANOUT: + description: > + Fanout above which a net is considered an egregious violation to be + buffered by the synth stage repair_design. + stages: + - synth + default: 64 FLOORPLAN_DEF: description: | Use the DEF file to initialize floorplan. Mutually exclusive with FOOTPRINT or DIE_AREA/CORE_AREA or CORE_UTILIZATION.