Skip to content

global_route: catch failures to generate deterministic artifacts - #4416

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:feat-global-route-catch-failures
Aug 12, 2026
Merged

global_route: catch failures to generate deterministic artifacts#4416
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:feat-global-route-catch-failures

Conversation

@oharboe

@oharboe oharboe commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Consistent handling with the original GENERATE_ARTIFACTS_ON_FAILURE_POLICY by using a wrapper function.

Wraps all incremental global_route invocations (e.g. post repair_design or recover_power iterations) in proper catch blocks. If global_route fails or becomes infeasible mid-flow, it writes out a deterministic 5_1_grt-failed.odb rather than crashing without diagnostic artifacts.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a helper procedure run_global_route_and_catch_failures in flow/scripts/global_route.tcl to centralize error handling and artifact generation during global routing. The reviewer identified two issues with this helper: potential errors if the GENERATE_ARTIFACTS_ON_FAILURE environment variable is undefined, and compatibility issues with the single-process flow where standard artifact-writing functions might be bypassed. A code suggestion was provided to use env_var_equals and direct log_cmd calls to ensure robustness.

Comment thread flow/scripts/global_route.tcl
@oharboe
oharboe force-pushed the feat-global-route-catch-failures branch from 1d1c421 to 3bd1f73 Compare August 12, 2026 12:38
@oharboe

oharboe commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a helper procedure run_global_route_and_catch_failures in flow/scripts/global_route.tcl to centralize failure handling and artifact generation during global routing. Feedback points out that using log_cmd write_db and log_cmd write_sdc directly bypasses the WRITE_ODB_AND_SDC_EACH_STAGE check, which can cause failures in the single-process flow. It is recommended to use orfs_write_db and orfs_write_sdc instead.

Comment thread flow/scripts/global_route.tcl Outdated
Wraps all incremental global_route invocations (e.g. post repair_design or recover_power iterations) in proper catch blocks. If global_route fails or becomes infeasible mid-flow, it writes out a deterministic 5_1_grt-failed.odb rather than crashing without diagnostic artifacts.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe force-pushed the feat-global-route-catch-failures branch from 3bd1f73 to 581b8fa Compare August 12, 2026 12:48
@oharboe

oharboe commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a helper procedure, run_global_route_and_catch_failures, in flow/scripts/global_route.tcl to wrap global routing executions and gracefully handle failures. The feedback suggests several improvements to this helper: using env_var_equals to safely check the GENERATE_ARTIFACTS_ON_FAILURE environment variable without throwing errors if it is undefined, preserving the original stack trace when rethrowing caught errors by passing $::errorInfo to error, and directly calling log_cmd write_sdc and log_cmd write_db to ensure failure artifacts are written regardless of other configuration settings.

Comment thread flow/scripts/global_route.tcl
Comment thread flow/scripts/global_route.tcl
Comment thread flow/scripts/global_route.tcl
@oharboe
oharboe requested a review from maliberty August 12, 2026 12:54
orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb
if { ![do_global_route $res_aware $use_cugr] } {
return

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange... why is global_route run after we have written the output, should the global route results below be thrown away?

}

puts "Estimate parasitics..."
log_cmd estimate_parasitics -global_routing

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected .sdc and .odb to be written out here... why isn't it?

@openroad-ci

openroad-ci commented Aug 12, 2026

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check.

Commit 2aa6b76 · Jenkins build #3 · Baseline: build

61 design(s) checked — 0 with regression(s), 0 without a comparable baseline.
Design Variant Verdict local vs inline passed / failed / missing
asap7/aes base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-block base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-mbff base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/cva6 base ✅ pass ✅ MATCH 12 / 0 / 0
asap7/ethmac base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ethmac_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd-ccs base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-alu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-cpu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i-mock-sram base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/uart base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes-hybrid base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/uart-blocks base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/aes base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/i2c-gpio-expander base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/spi base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/aes base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane133 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane136 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/black_parrot base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_be_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_fe_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_multi_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/dynamic_node base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/mempool_group base ✅ pass ✅ MATCH 12 / 0 / 0
nangate45/swerv base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/tinyRocket base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/chameleon base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/microwatt base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0

@maliberty
maliberty merged commit e7b134f into The-OpenROAD-Project:master Aug 12, 2026
8 checks passed
@oharboe

oharboe commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@maliberty Please read my comments: why isn't write_odb/sdc happening at the end in global_route.tcl like all other scripts?

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.

3 participants