Skip to content

Commit 82769f7

Browse files
committed
variables: DESIGN_DIR is overrideable
Plus some driveby cleanup and making things a bit more consistent. Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 2a31587 commit 82769f7

File tree

10 files changed

+11
-18
lines changed

10 files changed

+11
-18
lines changed

flow/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ DESIGN_CONFIG ?= ./designs/nangate45/gcd/config.mk
8787
export DESIGN_CONFIG
8888
include $(DESIGN_CONFIG)
8989

90-
export DESIGN_DIR = $(dir $(DESIGN_CONFIG))
90+
export DESIGN_DIR ?= $(dir $(DESIGN_CONFIG))
9191

9292
# default value "base" is duplicated from variables.yaml because we need it
9393
# earlier in the flow for BLOCKS. BLOCKS is a feature specific to the

flow/designs/asap7/mock-array/Element/config.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ export PLACE_DENSITY = 0.82
1313
export CORE_AREA = $(shell \
1414
export MOCK_ARRAY_TABLE="$(MOCK_ARRAY_TABLE)" && \
1515
export MOCK_ARRAY_SCALE="$(MOCK_ARRAY_SCALE)" && \
16-
cd $(dir $(DESIGN_CONFIG))/../ && \
16+
cd $(DESIGN_DIR)/../ && \
1717
python3 -c "import config; print(f'{config.ce_margin_x} {config.ce_margin_y} {config.ce_width - config.ce_margin_x} {config.ce_height - config.ce_margin_y}')")
1818

1919
export DIE_AREA = $(shell \
2020
export MOCK_ARRAY_TABLE="$(MOCK_ARRAY_TABLE)" && \
2121
export MOCK_ARRAY_SCALE="$(MOCK_ARRAY_SCALE)" && \
22-
cd $(dir $(DESIGN_CONFIG))/../ && \
22+
cd $(DESIGN_DIR)/../ && \
2323
python3 -c "import config; print(f'0 0 {config.ce_width} {config.ce_height}')")
2424

2525
export IO_CONSTRAINTS = designs/asap7/mock-array/Element/io.tcl

flow/designs/asap7/mock-array/config.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export PLACE_DENSITY = 0.30
1414
export CORE_AREA = $(shell \
1515
export MOCK_ARRAY_TABLE="$(MOCK_ARRAY_TABLE)" && \
1616
export MOCK_ARRAY_SCALE="$(MOCK_ARRAY_SCALE)" && \
17-
cd $(dir $(DESIGN_CONFIG)) && \
17+
cd $(DESIGN_DIR) && \
1818
python3 -c "import config ; print(f'{config.margin_x} {config.margin_y} {config.core_width + config.margin_x} {config.core_height + config.margin_y}')")
1919

2020
export DIE_AREA = $(shell \
2121
export MOCK_ARRAY_TABLE="$(MOCK_ARRAY_TABLE)" && \
2222
export MOCK_ARRAY_SCALE="$(MOCK_ARRAY_SCALE)" && \
23-
cd $(dir $(DESIGN_CONFIG)) && \
23+
cd $(DESIGN_DIR) && \
2424
python3 -c "import config; print(f'{0} {0} {config.die_width} {config.die_height}')")
2525

2626
export MACRO_PLACE_HALO = 0 2.16

flow/designs/gf12/ca53/config.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export IO_CONSTRAINTS = $(DESIGN_HOME)/$(PLATFORM)/ca53/io.tcl
5252

5353
export MACRO_PLACE_HALO = 7 7
5454

55-
export MACRO_WRAPPERS = $(dir $(DESIGN_CONFIG))/wrappers.tcl
55+
export MACRO_WRAPPERS = $(DESIGN_DIR)/wrappers.tcl
5656

5757
#export MAX_ROUTING_LAYER = H2
58-
export FASTROUTE_TCL = $(dir $(DESIGN_CONFIG))/fastroute.tcl
58+
export FASTROUTE_TCL = $(DESIGN_DIR)/fastroute.tcl
5959
#
6060
ifeq ($(USE_FILL),1)
6161
export DESIGN_TYPE = CELL

flow/designs/gf55/aes/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
DESIGN_DIR := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
3-
42
export DESIGN_NICKNAME = aes
53
export DESIGN_NAME = aes_cipher_top
64
export PLATFORM = gf55

flow/designs/intel16/aes/config.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
DESIGN_DIR := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
21
DESIGN_PDK_HOME := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
32

43
export DESIGN_NICKNAME = aes

flow/designs/intel16/ibex/config.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
DESIGN_DIR := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
21
DESIGN_PDK_HOME := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
32

43
export DESIGN_NICKNAME = ibex

flow/designs/intel16/jpeg/config.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
DESIGN_DIR := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
21
DESIGN_PDK_HOME := $(realpath $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
32

43
export DESIGN_NICKNAME = jpeg

flow/util/genMassive.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def writeConfigs(CurAttrs, CurChunkNum):
332332

333333
fo = open("%s/%s" % (CurChunkDir, fileName), "w")
334334

335-
fo.write("include $(realpath $(dir $(DESIGN_CONFIG))../../)/config.mk\n")
335+
fo.write("include $(realpath $(DESIGN_DIR)../../)/config.mk\n")
336336
fo.write("\n")
337337
fo.write("FLOW_VARIANT = %s\n" % (variantName))
338338
fo.write("\n")
@@ -363,8 +363,7 @@ def writeConfigs(CurAttrs, CurChunkNum):
363363
fOutSdc.write(filedata)
364364
fOutSdc.close()
365365
fo.write(
366-
"export SDC_FILE = $(dir $(DESIGN_CONFIG))/constraint-DoE-%s.sdc\n"
367-
% variantName
366+
"export SDC_FILE = $(DESIGN_DIR)/constraint-DoE-%s.sdc\n" % variantName
368367
)
369368

370369
if CurAbcClkPeriod != "empty":
@@ -411,8 +410,7 @@ def writeConfigs(CurAttrs, CurChunkNum):
411410
or CurGrSeed != "empty"
412411
):
413412
fo.write(
414-
"export FASTROUTE_TCL = $(dir $(DESIGN_CONFIG))/fastroute-DoE-%s.tcl"
415-
% variantName
413+
"export FASTROUTE_TCL = $(DESIGN_DIR)/fastroute-DoE-%s.tcl" % variantName
416414
)
417415

418416
if CurPlatform in PUBLIC:

flow/util/utils.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata: finish
1010
| tee $(REPORTS_DIR)/gen-metrics-$(FLOW_VARIANT)-check.log
1111
@$(UTILS_DIR)/checkMetadata.py \
1212
-m $(REPORTS_DIR)/metadata-$(FLOW_VARIANT).json \
13-
-r $(dir $(DESIGN_CONFIG))rules-$(FLOW_VARIANT).json 2>&1 \
13+
-r $(DESIGN_DIR)/rules-$(FLOW_VARIANT).json 2>&1 \
1414
| tee $(REPORTS_DIR)/metadata-$(FLOW_VARIANT)-check.log
1515

1616
.PHONY: clean_metadata

0 commit comments

Comments
 (0)