From f45dc1cdbf5491af2255844f7fc4b59815c4c375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 17 Jan 2025 12:27:47 +0100 Subject: [PATCH 1/2] logging: added sceonds to log_cmd if a command takes more than 5 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- flow/scripts/util.tcl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index 1438b8ea07..ec6c2f6a34 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -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 {} { From c6ace0766cfe27c772ea7cf8d5a892cdf7343eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 17 Jan 2025 12:28:06 +0100 Subject: [PATCH 2/2] open: more log_cmd added for long running commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- flow/scripts/open.tcl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flow/scripts/open.tcl b/flow/scripts/open.tcl index 4ef30068e4..0873afab98 100644 --- a/flow/scripts/open.tcl +++ b/flow/scripts/open.tcl @@ -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} { @@ -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 }