Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#2007 from Pinata-Consulting/s…
Browse files Browse the repository at this point in the history
…cripts-log-cmd-util

scripts: introduce log_cmd utility for consistency and less reptition
  • Loading branch information
maliberty authored May 14, 2024
2 parents 4f5383b + f2b2d99 commit aa026d3
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 22 deletions.
4 changes: 1 addition & 3 deletions flow/scripts/cts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ if {[info exist ::env(CTS_ARGS)]} {
set cts_args $::env(CTS_ARGS)
}

puts "clock_tree_synthesis [join $cts_args " "]"

clock_tree_synthesis {*}$cts_args
log_cmd clock_tree_synthesis {*}$cts_args

if {[info exist ::env(CTS_SNAPSHOTS)]} {
save_progress 4_1_pre_repair_clock_nets
Expand Down
4 changes: 1 addition & 3 deletions flow/scripts/detail_route.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ set all_args [concat [list \
-output_maze $::env(RESULTS_DIR)/maze.log] \
$arguments]

puts "detailed_route [join $all_args " "]"

detailed_route {*}$all_args
log_cmd detailed_route {*}$all_args

if { [info exists ::env(POST_DETAIL_ROUTE_TCL)] } {
source $::env(POST_DETAIL_ROUTE_TCL)
Expand Down
4 changes: 1 addition & 3 deletions flow/scripts/global_place.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ proc do_placement {place_density global_placement_args} {
lappend all_args {*}$::env(GLOBAL_PLACEMENT_ARGS)
}

puts "global_placement [join $all_args " "]"

global_placement {*}$all_args
log_cmd global_placement {*}$all_args
}

set result [catch {do_placement $place_density $global_placement_args} errMsg]
Expand Down
4 changes: 1 addition & 3 deletions flow/scripts/global_route.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ proc do_global_route {} {
[expr {[info exists ::env(GLOBAL_ROUTE_ARGS)] ? $::env(GLOBAL_ROUTE_ARGS) : \
{-congestion_iterations 30 -congestion_report_iter_step 5 -verbose}}]]

puts "global_route [join $all_args " "]"

global_route {*}$all_args
log_cmd global_route {*}$all_args
}

set result [catch {do_global_route} errMsg]
Expand Down
10 changes: 4 additions & 6 deletions flow/scripts/gui.tcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source $::env(SCRIPTS_DIR)/util.tcl
# Read liberty files
source $::env(SCRIPTS_DIR)/read_liberty.tcl

Expand Down Expand Up @@ -45,14 +46,11 @@ if {![info exist ::env(GUI_NO_TIMING)]} {
}

if {$design_stage >= 6 && [file exist $::env(RESULTS_DIR)/6_final.spef]} {
puts "Loading spef"
read_spef $::env(RESULTS_DIR)/6_final.spef
log_cmd read_spef $::env(RESULTS_DIR)/6_final.spef
} elseif {$design_stage >= 5} {
puts "Estimating parasitics -global_routing"
estimate_parasitics -global_routing
log_cmd estimate_parasitics -global_routing
} elseif {$design_stage >= 3} {
puts "Estimating parasitics -placement"
estimate_parasitics -placement
log_cmd estimate_parasitics -placement
}

# Cleanup temporary variables
Expand Down
3 changes: 1 addition & 2 deletions flow/scripts/io_placement_util.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ if {[info exists ::env(FLOORPLAN_DEF)]} {
set args [list -hor_layer $::env(IO_PLACER_H) \
-ver_layer $::env(IO_PLACER_V) \
{*}$::env(PLACE_PINS_ARGS)]
puts "place_pins [join $args " "]"
place_pins {*}$args
log_cmd place_pins {*}$args
}
2 changes: 2 additions & 0 deletions flow/scripts/load.tcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source $::env(SCRIPTS_DIR)/util.tcl

source $::env(SCRIPTS_DIR)/report_metrics.tcl

proc load_design {design_file sdc_file} {
Expand Down
3 changes: 1 addition & 2 deletions flow/scripts/macro_place_util.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ if {[find_macros] != ""} {
set all_args $::env(RTLMP_ARGS)
}

puts "rtl_macro_placer [join $all_args " "]"
rtl_macro_placer {*}$all_args
log_cmd rtl_macro_placer {*}$all_args
} else {
macro_placement \
-halo $::env(MACRO_PLACE_HALO) \
Expand Down
4 changes: 4 additions & 0 deletions flow/scripts/util.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
proc log_cmd {cmd args} {
puts "$cmd [join $args " "]"
$cmd {*}$args
}

0 comments on commit aa026d3

Please sign in to comment.