Repository navigation
Conversation
This refactors global_route.tcl to only write out the .odb and .sdc artifacts once in the successful case, properly keeping the logic at the top-level script similarly to floorplan.tcl. It correctly propagates early failures by returning 0 from the helper proc rather than exiting, which allows OpenROAD to handle failures cleanly without crashing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request updates flow/scripts/global_route.tcl to return explicit status codes (0 for failure, 1 for success) from global_route_helper and conditionally executes the artifact writing steps based on this result. The reviewer noted that returning 0 on failure will cause the script to exit successfully without writing artifacts, silently ignoring the failure. It is recommended to throw an error instead to properly propagate the failure to the build system.
| 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 | ||
| } |
There was a problem hiding this comment.
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
|
never mind. It is fine the way it is. Ideally we could have simpler .tcl scripts and have more logic in C++ where we can have unit-tests for use-cases... Leave be for now. |
This refactors global_route.tcl to only write out the .odb and .sdc artifacts once in the successful case, properly keeping the logic at the top-level script similarly to floorplan.tcl. It correctly propagates early failures by returning 0 from the helper proc rather than exiting, which allows OpenROAD to handle failures cleanly without crashing.