From d4566dda7ca96463b6e0afac53b8f16bbe974c58 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 26 Apr 2022 18:58:41 +0200 Subject: [PATCH] Small QOL changes (#1068) - Change 'Running Resizer ..' to 'Running Placement Resizer..' and other equivalent changes - add the piping part to run_openroad_script function allowing for logging the log file of the openroad script in openlane's run cmds.log - report the relative log file path on openroad script crash - adjust "skipping" messages --- scripts/tcl_commands/cts.tcl | 4 ++-- scripts/tcl_commands/placement.tcl | 4 ++-- scripts/tcl_commands/routing.tcl | 4 ++-- scripts/utils/utils.tcl | 7 ++++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/tcl_commands/cts.tcl b/scripts/tcl_commands/cts.tcl index 2c0a39196..3764adcd5 100755 --- a/scripts/tcl_commands/cts.tcl +++ b/scripts/tcl_commands/cts.tcl @@ -101,7 +101,7 @@ proc run_resizer_timing {args} { if { $::env(PL_RESIZER_TIMING_OPTIMIZATIONS) == 1} { increment_index TIMER::timer_start - puts_info "Running Resizer Timing Optimizations..." + puts_info "Running Placement Resizer Timing Optimizations..." set ::env(SAVE_DEF) [index_file $::env(cts_tmpfiles)/resizer_timing.def] set ::env(SAVE_SDC) [index_file $::env(cts_tmpfiles)/resizer_timing.sdc] run_openroad_script $::env(SCRIPTS_DIR)/openroad/resizer_timing.tcl -indexed_log [index_file $::env(cts_logs)/resizer.log] @@ -119,7 +119,7 @@ proc run_resizer_timing {args} { } } else { - puts_info "Skipping Resizer Timing Optimizations." + puts_info "Skipping Placement Resizer Timing Optimizations." } } diff --git a/scripts/tcl_commands/placement.tcl b/scripts/tcl_commands/placement.tcl index 626bbb72e..79a223044 100755 --- a/scripts/tcl_commands/placement.tcl +++ b/scripts/tcl_commands/placement.tcl @@ -167,7 +167,7 @@ proc run_resizer_design {args} { if { $::env(PL_RESIZER_DESIGN_OPTIMIZATIONS) == 1} { increment_index TIMER::timer_start - puts_info "Running Resizer Design Optimizations..." + puts_info "Running Placement Resizer Design Optimizations..." set ::env(SAVE_DEF) [index_file $::env(placement_tmpfiles)/resizer.def] set ::env(SAVE_SDC) [index_file $::env(placement_tmpfiles)/resizer.sdc] run_openroad_script $::env(SCRIPTS_DIR)/openroad/resizer.tcl -indexed_log [index_file $::env(placement_logs)/resizer.log] @@ -184,7 +184,7 @@ proc run_resizer_design {args} { logic_equiv_check -rhs $::env(PREV_NETLIST) -lhs $::env(CURRENT_NETLIST) } } else { - puts_info "Skipping Resizer Design Optimizations." + puts_info "Skipping Placement Resizer Design Optimizations." } } diff --git a/scripts/tcl_commands/routing.tcl b/scripts/tcl_commands/routing.tcl index 6cd74e82c..42a8cf173 100755 --- a/scripts/tcl_commands/routing.tcl +++ b/scripts/tcl_commands/routing.tcl @@ -517,7 +517,7 @@ proc run_resizer_timing_routing {args} { if { $::env(GLB_RESIZER_TIMING_OPTIMIZATIONS) == 1} { increment_index TIMER::timer_start - puts_info "Running Resizer Timing Optimizations..." + puts_info "Running Global Routing Resizer Timing Optimizations..." set ::env(SAVE_DEF) [index_file $::env(routing_tmpfiles)/resizer_timing.def] set ::env(SAVE_SDC) [index_file $::env(routing_tmpfiles)/resizer_timing.sdc] run_openroad_script $::env(SCRIPTS_DIR)/openroad/resizer_routing_timing.tcl -indexed_log [index_file $::env(routing_logs)/resizer.log] @@ -535,7 +535,7 @@ proc run_resizer_timing_routing {args} { } } else { - puts_info "Skipping Resizer Timing Optimizations." + puts_info "Skipping Global Routing Resizer Timing Optimizations." } } diff --git a/scripts/utils/utils.tcl b/scripts/utils/utils.tcl index ab703506c..dec859158 100755 --- a/scripts/utils/utils.tcl +++ b/scripts/utils/utils.tcl @@ -187,9 +187,9 @@ proc run_openroad_script {args} { set script [lindex $args 0] if { [info exists flag_map(-gui)] } { - set args "$::env(OPENROAD_BIN) -gui $script" + set args "$::env(OPENROAD_BIN) -gui $script |& tee $::env(TERMINAL_OUTPUT) $arg_values(-indexed_log)" } else { - set args "$::env(OPENROAD_BIN) -exit $script" + set args "$::env(OPENROAD_BIN) -exit $script |& tee $::env(TERMINAL_OUTPUT) $arg_values(-indexed_log)" } if { ! [catch { set cmd_log_file [open $::env(RUN_DIR)/cmds.log a+] } ]} { @@ -202,7 +202,7 @@ proc run_openroad_script {args} { puts_verbose "Executing OpenROAD with script '$script_relative'..." - set exit_code [catch {exec {*}$args |& tee $::env(TERMINAL_OUTPUT) $arg_values(-indexed_log)} error_msg] + set exit_code [catch {exec {*}$args } error_msg] if { $exit_code } { set tool [string range $args 0 [string first " " $args]] @@ -210,6 +210,7 @@ proc run_openroad_script {args} { puts_err "$print_error_msg" puts_err "Exit code: $exit_code" + puts_err "full log: [relpath $::env(PWD) $arg_values(-indexed_log)]" puts_err "Last 10 lines:\n[exec tail -10 << $error_msg]\n" save_state