Skip to content

Commit 47d1bff

Browse files
committed
fixed Tcl lint
Signed-off-by: Cho Moon <[email protected]>
2 parents 3688126 + 9638e97 commit 47d1bff

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

dev_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Set developer paths and environment variables here,
44
# user settings go in ./env.sh
55
function __setpaths() {
6-
local DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
6+
local DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")")
77
[ "$(find $DIR/dependencies -type f -user root)" ] && echo "WARNING! Files set up by sudo found in $DIR"
88
export PATH="$DIR/dependencies/bin:$PATH"
99
export CMAKE_INSTALL_RPATH=$DIR/dependencies/lib:$DIR/dependencies/lib64

env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22
function __setpaths() {
33
if [[ "$OSTYPE" == "darwin"* ]]; then
4-
DIR="$(dirname $(perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"))"
4+
DIR="$(dirname $(perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]:-${(%):-%x}}"))"
55
else
6-
DIR="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
6+
DIR="$(dirname $(readlink -f "${BASH_SOURCE[0]:-${(%):-%x}}"))"
77
fi
88

99
export OPENROAD=${DIR}/tools/OpenROAD

flow/scripts/load.tcl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ proc load_design { design_file sdc_file } {
1818
}
1919
}
2020
read_verilog $::env(RESULTS_DIR)/$design_file
21-
if { [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
22-
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
21+
if {
22+
[env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
23+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]
24+
} {
2325
link_design -hier $::env(DESIGN_NAME)
2426
} else {
2527
link_design $::env(DESIGN_NAME)
2628
}
2729
} elseif { $ext == ".odb" } {
28-
if { [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
29-
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
30+
if {
31+
[env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
32+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]
33+
} {
3034
read_db -hier $::env(RESULTS_DIR)/$design_file
3135
} else {
3236
read_db $::env(RESULTS_DIR)/$design_file

flow/scripts/synth.tcl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ json -o $::env(RESULTS_DIR)/mem.json
5656
exec -- $::env(PYTHON_EXE) $::env(SCRIPTS_DIR)/mem_dump.py \
5757
--max-bits $::env(SYNTH_MEMORY_MAX_BITS) $::env(RESULTS_DIR)/mem.json
5858

59-
if { [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
60-
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
59+
if {
60+
[env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
61+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]
62+
} {
6163
source $::env(SCRIPTS_DIR)/synth_wrap_operators.tcl
6264
} else {
6365
synth -top $::env(DESIGN_NAME) -run fine: {*}$synth_full_args

flow/scripts/variables.mk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,15 @@ vars:
215215
.PHONY: print-%
216216
# Print any variable, for instance: make print-DIE_AREA
217217
print-%:
218-
$(file >$(OBJECTS_DIR)/print_tmp_$$,$($*))
218+
# HERE BE DRAGONS!
219+
#
220+
# We have to use /tmp. $(OBJECTS_DIR) may not exist
221+
# at $(file) expansion time, which is before commands are run
222+
# here, so we can't mkdir -p $(OBJECTS_DIR) either
223+
#
224+
# We have to use $(file ...) because we want to be able
225+
# to print variables that contain newlines.
226+
$(file >/tmp/print_tmp$$,$($*))
219227
@echo -n "$* = "
220-
@cat $(OBJECTS_DIR)/print_tmp_$$
221-
@rm $(OBJECTS_DIR)/print_tmp_$$
228+
@cat /tmp/print_tmp$$
229+
@rm /tmp/print_tmp$$

0 commit comments

Comments
 (0)