Skip to content

Commit 3bd1f73

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 3bd1f73

1 file changed

Lines changed: 35 additions & 16 deletions

File tree

‎flow/scripts/global_route.tcl‎

Lines changed: 35 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+
log_cmd write_db $::env(RESULTS_DIR)/5_1_grt-failed.odb
30+
error $errMsg
31+
}
32+
log_cmd write_sdc -no_timestamp $::env(RESULTS_DIR)/5_1_grt.sdc
33+
log_cmd 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,12 @@ 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 {
91+
![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
92+
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt]
93+
} {
94+
return
95+
}
8596

8697
# Repair timing using global route parasitics
8798
puts "Repair setup and hold violations..."
@@ -97,8 +108,12 @@ proc global_route_helper { } {
97108
log_cmd detailed_placement
98109
log_cmd check_placement -verbose
99110
# 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
111+
if {
112+
![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
113+
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt]
114+
} {
115+
return
116+
}
102117

103118
log_cmd estimate_parasitics -global_routing
104119

@@ -123,8 +138,12 @@ proc global_route_helper { } {
123138
log_cmd global_route -start_incremental
124139
recover_power_helper
125140
# 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
141+
if {
142+
![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
143+
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_recover_power.rpt]
144+
} {
145+
return
146+
}
128147
}
129148

130149
if {

0 commit comments

Comments
 (0)