Skip to content

Commit 194d6b4

Browse files
authored
Merge pull request #2514 from Pinata-Consulting/variables-global-route-args
Variables global route args
2 parents 9f3ad44 + abf10b4 commit 194d6b4

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

flow/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ export UTILS_DIR ?= $(FLOW_HOME)/util
160160
export SCRIPTS_DIR ?= $(FLOW_HOME)/scripts
161161
export TEST_DIR ?= $(FLOW_HOME)/test
162162

163-
$(foreach line,$(shell $(SCRIPTS_DIR)/defaults.py),$(eval export $(line)))
163+
# __SPACE__ is a workaround for whitespace hell in "foreach"; there
164+
# is no way to escape space in defaults.py and get "foreach" to work.
165+
$(foreach line,$(shell $(SCRIPTS_DIR)/defaults.py),$(eval export $(subst __SPACE__, ,$(line))))
164166

165167
PUBLIC=nangate45 sky130hd sky130hs asap7 ihp-sg13g2 gf180
166168

flow/scripts/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
for key, value in data.items():
1313
if value.get("default", None) is None:
1414
continue
15-
print(f'{key}?={value["default"]}')
15+
print(f'export {key}?={str(value["default"]).replace(" ", "__SPACE__")}')

flow/scripts/global_route.tcl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ proc global_route_helper {} {
1212

1313
fast_route
1414

15-
# The default behavior if the user didn't specify GLOBAL_ROUTE_ARGS is to
16-
# produce a drc report every 5 iterations.
17-
#
18-
# If GLOBAL_ROUTE_ARGS is specified, then we do only what the
19-
# GLOBAL_ROUTE_ARGS specifies.
2015
proc do_global_route {} {
21-
set all_args [concat [list -congestion_report_file $::global_route_congestion_report] \
22-
[expr {[env_var_exists_and_non_empty GLOBAL_ROUTE_ARGS] ? $::env(GLOBAL_ROUTE_ARGS) : \
23-
{-congestion_iterations 30 -congestion_report_iter_step 5 -verbose}}]]
16+
set all_args [concat [list \
17+
-congestion_report_file $::global_route_congestion_report] \
18+
$::env(GLOBAL_ROUTE_ARGS)]
2419

2520
log_cmd global_route {*}$all_args
2621
}

flow/scripts/variables.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,3 +604,9 @@ ABSTRACT_SOURCE:
604604
Which .odb file to use to create abstract
605605
stages:
606606
- generate_abstract
607+
GLOBAL_ROUTE_ARGS:
608+
description: >
609+
Replaces default arguments for global route.
610+
stages:
611+
- grt
612+
default: -congestion_iterations 30 -congestion_report_iter_step 5 -verbose

0 commit comments

Comments
 (0)