diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 5ac9ab8ce5..2eabff74f3 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -296,7 +296,7 @@ configuration file. | SKIP_REPORT_METRICS| If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds.| 0| | SKIP_VT_SWAP| Do not perform VT swap to improve QoR (default: do VT swap).| | | SLEW_MARGIN| Specifies a slew margin when fixing max slew violations. This option allows you to overfix.| | -| SWAP_ARITH_OPERATORS| Improve timing QoR by swapping ALU and MULT arithmetic operators.| | +| SWAP_ARITH_OPERATORS| Improve timing QoR by swapping ALU and MULT arithmetic operators.| 0| | SYNTH_ARGS| Optional synthesis variables for yosys.| | | SYNTH_BLACKBOXES| List of cells treated as a black box by Yosys. With Bazel, this can be used to run synthesis in parallel for the large modules of the design. Non-existant modules are ignored silently, useful when listing modules statically, even if modules come and go dynamically.| | | SYNTH_CANONICALIZE_TCL| Specifies a Tcl script with commands to run as part of the synth canonicalize step.| | @@ -313,7 +313,7 @@ configuration file. | SYNTH_MOCK_LARGE_MEMORIES| Reduce Yosys inferred memories larger than SYNTH_MEMORY_MAX_BITS to 1 row. Yosys will generally infer memories from behavioral Verilog code, whether the memories are in standalone modules or instantiated within some larger module. fakeram and empty Verilog memories(blackboxes) of memories will not be inferred memories by Yosys and are therefore not affected by this variable. This is useful and convenient to separate the concern of instantiating and placing memories from investigating other issues with a design, though it comes at the expense of the increased accuracy that using realistic fakemem would provide. Memories with a single 1 row will of course have unrealistically good timing and area characteristics, but timing will still correctly terminate in a register. Large port memories, typically register files, will still have the retain a lot of the port logic that can be useful to investigate issues. This can be especially useful during development of designs where the behavioral model comes first and suitable memories are matched up when the design RTL is stable. A typical use case would be Chisel which will generate a behavioral model for a memories with the required clocks, ports, etc. in addition to a computer readable file with the specification of the memories that is used to [automatically](https://chipyard.readthedocs.io/en/stable/Tools/Barstools.html/) match up suitable memory macros later in the flow. During an architectural screening study, a large range of memory configurations can be investigated quickly with this option, without getting bogged down in the concern of how to realize the memories in silicon for emphemral RTL configurations that exist only long enough to run through the ORFS flow to create a table of some characteristics of a design configuration.| 0| | 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_OPT_HIER| Optimize constants across hierarchical boundaries.| 0| | 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| @@ -321,7 +321,7 @@ configuration file. | SYNTH_USE_SYN| If set to 1, run synthesis using the "syn" tool built into OpenROAD (the synth_syn.tcl flow) instead of the default Yosys-based flow. Defaults to 0 (Yosys flow).| 0| | SYNTH_WRAPPED_ADDERS| Specify the adder modules that can be used for synthesis, separated by commas. The default adder module is determined by the first element of this variable.| | | SYNTH_WRAPPED_MULTIPLIERS| Specify the multiplier modules that can be used for synthesis, separated by commas. The default multiplier module is determined by the first element of this variable.| | -| SYNTH_WRAPPED_OPERATORS| Synthesize multiple architectural options for each arithmetic operator in the design. These options are available for switching among in later stages of the flow.| | +| SYNTH_WRAPPED_OPERATORS| Synthesize multiple architectural options for each arithmetic operator in the design. These options are available for switching among in later stages of the flow.| 0| | TAPCELL_TCL| Path to Endcap and Welltie cells file.| | | TAP_CELL_NAME| Name of the cell to use in tap cell insertion.| | | TECH_LEF| A technology LEF file of the PDK that includes all relevant information regarding metal layers, vias, and spacing requirements.| | diff --git a/flow/scripts/floorplan.tcl b/flow/scripts/floorplan.tcl index 31d2720ab9..f4ca400139 100644 --- a/flow/scripts/floorplan.tcl +++ b/flow/scripts/floorplan.tcl @@ -145,7 +145,7 @@ if { !$::env(SKIP_REPAIR_TIE_FANOUT) } { log_cmd repair_tie_fanout -separation $::env(TIE_SEPARATION) $tiehi_pin } -if { [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } { +if { [env_var_equals SWAP_ARITH_OPERATORS 1] } { # Enable sanity checker until replace_arith_modules becomes stable set_debug_level ODB replace_design_check_sanity 1 log_cmd replace_arith_modules diff --git a/flow/scripts/resize.tcl b/flow/scripts/resize.tcl index 73321e7f81..9a1abba827 100644 --- a/flow/scripts/resize.tcl +++ b/flow/scripts/resize.tcl @@ -15,7 +15,7 @@ if { [env_var_exists_and_non_empty EARLY_SIZING_CAP_RATIO] } { log_cmd set_opt_config -set_early_sizing_cap_ratio $env(EARLY_SIZING_CAP_RATIO) } -if { [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } { +if { [env_var_equals SWAP_ARITH_OPERATORS 1] } { # Enable sanity checker until replace_arith_modules becomes stable set_debug_level ODB replace_design_check_sanity 1 replace_arith_modules diff --git a/flow/scripts/synth.tcl b/flow/scripts/synth.tcl index 14b5617e82..07be4fd0b6 100644 --- a/flow/scripts/synth.tcl +++ b/flow/scripts/synth.tcl @@ -104,7 +104,7 @@ if { [env_var_exists_and_non_empty SYNTH_OPERATIONS_ARGS] } { set synth_full_args [concat $synth_full_args \ "-extra-map $::env(FLOW_HOME)/platforms/common/lcu_kogge_stone.v"] } -if { [env_var_exists_and_non_empty SYNTH_OPT_HIER] } { +if { [env_var_equals SYNTH_OPT_HIER 1] } { set synth_full_args [concat $synth_full_args -hieropt] } @@ -187,8 +187,8 @@ if { [env_var_exists_and_non_empty SYNTH_RETIME_MODULES] } { } if { - [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] || - [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] + [env_var_equals SYNTH_WRAPPED_OPERATORS 1] || + [env_var_equals SWAP_ARITH_OPERATORS 1] } { source $::env(SCRIPTS_DIR)/synth_wrap_operators.tcl } else { @@ -211,10 +211,10 @@ opt -purge if { [env_var_exists_and_non_empty ADDER_MAP_FILE] && ( - (![env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] && - ![env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]) || - (([env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] || - [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]) && + (![env_var_equals SYNTH_WRAPPED_OPERATORS 1] && + ![env_var_equals SWAP_ARITH_OPERATORS 1]) || + (([env_var_equals SYNTH_WRAPPED_OPERATORS 1] || + [env_var_equals SWAP_ARITH_OPERATORS 1]) && ![design_has_extracted_operators]) ) } { @@ -274,8 +274,8 @@ opt setundef -zero if { - ![env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] && - ![env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] + ![env_var_equals SYNTH_WRAPPED_OPERATORS 1] && + ![env_var_equals SWAP_ARITH_OPERATORS 1] } { log_cmd abc {*}$abc_args } else { @@ -311,8 +311,8 @@ tee -o $::env(REPORTS_DIR)/synth_stat.txt stat -hierarchy {*}$lib_args # check the design is composed exclusively of target cells, and # check for other problems if { - ![env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] && - ![env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] + ![env_var_equals SYNTH_WRAPPED_OPERATORS 1] && + ![env_var_equals SWAP_ARITH_OPERATORS 1] } { check -assert -mapped } else { diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index 5b7d98c8d1..b589303217 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -214,8 +214,8 @@ proc source_env_var_if_exists { env_var } { # will be default and this code will be deleted. proc hier_options { } { if { - ([env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] || - [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]) && + ([env_var_equals SYNTH_WRAPPED_OPERATORS 1] || + [env_var_equals SWAP_ARITH_OPERATORS 1]) && !$::env(OPENROAD_HIERARCHICAL) } { error "SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS require OPENROAD_HIERARCHICAL to be set." diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index 374f80fe54..d2725ce668 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -1268,6 +1268,7 @@ "tunable": 1 }, "SWAP_ARITH_OPERATORS": { + "default": 0, "description": "Improve timing QoR by swapping ALU and MULT arithmetic operators.\n", "stages": [ "All stages" @@ -1378,6 +1379,7 @@ ] }, "SYNTH_OPT_HIER": { + "default": 0, "description": "Optimize constants across hierarchical boundaries.\n", "stages": [ "synth" @@ -1430,6 +1432,7 @@ ] }, "SYNTH_WRAPPED_OPERATORS": { + "default": 0, "description": "Synthesize multiple architectural options for each arithmetic operator in the design. These options are available for switching among in later stages of the flow.\n", "stages": [ "All stages" diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index 21d603837a..1b6abe4c83 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -467,6 +467,7 @@ SYNTH_WRAPPED_OPERATORS: the flow. stages: - All stages + default: 0 SYNTH_WRAPPED_ADDERS: description: > Specify the adder modules that can be used for synthesis, separated by commas. @@ -484,6 +485,7 @@ SWAP_ARITH_OPERATORS: Improve timing QoR by swapping ALU and MULT arithmetic operators. stages: - All stages + default: 0 FLOORPLAN_DEF: description: | Use the DEF file to initialize floorplan. Mutually exclusive with FOOTPRINT or DIE_AREA/CORE_AREA or CORE_UTILIZATION. @@ -1074,6 +1076,7 @@ SYNTH_OPT_HIER: Optimize constants across hierarchical boundaries. stages: - synth + default: 0 VERILOG_TOP_PARAMS: description: | Apply toplevel params (if exist). Passed in as a list of key value pairs