diff --git a/docs/contrib/TclContract.md b/docs/contrib/TclContract.md index e1b5d98686..d6c6a017cf 100644 --- a/docs/contrib/TclContract.md +++ b/docs/contrib/TclContract.md @@ -50,6 +50,11 @@ to follow. when ORFS wants a value other than the tool's. *Breaks:* a change to the default in OpenROAD has no effect in ORFS, and the two drift apart. +- **An optional value the tool chooses when it is absent defaults to `""` + and is tested with `$::env(X) ne ""` where it decides whether an option + is passed.** `append_env_var ... 1` passes nothing for `""`. + *Breaks:* the guard is a code path no CI run exercises, and a misspelled + or erased variable silently lets the tool choose. - **A script never trades an explicit variable for a clever one.** A flag that means one thing (`has_clock`) stays a flag; an empty string or a sentinel value never stands in for it. diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index b14640608c..8d4db769dd 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -94,7 +94,7 @@ configuration file. | ABC_DRIVER_CELL| Default driver cell used during ABC synthesis.| | | ABC_LOAD_IN_FF| During synthesis set_load value used.| | | ABC_SCRIPT| Replaces the ABC script synthesis runs, so that a design can vendor and change it. Ignored when SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS is set: abc_new then maps each arithmetic operator with its own script.| | -| ABSTRACT_SOURCE| Which .odb file to use to create abstract| | +| ABSTRACT_SOURCE| Which .odb file to use to create abstract| 6_final| | ADDER_MAP_FILE| Optional mapping file supplied to Yosys to map adders| | | ADDITIONAL_FAST_LIBS| Hardened macro library files for the fast corner, on a platform that keeps one liberty list per corner (see CORNERS). The platform config adds them to its FAST_LIB_FILES, as ihp-sg13g2 does. With BLOCKS, the fast corner timing model of each block is appended.| | | ADDITIONAL_FILES| Additional files to be added to `make issue` archive.| | diff --git a/flow/scripts/generate_abstract.tcl b/flow/scripts/generate_abstract.tcl index 7fc2fd9726..9c34bf39ba 100644 --- a/flow/scripts/generate_abstract.tcl +++ b/flow/scripts/generate_abstract.tcl @@ -1,11 +1,7 @@ source $::env(SCRIPTS_DIR)/load.tcl erase_non_stage_variables generate_abstract -set stem [expr { - [env_var_exists_and_non_empty ABSTRACT_SOURCE] ? - $::env(ABSTRACT_SOURCE) : - "6_final" -}] +set stem $::env(ABSTRACT_SOURCE) set design_stage [lindex [extract_stage $stem.odb] 0] diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index a6d443913a..66e43e3a90 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -21,9 +21,8 @@ if { [lsearch -exact $::env(GLOBAL_ROUTE_ARGS) -allow_congestion] >= 0 } { } proc set_grt_seed { } { - set seed_arg [env_var_or_empty GRT_SEED] - if { $seed_arg ne "" } { - log_cmd set_global_routing_random -seed $seed_arg + if { $::env(GRT_SEED) ne "" } { + log_cmd set_global_routing_random -seed $::env(GRT_SEED) } } diff --git a/flow/scripts/load.tcl b/flow/scripts/load.tcl index a5574939ff..baa1ec4407 100644 --- a/flow/scripts/load.tcl +++ b/flow/scripts/load.tcl @@ -76,7 +76,7 @@ proc load_design_from { dir design_file } { log_cmd source $::env(PLATFORM_DIR)/setRC.tcl } - if { [env_var_exists_and_non_empty WIRE_LOAD_MODEL] } { + if { $::env(WIRE_LOAD_MODEL) ne "" } { # OpenSTA applies a wire-load model only to nets without parasitics. log_cmd set_wire_load_model -name $::env(WIRE_LOAD_MODEL) } diff --git a/flow/scripts/open.tcl b/flow/scripts/open.tcl index 59a30270a9..139726798c 100644 --- a/flow/scripts/open.tcl +++ b/flow/scripts/open.tcl @@ -44,7 +44,7 @@ proc read_timing { input_file } { } else { log_cmd source $::env(PLATFORM_DIR)/setRC.tcl } - if { [env_var_exists_and_non_empty WIRE_LOAD_MODEL] } { + if { $::env(WIRE_LOAD_MODEL) ne "" } { # OpenSTA applies a wire-load model only to nets without parasitics. log_cmd set_wire_load_model -name $::env(WIRE_LOAD_MODEL) } diff --git a/flow/scripts/report_metrics.tcl b/flow/scripts/report_metrics.tcl index 749a2cb340..6018c85658 100644 --- a/flow/scripts/report_metrics.tcl +++ b/flow/scripts/report_metrics.tcl @@ -12,7 +12,7 @@ proc report_puts { out } { proc get_power_file_scope_args { } { set args [list] - if { [env_var_exists_and_non_empty POWER_FILE_SCOPE] } { + if { $::env(POWER_FILE_SCOPE) ne "" } { set scope_val $::env(POWER_FILE_SCOPE) # 1. Strip surrounding quotes from shell/Make diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index bb4f34a03b..c1401d596b 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -644,6 +644,7 @@ WIRE_LOAD_MODEL: unknown name is an error. Empty, the default, applies none. A platform whose libraries define no wire_load group can supply one in a Liberty file listed in ADDITIONAL_LIBS. + default: "" type: string TAPCELL_TCL: description: | @@ -791,6 +792,7 @@ PLACE_DENSITY_LB_ADDON: REPAIR_PDN_VIA_LAYER: description: | Remove power grid vias which generate DRC violations after detailed routing. + default: "" GLOBAL_PLACEMENT_ARGS: description: > Use additional tuning parameters during global placement other than default @@ -866,11 +868,13 @@ CAP_MARGIN: description: > Specifies a capacitance margin when fixing max capacitance violations. This option allows you to overfix. + default: "" tunable: 1 SLEW_MARGIN: description: > Specifies a slew margin when fixing max slew violations. This option allows you to overfix. + default: "" tunable: 1 CTS_ARGS: description: | @@ -935,6 +939,7 @@ SETUP_MOVE_SEQUENCE: description: > Passed as -sequence to repair_timing. This should be a string of move keywords separated by commas. + default: "" stages: - cts - floorplan @@ -945,6 +950,7 @@ SETUP_REPAIR_PHASES: repair phase names separated by spaces. Set to PARALLEL_EVAL to repair setup timing with the experimental parallel evaluation policy. When unset, repair_timing runs its default phases. + default: "" stages: - cts - floorplan @@ -1056,12 +1062,14 @@ MIN_CLK_ROUTING_LAYER: VIA_IN_PIN_MIN_LAYER: description: > Passed as -via_in_pin_bottom_layer to pin_access and detailed_route. + default: "" stages: - grt - route VIA_IN_PIN_MAX_LAYER: description: > Passed as -via_in_pin_top_layer to pin_access and detailed_route. + default: "" stages: - grt - route @@ -1084,11 +1092,13 @@ DETAILED_ROUTE_END_ITERATION: OR_K: description: > Passed as -or_k to detailed routing. + default: "" stages: - route OR_SEED: description: > Passed as -or_seed to detailed routing. + default: "" stages: - route RCX_RULES: @@ -1553,6 +1563,7 @@ SEAL_GDS: ABSTRACT_SOURCE: description: | Which .odb file to use to create abstract + default: 6_final stages: - generate_abstract PRE_GLOBAL_ROUTE_TCL: @@ -1936,6 +1947,7 @@ OPT_POST_GRT_WNS: GRT_SEED: description: > Specifies a random seed for global routing. Useful for perturbation studies. + default: "" stages: - grt tunable: 1 @@ -1949,6 +1961,7 @@ POWER_FILE_SCOPE: description: > The SAIF or VCD scope of the current design. Typically the test bench name and design under the test instance name. Scope levels are separated with '/'. + default: "" type: string VCD_FILE: description: >