Skip to content

Commit

Permalink
Merge pull request #2673 from Pinata-Consulting/make-issue-tcl-fixes
Browse files Browse the repository at this point in the history
Make issue tcl fixes
  • Loading branch information
maliberty authored Jan 13, 2025
2 parents d331b37 + b9498cf commit c6905f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
13 changes: 9 additions & 4 deletions flow/test/test_make_issue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# make issue smoketest
set -ue -o pipefail

testname=Element
# Pick a design that builds quickly and has
# has some interesting "make issue" features to test,
# such as ADDITIONAL_FILES

make DESIGN_CONFIG=designs/asap7/mock-array/$testname/config.mk floorplan
make ISSUE_TAG=tag DESIGN_CONFIG=designs/asap7/mock-array/$testname/config.mk io_placement_random_issue
make DESIGN_CONFIG=designs/asap7/mock-array/Element/config.mk floorplan
make ISSUE_TAG=tag DESIGN_CONFIG=designs/asap7/mock-array/Element/config.mk io_placement_random_issue
# io placement needs ADDITIONAL_FILES to work, so not a random test
test_archive=io_placement_random_tag.tar.gz
ls -l $test_archive
echo "Testing $test_archive"
Expand All @@ -14,6 +17,8 @@ rm -rf results/make-issue/
mkdir -p results/make-issue/
cd results/make-issue/
tar --strip-components=1 -xzf ../../$test_archive
runme=run-me-mock-array_$testname-asap7-base.sh
runme=run-me-mock-array_Element-asap7-base.sh
sed -i 's/openroad -no_init/openroad -exit -no_init/g' $runme
./$runme
# check for basic syntax errors
openroad -exit -no_init vars-mock-array_Element-asap7-base.tcl
11 changes: 2 additions & 9 deletions flow/util/generate-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ while read -r VAR; do
# skip variables that match the exclude patterns
continue
fi
# handle special case where the variable needs to be splitted in Tcl code
if [[ "${name}" == "GND_NETS_VOLTAGES" || "${name}" == "PWR_NETS_VOLTAGES" ]]; then
echo "export ${name}='${value}'" >> $1.sh
echo "set env(${name}) ${value}" >> $1.tcl
echo "set env ${name} ${value}" >> $1.gdb
continue
fi

# convert absolute paths if possible to use FLOW_HOME variable
if [[ "${name}" == *"SCRIPTS_DIR"* ]]; then
Expand All @@ -63,8 +56,8 @@ while read -r VAR; do

echo "export ${name}=\"${value}\"" >> $1.sh
if [[ "${value}" == *'$'* ]]; then
echo "set env ${name} $(sed -e 's,${FLOW_HOME},getenv("FLOW_HOME"),' <<< ${value})" >> $1.gdb
echo "set env(${name}) \"$(sed -e 's,${FLOW_HOME},$::env(FLOW_HOME),' <<< ${value})\"" >> $1.tcl
echo "set env ${name} $(sed -e 's,${FLOW_HOME},getenv("FLOW_HOME"),g' <<< ${value})" >> $1.gdb
echo "set env(${name}) \"$(sed -e 's,${FLOW_HOME},$::env(FLOW_HOME),g' <<< ${value})\"" >> $1.tcl
else
echo "set env(${name}) \"${value}\"" >> $1.tcl
echo "set env ${name} ${value}" >> $1.gdb
Expand Down
2 changes: 1 addition & 1 deletion flow/util/utils.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ define \n
endef

define get_variables
$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% %TIME_CMD% KLAYOUT% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS%, $(V)), $V$ )))
$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% %TIME_CMD% KLAYOUT% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
endef

export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment% default automatic)
Expand Down

0 comments on commit c6905f5

Please sign in to comment.