-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
50 lines (33 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
vlsi_dir=$(abspath .)
# minimal flow configuration variables
design ?= add8
pdk ?= sky130
tools ?= cm
env ?= bwrc
extra ?= # extra configs
args ?= # command-line args (including step flow control)
OBJ_DIR ?= $(vlsi_dir)/build-$(pdk)-$(tools)/$(design)
# non-overlapping default configs
ENV_YML ?= configs-env/$(env)-env.yml
PDK_CONF ?= configs-pdk/$(pdk).yml
TOOLS_CONF ?= configs-tool/$(tools).yml
# design-specific overrides of default configs
DESIGN_CONF ?= configs-design/$(design)/common.yml
DESIGN_PDK_CONF ?= configs-design/$(design)/$(pdk).yml
SIM_CONF ?= $(if $(findstring -rtl,$(MAKECMDGOALS)), configs-design/$(design)/sim-rtl.yml, \
$(if $(findstring -syn,$(MAKECMDGOALS)), configs-design/$(design)/sim-syn.yml, \
$(if $(findstring -par,$(MAKECMDGOALS)), configs-design/$(design)/sim-par.yml, )))
POWER_CONF ?= $(if $(findstring power-rtl,$(MAKECMDGOALS)), configs-design/$(design)/power-rtl-$(pdk).yml, \
$(if $(findstring power-syn,$(MAKECMDGOALS)), configs-design/$(design)/power-syn-$(pdk).yml, \
$(if $(findstring power-par,$(MAKECMDGOALS)), configs-design/$(design)/power-par-$(pdk).yml, )))
SRAM_CONF ?= $(OBJ_DIR)/sram_generator-output.json
PROJ_YMLS ?= $(PDK_CONF) $(TOOLS_CONF) $(DESIGN_CONF) $(DESIGN_PDK_CONF) $(SIM_CONF) $(POWER_CONF) $(extra)
HAMMER_EXTRA_ARGS ?= $(foreach conf, $(PROJ_YMLS), -p $(conf)) -p $(SRAM_CONF) $(args)
HAMMER_D_MK = $(OBJ_DIR)/hammer.d
build: $(HAMMER_D_MK)
$(HAMMER_D_MK): $(SRAM_CONF)
hammer-vlsi --obj_dir $(OBJ_DIR) -e $(ENV_YML) $(HAMMER_EXTRA_ARGS) build
-include $(HAMMER_D_MK)
$(SRAM_CONF) srams:
hammer-vlsi --obj_dir $(OBJ_DIR) -e $(ENV_YML) $(foreach conf, $(PROJ_YMLS), -p $(conf)) sram_generator
cp output.json $(SRAM_CONF)