Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions flow/scripts/global_route.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ proc global_route_helper { } {
log_cmd pin_access {*}$additional_args

if { ![do_global_route $res_aware $use_cugr] } {
return
return 0
}

set_placement_padding -global \
Expand Down Expand Up @@ -91,7 +91,7 @@ proc global_route_helper { } {
![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt]
} {
return
return 0
}

# Repair timing using global route parasitics
Expand All @@ -112,7 +112,7 @@ proc global_route_helper { } {
![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt]
} {
return
return 0
}

log_cmd estimate_parasitics -global_routing
Expand Down Expand Up @@ -142,7 +142,7 @@ proc global_route_helper { } {
![run_global_route_and_catch_failures -end_incremental {*}$res_aware \
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_recover_power.rpt]
} {
return
return 0
}
}

Expand All @@ -165,11 +165,13 @@ proc global_route_helper { } {
# Write SDC to results with updated clock periods that are just failing.
# Use make target update_sdc_clock to install the updated sdc.
source [file join $::env(SCRIPTS_DIR) "write_ref_sdc.tcl"]

return 1
}

if { [global_route_helper] } {
write_guides $::env(RESULTS_DIR)/route.guide
source_step_tcl POST GLOBAL_ROUTE
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb
orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc
}
Comment on lines +172 to 177

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.

critical

If global_route_helper returns 0 (indicating a failure), the script currently skips writing the successful artifacts but exits with a successful status code (0). This will cause the build system or Makefile to silently ignore the failure and proceed to subsequent steps.

To properly propagate the failure and terminate the script with a non-zero exit code, we should throw an error when global_route_helper returns 0.

if { ![global_route_helper] } {
  error "Global route failed"
}

write_guides $::env(RESULTS_DIR)/route.guide
source_step_tcl POST GLOBAL_ROUTE
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb
orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc


global_route_helper
Loading