From 8facb0ec89530a6f0cb958506dd94377b348b412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Tue, 30 Dec 2025 12:45:17 +0100 Subject: [PATCH 1/4] scripts: introduce orfs_write_db/sdc wrappers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit is only to simplify the review. Signed-off-by: Øyvind Harboe --- flow/scripts/cts.tcl | 8 ++++---- flow/scripts/density_fill.tcl | 2 +- flow/scripts/detail_place.tcl | 4 ++-- flow/scripts/detail_route.tcl | 4 ++-- flow/scripts/fillcell.tcl | 2 +- flow/scripts/final_report.tcl | 2 +- flow/scripts/floorplan.tcl | 4 ++-- flow/scripts/global_place.tcl | 4 ++-- flow/scripts/global_place_skip_io.tcl | 2 +- flow/scripts/global_route.tcl | 10 +++++----- flow/scripts/io_placement.tcl | 2 +- flow/scripts/macro_place.tcl | 2 +- flow/scripts/pdn.tcl | 2 +- flow/scripts/repair_timing_post_place.tcl | 2 +- flow/scripts/resize.tcl | 2 +- flow/scripts/synth_odb.tcl | 4 ++-- flow/scripts/tapcell.tcl | 2 +- flow/scripts/util.tcl | 14 ++++++++++++++ 18 files changed, 43 insertions(+), 29 deletions(-) diff --git a/flow/scripts/cts.tcl b/flow/scripts/cts.tcl index e281f4b594..66732265eb 100644 --- a/flow/scripts/cts.tcl +++ b/flow/scripts/cts.tcl @@ -9,8 +9,8 @@ repair_clock_inverters proc save_progress { stage } { puts "Run 'make gui_$stage.odb' to load progress snapshot" - write_db $::env(RESULTS_DIR)/$stage.odb - write_sdc -no_timestamp $::env(RESULTS_DIR)/$stage.sdc + orfs_write_db $::env(RESULTS_DIR)/$stage.odb + orfs_write_sdc $::env(RESULTS_DIR)/$stage.sdc } # Run CTS @@ -80,5 +80,5 @@ report_metrics 4 "cts final" source_env_var_if_exists POST_CTS_TCL -write_db $::env(RESULTS_DIR)/4_1_cts.odb -write_sdc -no_timestamp $::env(RESULTS_DIR)/4_cts.sdc +orfs_write_db $::env(RESULTS_DIR)/4_1_cts.odb +orfs_write_sdc $::env(RESULTS_DIR)/4_cts.sdc diff --git a/flow/scripts/density_fill.tcl b/flow/scripts/density_fill.tcl index 08347868d5..a0f45f7276 100644 --- a/flow/scripts/density_fill.tcl +++ b/flow/scripts/density_fill.tcl @@ -8,7 +8,7 @@ if { $::env(USE_FILL) } { # The .v file is just for debugging purposes, not a result of # this stage. write_verilog $::env(RESULTS_DIR)/6_1_fill.v - write_db $::env(RESULTS_DIR)/6_1_fill.odb + orfs_write_db $::env(RESULTS_DIR)/6_1_fill.odb } else { log_cmd exec cp $::env(RESULTS_DIR)/5_route.odb $::env(RESULTS_DIR)/6_1_fill.odb # There is no 5_route.v file to copy diff --git a/flow/scripts/detail_place.tcl b/flow/scripts/detail_place.tcl index eff7a140d0..a0e1775947 100644 --- a/flow/scripts/detail_place.tcl +++ b/flow/scripts/detail_place.tcl @@ -32,10 +32,10 @@ proc do_dpl { } { set result [catch { do_dpl } errMsg] if { $result != 0 } { - write_db $::env(RESULTS_DIR)/3_5_place_dp-failed.odb + orfs_write_db $::env(RESULTS_DIR)/3_5_place_dp-failed.odb error $errMsg } report_metrics 3 "detailed place" true false -write_db $::env(RESULTS_DIR)/3_5_place_dp.odb +orfs_write_db $::env(RESULTS_DIR)/3_5_place_dp.odb diff --git a/flow/scripts/detail_route.tcl b/flow/scripts/detail_route.tcl index 6022daecc1..0a2aa6b5a5 100644 --- a/flow/scripts/detail_route.tcl +++ b/flow/scripts/detail_route.tcl @@ -7,7 +7,7 @@ if { ![grt::have_routes] } { } if { $::env(SKIP_DETAILED_ROUTE) } { - write_db $::env(RESULTS_DIR)/5_2_route.odb + orfs_write_db $::env(RESULTS_DIR)/5_2_route.odb exit } @@ -79,4 +79,4 @@ if { ![design_is_routed] } { report_metrics 5 "detailed route" -write_db $::env(RESULTS_DIR)/5_2_route.odb +orfs_write_db $::env(RESULTS_DIR)/5_2_route.odb diff --git a/flow/scripts/fillcell.tcl b/flow/scripts/fillcell.tcl index ea23e5b24f..ba4b96912e 100644 --- a/flow/scripts/fillcell.tcl +++ b/flow/scripts/fillcell.tcl @@ -8,7 +8,7 @@ if { [env_var_exists_and_non_empty FILL_CELLS] } { log_cmd filler_placement $::env(FILL_CELLS) check_placement - write_db $::env(RESULTS_DIR)/5_3_fillcell.odb + orfs_write_db $::env(RESULTS_DIR)/5_3_fillcell.odb } else { log_cmd exec cp $::env(RESULTS_DIR)/5_2_route.odb $::env(RESULTS_DIR)/5_3_fillcell.odb } diff --git a/flow/scripts/final_report.tcl b/flow/scripts/final_report.tcl index 5cebdf2ea8..928e92bf2b 100644 --- a/flow/scripts/final_report.tcl +++ b/flow/scripts/final_report.tcl @@ -8,7 +8,7 @@ set_propagated_clock [all_clocks] # Ensure all OR created (rsz/cts) instances are connected global_connect -write_db $::env(RESULTS_DIR)/6_final.odb +orfs_write_db $::env(RESULTS_DIR)/6_final.odb # Delete routing obstructions for final DEF source $::env(SCRIPTS_DIR)/deleteRoutingObstructions.tcl diff --git a/flow/scripts/floorplan.tcl b/flow/scripts/floorplan.tcl index 9880250f86..710cef5f16 100644 --- a/flow/scripts/floorplan.tcl +++ b/flow/scripts/floorplan.tcl @@ -150,5 +150,5 @@ report_metrics 2 "floorplan final" false false source_env_var_if_exists POST_FLOORPLAN_TCL source_env_var_if_exists IO_CONSTRAINTS -write_db $::env(RESULTS_DIR)/2_1_floorplan.odb -write_sdc -no_timestamp $::env(RESULTS_DIR)/2_1_floorplan.sdc +orfs_write_db $::env(RESULTS_DIR)/2_1_floorplan.odb +orfs_write_sdc $::env(RESULTS_DIR)/2_1_floorplan.sdc diff --git a/flow/scripts/global_place.tcl b/flow/scripts/global_place.tcl index ef130951b3..7ac604bc07 100644 --- a/flow/scripts/global_place.tcl +++ b/flow/scripts/global_place.tcl @@ -46,7 +46,7 @@ proc do_placement { global_placement_args } { set result [catch { do_placement $global_placement_args } errMsg] if { $result != 0 } { - write_db $::env(RESULTS_DIR)/3_3_place_gp-failed.odb + orfs_write_db $::env(RESULTS_DIR)/3_3_place_gp-failed.odb error $errMsg } @@ -59,4 +59,4 @@ if { $::env(CLUSTER_FLOPS) } { report_metrics 3 "global place" false false -write_db $::env(RESULTS_DIR)/3_3_place_gp.odb +orfs_write_db $::env(RESULTS_DIR)/3_3_place_gp.odb diff --git a/flow/scripts/global_place_skip_io.tcl b/flow/scripts/global_place_skip_io.tcl index b528856448..550df07fb6 100644 --- a/flow/scripts/global_place_skip_io.tcl +++ b/flow/scripts/global_place_skip_io.tcl @@ -13,4 +13,4 @@ if { [env_var_exists_and_non_empty FLOORPLAN_DEF] } { {*}[env_var_or_empty GLOBAL_PLACEMENT_ARGS] } -write_db $::env(RESULTS_DIR)/3_1_place_gp_skip_io.odb +orfs_write_db $::env(RESULTS_DIR)/3_1_place_gp_skip_io.odb diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 7d24fcdbc2..6970b759ab 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -29,11 +29,11 @@ proc global_route_helper { } { if { $result != 0 } { if { !$::env(GENERATE_ARTIFACTS_ON_FAILURE) } { - write_db $::env(RESULTS_DIR)/5_1_grt-failed.odb + orfs_write_db $::env(RESULTS_DIR)/5_1_grt-failed.odb error $errMsg } - write_sdc -no_timestamp $::env(RESULTS_DIR)/5_1_grt.sdc - write_db $::env(RESULTS_DIR)/5_1_grt.odb + orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc + orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb return } @@ -113,8 +113,8 @@ proc global_route_helper { } { source [file join $::env(SCRIPTS_DIR) "write_ref_sdc.tcl"] write_guides $::env(RESULTS_DIR)/route.guide - write_db $::env(RESULTS_DIR)/5_1_grt.odb - write_sdc -no_timestamp $::env(RESULTS_DIR)/5_1_grt.sdc + orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb + orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc } global_route_helper diff --git a/flow/scripts/io_placement.tcl b/flow/scripts/io_placement.tcl index e4f61e0983..0ec25dc545 100644 --- a/flow/scripts/io_placement.tcl +++ b/flow/scripts/io_placement.tcl @@ -11,7 +11,7 @@ if { -hor_layers $::env(IO_PLACER_H) \ -ver_layers $::env(IO_PLACER_V) \ {*}[env_var_or_empty PLACE_PINS_ARGS] - write_db $::env(RESULTS_DIR)/3_2_place_iop.odb + orfs_write_db $::env(RESULTS_DIR)/3_2_place_iop.odb write_pin_placement $::env(RESULTS_DIR)/3_2_place_iop.tcl } else { log_cmd exec cp $::env(RESULTS_DIR)/3_1_place_gp_skip_io.odb $::env(RESULTS_DIR)/3_2_place_iop.odb diff --git a/flow/scripts/macro_place.tcl b/flow/scripts/macro_place.tcl index cc0f7706c6..302dd7b9c7 100644 --- a/flow/scripts/macro_place.tcl +++ b/flow/scripts/macro_place.tcl @@ -4,5 +4,5 @@ load_design 2_1_floorplan.odb 2_1_floorplan.sdc source $::env(SCRIPTS_DIR)/macro_place_util.tcl -write_db $::env(RESULTS_DIR)/2_2_floorplan_macro.odb +orfs_write_db $::env(RESULTS_DIR)/2_2_floorplan_macro.odb write_macro_placement $::env(RESULTS_DIR)/2_2_floorplan_macro.tcl diff --git a/flow/scripts/pdn.tcl b/flow/scripts/pdn.tcl index 72d2c55c14..977fe71f1e 100644 --- a/flow/scripts/pdn.tcl +++ b/flow/scripts/pdn.tcl @@ -18,4 +18,4 @@ foreach net [$block getNets] { } } -write_db $::env(RESULTS_DIR)/2_4_floorplan_pdn.odb +orfs_write_db $::env(RESULTS_DIR)/2_4_floorplan_pdn.odb diff --git a/flow/scripts/repair_timing_post_place.tcl b/flow/scripts/repair_timing_post_place.tcl index a74b8c2b1a..53ce035ab3 100644 --- a/flow/scripts/repair_timing_post_place.tcl +++ b/flow/scripts/repair_timing_post_place.tcl @@ -18,4 +18,4 @@ puts "Estimate parasitics" estimate_parasitics -placement report_metrics 3 "place repair timing" true false -write_db $::env(RESULTS_DIR)/3_6_place_repair_timing.odb +orfs_write_db $::env(RESULTS_DIR)/3_6_place_repair_timing.odb diff --git a/flow/scripts/resize.tcl b/flow/scripts/resize.tcl index 50276a85ec..832855578c 100644 --- a/flow/scripts/resize.tcl +++ b/flow/scripts/resize.tcl @@ -32,4 +32,4 @@ report_metrics 3 "resizer" true false puts "Instance count before $instance_count_before, after [sta::network_leaf_instance_count]" puts "Pin count before $pin_count_before, after [sta::network_leaf_pin_count]" -write_db $::env(RESULTS_DIR)/3_4_place_resized.odb +orfs_write_db $::env(RESULTS_DIR)/3_4_place_resized.odb diff --git a/flow/scripts/synth_odb.tcl b/flow/scripts/synth_odb.tcl index 29553f6cf9..ad56b542e8 100644 --- a/flow/scripts/synth_odb.tcl +++ b/flow/scripts/synth_odb.tcl @@ -3,9 +3,9 @@ source $::env(SCRIPTS_DIR)/load.tcl erase_non_stage_variables synth load_design 1_2_yosys.v 1_2_yosys.sdc -write_db $::env(RESULTS_DIR)/1_synth.odb +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. -write_sdc -no_timestamp $::env(RESULTS_DIR)/1_synth.sdc +orfs_write_sdc $::env(RESULTS_DIR)/1_synth.sdc diff --git a/flow/scripts/tapcell.tcl b/flow/scripts/tapcell.tcl index eb00d11e23..cbd4ede9fc 100644 --- a/flow/scripts/tapcell.tcl +++ b/flow/scripts/tapcell.tcl @@ -9,4 +9,4 @@ if { [env_var_exists_and_non_empty TAPCELL_TCL] } { cut_rows } -write_db $::env(RESULTS_DIR)/2_3_floorplan_tapcell.odb +orfs_write_db $::env(RESULTS_DIR)/2_3_floorplan_tapcell.odb diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index 243e3b7d41..7dbb25a370 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -241,3 +241,17 @@ proc find_physical_only_masters { } { } return $physical_only_masters } + +proc orfs_write_db { output_file } { + if { $::env(SINGLE_OPENROAD_INVOCATION_FLOW) } { + return + } + log_cmd write_db $output_file +} + +proc orfs_write_sdc { output_file } { + if { $::env(SINGLE_OPENROAD_INVOCATION_FLOW) } { + return + } + log_cmd write_sdc -no_timestamp $output_file +} From b7a8ba7ef35474a3cfbe9c3a0e46fa6902adc6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Tue, 30 Dec 2025 12:17:41 +0100 Subject: [PATCH 2/4] flow: faster, leaner single openroad invocation flows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no longer save out all .odb/.sdc files automatically, the user can save out as many or as few as they need. Signed-off-by: Øyvind Harboe --- docs/user/FlowVariables.md | 4 ++-- flow/scripts/floorplan_to_place.tcl | 5 ++++- flow/scripts/util.tcl | 2 +- flow/scripts/variables.yaml | 9 +++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 178f0f2b0a..eb0130cfa9 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -157,7 +157,6 @@ configuration file. | IO_PLACER_H| A list of metal layers on which the I/O pins are placed horizontally (top and bottom of the die).| | | IO_PLACER_V| A list of metal layers on which the I/O pins are placed vertically (sides of the die).| | | IR_DROP_LAYER| Default metal layer to report IR drop.| | -| KEEP_VARS| Feature toggle to keep intermediate variables during the flow. This is useful for the single-run flow, where all stages of the flow are run in a single OpenROAD instance.| | | KLAYOUT_TECH_FILE| A mapping from LEF/DEF to GDS using the KLayout tool.| | | LATCH_MAP_FILE| Optional mapping file supplied to Yosys to map latches| | | LAYER_PARASITICS_FILE| Path to per layer parasitics file. Defaults to $(PLATFORM_DIR)/setRC.tcl.| | @@ -225,6 +224,7 @@ configuration file. | SETUP_REPAIR_SEQUENCE| Specifies the sequence of moves to do in repair_timing -setup. This should be a string of move keywords separated by commas such as the default when not used: "unbuffer,sizedown,sizeup,swap,buffer,clone,split".| | | SETUP_SLACK_MARGIN| Specifies a time margin for the slack when fixing setup violations. This option allows you to overfix or underfix(negative value, terminate retiming before 0 or positive slack). See HOLD_SLACK_MARGIN for more details.| 0| | SET_RC_TCL| Metal & Via RC definition file path.| | +| SINGLE_OPENROAD_INVOCATION_FLOW| Instead of invoking OpenROAD once per stage and saving out the .odb and .sdc file at each stage, invoke OpenROAD once and run through all stages in a single OpenROAD instance.| 0| | SKIP_ANTENNA_REPAIR| Skips antenna repair entirely.| 0| | SKIP_ANTENNA_REPAIR_POST_DRT| Skips antenna repair post-detailed routing.| 0| | SKIP_ANTENNA_REPAIR_PRE_GRT| Skips antenna repair pre-global routing.| 0| @@ -482,9 +482,9 @@ configuration file. ## All stages variables -- [KEEP_VARS](#KEEP_VARS) - [NUM_CORES](#NUM_CORES) - [OPENROAD_HIERARCHICAL](#OPENROAD_HIERARCHICAL) +- [SINGLE_OPENROAD_INVOCATION_FLOW](#SINGLE_OPENROAD_INVOCATION_FLOW) - [SWAP_ARITH_OPERATORS](#SWAP_ARITH_OPERATORS) - [SYNTH_WRAPPED_OPERATORS](#SYNTH_WRAPPED_OPERATORS) diff --git a/flow/scripts/floorplan_to_place.tcl b/flow/scripts/floorplan_to_place.tcl index 1cab12776e..fcfdab7482 100644 --- a/flow/scripts/floorplan_to_place.tcl +++ b/flow/scripts/floorplan_to_place.tcl @@ -1,5 +1,5 @@ # Enable keeping variables between stages -set ::env(KEEP_VARS) 1 +set ::env(SINGLE_OPENROAD_INVOCATION_FLOW) 1 # Floorplan source $::env(SCRIPTS_DIR)/floorplan.tcl @@ -30,3 +30,6 @@ source $::env(SCRIPTS_DIR)/detail_place.tcl # Repair timing after placement source $::env(SCRIPTS_DIR)/repair_timing_post_place.tcl + +write_db $::env(RESULTS_DIR)/3_6_place_repair_timing.odb +write_sdc -no_timestamp $::env(RESULTS_DIR)/3_6_place_repair_timing.sdc diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index 7dbb25a370..65b6803921 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -145,7 +145,7 @@ proc find_macros { } { } proc erase_non_stage_variables { stage_name } { - if { [info exists ::env(KEEP_VARS)] && $::env(KEEP_VARS) == 1 } { + if { $::env(SINGLE_OPENROAD_INVOCATION_FLOW) } { return } # "$::env(SCRIPTS_DIR)/stage_variables.py stage_name" returns list of diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index fe50e320f2..feeda2a0b0 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -1232,10 +1232,11 @@ NUM_CORES: routing, or place jobs running at the same time. stages: - All stages -KEEP_VARS: +SINGLE_OPENROAD_INVOCATION_FLOW: description: > - Feature toggle to keep intermediate variables during the flow. - This is useful for the single-run flow, where all stages of the flow - are run in a single OpenROAD instance. + Instead of invoking OpenROAD once per stage and saving out the + .odb and .sdc file at each stage, invoke OpenROAD once and run + through all stages in a single OpenROAD instance. stages: - All stages + default: 0 From 306ef25bfc2e05845f121a97cffced6cb85604bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Tue, 30 Dec 2025 21:03:21 +0100 Subject: [PATCH 3/4] openroad: single invocation flow has more knobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit erasing variables or not and saving sdc/odb after each stage are now different variables Signed-off-by: Øyvind Harboe --- docs/user/FlowVariables.md | 6 ++++-- flow/scripts/floorplan_to_place.tcl | 3 ++- flow/scripts/util.tcl | 6 +++--- flow/scripts/variables.yaml | 15 ++++++++++----- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index eb0130cfa9..16fcfffe95 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -157,6 +157,7 @@ configuration file. | IO_PLACER_H| A list of metal layers on which the I/O pins are placed horizontally (top and bottom of the die).| | | IO_PLACER_V| A list of metal layers on which the I/O pins are placed vertically (sides of the die).| | | IR_DROP_LAYER| Default metal layer to report IR drop.| | +| KEEP_VARS| Feature toggle to keep intermediate variables during the flow. This is useful for the single-run flow, where all stages of the flow are run in a single OpenROAD instance.| 0| | KLAYOUT_TECH_FILE| A mapping from LEF/DEF to GDS using the KLayout tool.| | | LATCH_MAP_FILE| Optional mapping file supplied to Yosys to map latches| | | LAYER_PARASITICS_FILE| Path to per layer parasitics file. Defaults to $(PLATFORM_DIR)/setRC.tcl.| | @@ -224,7 +225,6 @@ configuration file. | SETUP_REPAIR_SEQUENCE| Specifies the sequence of moves to do in repair_timing -setup. This should be a string of move keywords separated by commas such as the default when not used: "unbuffer,sizedown,sizeup,swap,buffer,clone,split".| | | SETUP_SLACK_MARGIN| Specifies a time margin for the slack when fixing setup violations. This option allows you to overfix or underfix(negative value, terminate retiming before 0 or positive slack). See HOLD_SLACK_MARGIN for more details.| 0| | SET_RC_TCL| Metal & Via RC definition file path.| | -| SINGLE_OPENROAD_INVOCATION_FLOW| Instead of invoking OpenROAD once per stage and saving out the .odb and .sdc file at each stage, invoke OpenROAD once and run through all stages in a single OpenROAD instance.| 0| | SKIP_ANTENNA_REPAIR| Skips antenna repair entirely.| 0| | SKIP_ANTENNA_REPAIR_POST_DRT| Skips antenna repair post-detailed routing.| 0| | SKIP_ANTENNA_REPAIR_PRE_GRT| Skips antenna repair pre-global routing.| 0| @@ -271,6 +271,7 @@ configuration file. | VERILOG_FILES| The path to the design Verilog/SystemVerilog files providing a description of modules.| | | VERILOG_INCLUDE_DIRS| Specifies the include directories for the Verilog input files.| | | VERILOG_TOP_PARAMS| Apply toplevel params (if exist). Passed in as a list of key value pairs in tcl syntax; separated by spaces: PARAM1 VALUE1 PARAM2 VALUE2 stages: - synth| | +| WRITE_ODB_AND_SDC_EACH_STAGE| Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow.| 1| | YOSYS_FLAGS| Flags to pass to yosys.| -v 3| ## synth variables @@ -484,9 +485,9 @@ configuration file. - [NUM_CORES](#NUM_CORES) - [OPENROAD_HIERARCHICAL](#OPENROAD_HIERARCHICAL) -- [SINGLE_OPENROAD_INVOCATION_FLOW](#SINGLE_OPENROAD_INVOCATION_FLOW) - [SWAP_ARITH_OPERATORS](#SWAP_ARITH_OPERATORS) - [SYNTH_WRAPPED_OPERATORS](#SYNTH_WRAPPED_OPERATORS) +- [WRITE_ODB_AND_SDC_EACH_STAGE](#WRITE_ODB_AND_SDC_EACH_STAGE) ## generate_abstract variables @@ -519,6 +520,7 @@ configuration file. - [GLOBAL_PLACEMENT_ARGS](#GLOBAL_PLACEMENT_ARGS) - [GUI_TIMING](#GUI_TIMING) - [IR_DROP_LAYER](#IR_DROP_LAYER) +- [KEEP_VARS](#KEEP_VARS) - [KLAYOUT_TECH_FILE](#KLAYOUT_TECH_FILE) - [LAYER_PARASITICS_FILE](#LAYER_PARASITICS_FILE) - [LIB_FILES](#LIB_FILES) diff --git a/flow/scripts/floorplan_to_place.tcl b/flow/scripts/floorplan_to_place.tcl index fcfdab7482..f1d46c118b 100644 --- a/flow/scripts/floorplan_to_place.tcl +++ b/flow/scripts/floorplan_to_place.tcl @@ -1,5 +1,6 @@ # Enable keeping variables between stages -set ::env(SINGLE_OPENROAD_INVOCATION_FLOW) 1 +set ::env(KEEP_VARS) 1 +set ::env(WRITE_ODB_AND_SDC_EACH_STAGE) 0 # Floorplan source $::env(SCRIPTS_DIR)/floorplan.tcl diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index 65b6803921..c06e942d6d 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -145,7 +145,7 @@ proc find_macros { } { } proc erase_non_stage_variables { stage_name } { - if { $::env(SINGLE_OPENROAD_INVOCATION_FLOW) } { + if { $::env(KEEP_VARS) } { return } # "$::env(SCRIPTS_DIR)/stage_variables.py stage_name" returns list of @@ -243,14 +243,14 @@ proc find_physical_only_masters { } { } proc orfs_write_db { output_file } { - if { $::env(SINGLE_OPENROAD_INVOCATION_FLOW) } { + if { !$::env(WRITE_ODB_AND_SDC_EACH_STAGE) } { return } log_cmd write_db $output_file } proc orfs_write_sdc { output_file } { - if { $::env(SINGLE_OPENROAD_INVOCATION_FLOW) } { + if { !$::env(WRITE_ODB_AND_SDC_EACH_STAGE) } { return } log_cmd write_sdc -no_timestamp $output_file diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index feeda2a0b0..899c50bae8 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -1232,11 +1232,16 @@ NUM_CORES: routing, or place jobs running at the same time. stages: - All stages -SINGLE_OPENROAD_INVOCATION_FLOW: +KEEP_VARS: description: > - Instead of invoking OpenROAD once per stage and saving out the - .odb and .sdc file at each stage, invoke OpenROAD once and run - through all stages in a single OpenROAD instance. + Feature toggle to keep intermediate variables during the flow. + This is useful for the single-run flow, where all stages of the flow + are run in a single OpenROAD instance. + default: 0 +WRITE_ODB_AND_SDC_EACH_STAGE: + description: > + Save out .sdc and .odb file after each stage, useful to disable + when using a single OpenROAD instance to run all stages of the flow. stages: - All stages - default: 0 + default: 1 From e7cfcfd9c68aa05fbb9d877e05f2f585e5e30715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 31 Dec 2025 07:03:16 +0100 Subject: [PATCH 4/4] floorplan_to_place: behavior is back to what it was on master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR now adds the option of skipping saving of .odb/.sdc files only Signed-off-by: Øyvind Harboe --- docs/user/FlowVariables.md | 2 +- flow/scripts/floorplan_to_place.tcl | 4 ---- flow/scripts/variables.yaml | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 16fcfffe95..78e0f99f41 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -483,6 +483,7 @@ configuration file. ## All stages variables +- [KEEP_VARS](#KEEP_VARS) - [NUM_CORES](#NUM_CORES) - [OPENROAD_HIERARCHICAL](#OPENROAD_HIERARCHICAL) - [SWAP_ARITH_OPERATORS](#SWAP_ARITH_OPERATORS) @@ -520,7 +521,6 @@ configuration file. - [GLOBAL_PLACEMENT_ARGS](#GLOBAL_PLACEMENT_ARGS) - [GUI_TIMING](#GUI_TIMING) - [IR_DROP_LAYER](#IR_DROP_LAYER) -- [KEEP_VARS](#KEEP_VARS) - [KLAYOUT_TECH_FILE](#KLAYOUT_TECH_FILE) - [LAYER_PARASITICS_FILE](#LAYER_PARASITICS_FILE) - [LIB_FILES](#LIB_FILES) diff --git a/flow/scripts/floorplan_to_place.tcl b/flow/scripts/floorplan_to_place.tcl index f1d46c118b..1cab12776e 100644 --- a/flow/scripts/floorplan_to_place.tcl +++ b/flow/scripts/floorplan_to_place.tcl @@ -1,6 +1,5 @@ # Enable keeping variables between stages set ::env(KEEP_VARS) 1 -set ::env(WRITE_ODB_AND_SDC_EACH_STAGE) 0 # Floorplan source $::env(SCRIPTS_DIR)/floorplan.tcl @@ -31,6 +30,3 @@ source $::env(SCRIPTS_DIR)/detail_place.tcl # Repair timing after placement source $::env(SCRIPTS_DIR)/repair_timing_post_place.tcl - -write_db $::env(RESULTS_DIR)/3_6_place_repair_timing.odb -write_sdc -no_timestamp $::env(RESULTS_DIR)/3_6_place_repair_timing.sdc diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index 899c50bae8..27bba8e9f7 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -1238,6 +1238,8 @@ KEEP_VARS: This is useful for the single-run flow, where all stages of the flow are run in a single OpenROAD instance. default: 0 + stages: + - All stages WRITE_ODB_AND_SDC_EACH_STAGE: description: > Save out .sdc and .odb file after each stage, useful to disable