Skip to content

Commit

Permalink
Small QOL changes (The-OpenROAD-Project#1068)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
kareefardi authored Apr 26, 2022
1 parent c29cdb4 commit d4566dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/tcl_commands/cts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -119,7 +119,7 @@ proc run_resizer_timing {args} {
}

} else {
puts_info "Skipping Resizer Timing Optimizations."
puts_info "Skipping Placement Resizer Timing Optimizations."
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/tcl_commands/placement.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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."
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/tcl_commands/routing.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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."
}
}

Expand Down
7 changes: 4 additions & 3 deletions scripts/utils/utils.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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+] } ]} {
Expand All @@ -202,14 +202,15 @@ 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]]
set print_error_msg "during executing openroad script $script"

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
Expand Down

0 comments on commit d4566dd

Please sign in to comment.