Skip to content

Commit

Permalink
Merge pull request #2683 from Pinata-Consulting/logging-seconds
Browse files Browse the repository at this point in the history
Logging seconds
  • Loading branch information
maliberty authored Jan 17, 2025
2 parents 17fcb97 + c6ace07 commit 1c517f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 6 additions & 6 deletions flow/scripts/open.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ source $::env(SCRIPTS_DIR)/read_liberty.tcl
# Read def
if {[env_var_exists_and_non_empty DEF_FILE]} {
# Read lef
read_lef $::env(TECH_LEF)
read_lef $::env(SC_LEF)
log_cmd read_lef $::env(TECH_LEF)
log_cmd read_lef $::env(SC_LEF)
if {[env_var_exists_and_non_empty ADDITIONAL_LEFS]} {
foreach lef $::env(ADDITIONAL_LEFS) {
read_lef $lef
log_cmd read_lef $lef
}
}
set input_file $::env(DEF_FILE)
read_def $input_file
log_cmd read_def $input_file
} else {
set input_file $::env(ODB_FILE)
read_db $input_file
log_cmd read_db $input_file
}

proc read_timing {input_file} {
Expand All @@ -27,7 +27,7 @@ proc read_timing {input_file} {
if {$sdc_file == ""} {
set sdc_file $::env(SDC_FILE)
}
read_sdc $sdc_file
log_cmd read_sdc $sdc_file
if [file exists $::env(PLATFORM_DIR)/derate.tcl] {
source $::env(PLATFORM_DIR)/derate.tcl
}
Expand Down
8 changes: 7 additions & 1 deletion flow/scripts/util.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
proc log_cmd {cmd args} {
# log the command, escape arguments with spaces
puts "$cmd [join [lmap arg $args {expr {[string match {* *} $arg] ? "\"$arg\"" : $arg}}] " "]"
puts -nonewline "$cmd[join [lmap arg $args {expr {[string match {* *} $arg] ? " \"$arg\"" : " $arg"}}] ""]"
set start [clock seconds]
$cmd {*}$args
set time [expr {[clock seconds] - $start}]
if {$time >= 5} {
puts -nonewline " ($time seconds)"
}
puts ""
}

proc fast_route {} {
Expand Down

0 comments on commit 1c517f9

Please sign in to comment.