Skip to content

Commit 1d1c421

Browse files
committed
global_route: catch failures to generate deterministic artifacts
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>
1 parent f9ec54a commit 1d1c421

1 file changed

Lines changed: 29 additions & 16 deletions

File tree

‎flow/scripts/global_route.tcl‎

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ proc global_route_helper { } {
2121
}
2222
}
2323

24+
proc run_global_route_and_catch_failures { args } {
25+
set result [catch { log_cmd global_route {*}$args } errMsg]
26+
27+
if { $result != 0 } {
28+
if { !$::env(GENERATE_ARTIFACTS_ON_FAILURE) } {
29+
orfs_write_db $::env(RESULTS_DIR)/5_1_grt-failed.odb
30+
error $errMsg
31+
}
32+
orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc
33+
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb
34+
return 0
35+
}
36+
return 1
37+
}
38+
2439
proc do_global_route { res_aware use_cugr } {
2540
set_grt_seed
2641
# CUGR runs a full 3D maze pass per iteration; use a tighter default.
@@ -32,7 +47,7 @@ proc global_route_helper { } {
3247
-congestion_report_file $::global_route_congestion_report] \
3348
$cong_iters $::env(GLOBAL_ROUTE_ARGS) {*}$res_aware {*}$use_cugr]
3449

35-
log_cmd global_route {*}$all_args
50+
return [run_global_route_and_catch_failures {*}$all_args]
3651
}
3752
set additional_args ""
3853
append_env_var additional_args dbProcessNode -db_process_node 1
@@ -41,15 +56,7 @@ proc global_route_helper { } {
4156

4257
log_cmd pin_access {*}$additional_args
4358

44-
set result [catch { do_global_route $res_aware $use_cugr } errMsg]
45-
46-
if { $result != 0 } {
47-
if { !$::env(GENERATE_ARTIFACTS_ON_FAILURE) } {
48-
orfs_write_db $::env(RESULTS_DIR)/5_1_grt-failed.odb
49-
error $errMsg
50-
}
51-
orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc
52-
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb
59+
if {![do_global_route $res_aware $use_cugr]} {
5360
return
5461
}
5562

@@ -80,8 +87,10 @@ proc global_route_helper { } {
8087
log_cmd global_route -start_incremental
8188
log_cmd detailed_placement
8289
# Route only the modified net by DPL
83-
log_cmd global_route -end_incremental {*}$res_aware \
84-
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt
90+
if {![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
91+
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt]} {
92+
return
93+
}
8594

8695
# Repair timing using global route parasitics
8796
puts "Repair setup and hold violations..."
@@ -97,8 +106,10 @@ proc global_route_helper { } {
97106
log_cmd detailed_placement
98107
log_cmd check_placement -verbose
99108
# Route only the modified net by DPL
100-
log_cmd global_route -end_incremental {*}$res_aware \
101-
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt
109+
if {![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
110+
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt]} {
111+
return
112+
}
102113

103114
log_cmd estimate_parasitics -global_routing
104115

@@ -123,8 +134,10 @@ proc global_route_helper { } {
123134
log_cmd global_route -start_incremental
124135
recover_power_helper
125136
# Route the modified nets by rsz journal restore
126-
log_cmd global_route -end_incremental {*}$res_aware \
127-
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_recover_power.rpt
137+
if {![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
138+
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_recover_power.rpt]} {
139+
return
140+
}
128141
}
129142

130143
if {

0 commit comments

Comments
 (0)