-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile.common
111 lines (100 loc) · 4.14 KB
/
Makefile.common
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# need to set the shell so that source works
export SHELL := /bin/bash
export CURR_DESIGN_DIR ?= $(CURR)/..
export CURR_VSRC_DIR ?= $(CURR_DESIGN_DIR)/v
export CURR_CSRC_DIR ?= $(CURR_DESIGN_DIR)/src
export CURR_INCLUDE_DIR ?= $(CURR_DESIGN_DIR)/include
export CURR_TCL_DIR ?= $(CURR_DESIGN_DIR)/tcl
export CURR_XDC_DIR ?= $(CURR_DESIGN_DIR)/xdc
export IMPORT_DIR ?= $(TOP)/import
export COSIM_DIR ?= $(TOP)/cosim
export COSIM_MK_DIR ?= $(COSIM_DIR)/mk
export COSIM_VSRC_DIR ?= $(COSIM_DIR)/v
export COSIM_CSRC_DIR ?= $(COSIM_DIR)/src
export COSIM_INCLUDE_DIR ?= $(COSIM_DIR)/include
export COSIM_PY_DIR ?= $(COSIM_DIR)/py
export COSIM_TCL_DIR ?= $(COSIM_DIR)/tcl
export COSIM_XDC_DIR ?= $(COSIM_DIR)/xdc
export COSIM_IMPORT_DIR ?= $(IMPORT_DIR)
export COSIM_INSTALL_DIR ?= $(COSIM_DIR)/install
export COSIM_WORK_DIR ?= $(COSIM_INSTALL_DIR)/work
export SOFTWARE_DIR ?= $(TOP)/software
export SOFTWARE_MK_DIR ?= $(SOFTWARE_DIR)/mk
export SOFTWARE_VSRC_DIR ?= $(SOFTWARE_DIR)/v
export SOFTWARE_CSRC_DIR ?= $(SOFTWARE_DIR)/src
export SOFTWARE_INCLUDE_DIR ?= $(SOFTWARE_DIR)/include
export SOFTWARE_PY_DIR ?= $(SOFTWARE_DIR)/py
export SOFTWARE_TCL_DIR ?= $(SOFTWARE_DIR)/tcl
export SOFTWARE_XDC_DIR ?= $(SOFTWARE_DIR)/xdc
export SOFTWARE_IMPORT_DIR ?= $(IMPORT_DIR)
export SOFTWARE_INSTALL_DIR ?= $(SOFTWARE_DIR)/install
export SOFTWARE_WORK_DIR ?= $(SOFTWARE_INSTALL_DIR)/work
export BLACKPARROT_DIR ?= $(COSIM_IMPORT_DIR)/black-parrot
export BLACKPARROT_TOOLS_DIR ?= $(COSIM_IMPORT_DIR)/black-parrot-tools
export BLACKPARROT_SUB_DIR ?= $(COSIM_IMPORT_DIR)/black-parrot-subsystems
export BLACKPARROT_SDK_DIR ?= $(SOFTWARE_IMPORT_DIR)/black-parrot-sdk
export PLATFORM ?= zynqparrot
export BP_FE_DIR ?= $(BLACKPARROT_DIR)/bp_fe
export BP_COMMON_DIR ?= $(BLACKPARROT_DIR)/bp_common
export BP_BE_DIR ?= $(BLACKPARROT_DIR)/bp_be
export BP_ME_DIR ?= $(BLACKPARROT_DIR)/bp_me
export BP_TOP_DIR ?= $(BLACKPARROT_DIR)/bp_top
export BP_EXTERNAL_DIR ?= $(BLACKPARROT_DIR)/external
export BP_BASEJUMP_STL_DIR ?= $(BP_EXTERNAL_DIR)/basejump_stl
export HARDFLOAT_DIR ?= $(BP_EXTERNAL_DIR)/HardFloat
export BASEJUMP_STL_DIR ?= $(BP_BASEJUMP_STL_DIR)
# Override to zynq-parrot version
export BP_TOOLS_DIR ?= $(BLACKPARROT_TOOLS_DIR)
export BP_SDK_DIR ?= $(BLACKPARROT_SDK_DIR)
export BP_SDK_INSTALL_DIR ?= $(BP_SDK_DIR)/install
export BP_SDK_LIB_DIR ?= $(BP_SDK_INSTALL_DIR)/lib
export BSG_MANYCORE_DIR ?= $(COSIM_IMPORT_DIR)/bsg_manycore
export BSG_MANYCORE_SOFTWARE_DIR ?= $(BSG_MANYCORE_DIR)/software
export BSG_REPLICANT_DIR ?= $(SOFTWARE_IMPORT_DIR)/bsg_replicant
export BSG_MANYCORE_RTL_DIR ?= $(BSG_MANYCORE_DIR)/v
ifeq (,$(wildcard $(BSG_CADENV_DIR)/cadenv.mk))
export IGNORE_CADENV ?= 1
else
export CAD_DIR ?= $(BSG_CADENV_DIR)
endif
# TODO: Check verilator version
ifeq ($(shell /usr/bin/arch),armv7l)
export ARM=1
export VERILATOR=/usr/local/bin/verilator
else ifeq ($(shell /usr/bin/arch),aarch64)
export ARM=1
export VERILATOR=/usr/local/bin/verilator
else
-include $(BSG_CADENV_DIR)/cadenv.mk
export ARM=0
export VERILATOR ?= verilator
endif
export VIVADO ?= vivado
export PETALINUX ?= petalinux
export VCS ?= vcs
export _DVE ?= dve
export XRUN ?= xrun
export XMSIM ?= xmsim
export SIMVISION ?= simvision
export GCC ?= g++
export PYTHON ?= PYTHONPATH=$(COSIM_PY_DIR) python
export PYTHON2 ?= PYTHONPATH=$(COSIM_PY_DIR) python2
export PYTHON3 ?= PYTHONPATH=$(COSIM_PY_DIR) python3
export TR ?= tr
export SED ?= sed
export GREP ?= grep
export CAT ?= cat
export WGET ?= wget
export TAR ?= tar
export BASE64 ?= base64
export XXD ?= xxd
export AWK ?= awk
export ECHO ?= echo
export PATH := $(BP_TOOLS_DIR)/install/bin:$(BP_SDK_DIR)/install/bin:$(COSIM_PY_DIR):$(PATH)
# Makefile functions
define upper
$(shell echo $(1) | $(TR) a-z A-Z)
endef
define lower
$(shell echo $(1) | $(TR) A-Z a-z)
endef