1 |
542 |
julius |
|
2 |
|
|
# First we get a list of modules in the RTL path of the board's path.
|
3 |
|
|
# Next we check which modules not in the board's RTL path are in the root RTL
|
4 |
|
|
# path (modules which can be commonly instantiated, but over which board
|
5 |
|
|
# build-specific versions take precedence.)
|
6 |
|
|
|
7 |
|
|
# Also generate list of verilog source files
|
8 |
|
|
|
9 |
|
|
# Paths under board/***/rtl/verilog we wish to exclude when getting modules
|
10 |
|
|
BOARD_VERILOG_MODULES_EXCLUDE += include
|
11 |
|
|
BOARD_VERILOG_MODULES_EXCLUDE += $(GATELEVEL_MODULES)
|
12 |
|
|
BOARD_VERILOG_MODULES_DIR_LIST=$(shell ls $(BOARD_RTL_VERILOG_DIR))
|
13 |
|
|
# Apply exclude to list of modules
|
14 |
|
|
BOARD_RTL_VERILOG_MODULES=$(filter-out $(BOARD_VERILOG_MODULES_EXCLUDE),$(BOARD_VERILOG_MODULES_DIR_LIST))
|
15 |
|
|
|
16 |
|
|
# Now get list of modules that we don't have a version of in the board path
|
17 |
|
|
COMMON_VERILOG_MODULES_EXCLUDE += include
|
18 |
|
|
COMMON_VERILOG_MODULES_EXCLUDE += $(BOARD_RTL_VERILOG_MODULES)
|
19 |
|
|
COMMON_VERILOG_MODULES_EXCLUDE += $(GATELEVEL_MODULES)
|
20 |
|
|
|
21 |
|
|
COMMON_RTL_VERILOG_MODULES_DIR_LIST=$(shell ls $(COMMON_RTL_VERILOG_DIR))
|
22 |
|
|
COMMON_RTL_VERILOG_MODULES=$(filter-out $(COMMON_VERILOG_MODULES_EXCLUDE), $(COMMON_RTL_VERILOG_MODULES_DIR_LIST))
|
23 |
|
|
|
24 |
|
|
# List of verilog source files (only .v files!)
|
25 |
|
|
# Board RTL modules first
|
26 |
|
|
RTL_VERILOG_SRC=$(shell for module in $(BOARD_RTL_VERILOG_MODULES); do if [ -d $(BOARD_RTL_VERILOG_DIR)/$$module ]; then ls $(BOARD_RTL_VERILOG_DIR)/$$module/*.v; fi; done)
|
27 |
|
|
# Common RTL module source
|
28 |
|
|
RTL_VERILOG_SRC +=$(shell for module in $(COMMON_RTL_VERILOG_MODULES); do if [ -d $(COMMON_RTL_VERILOG_DIR)/$$module ]; then ls $(COMMON_RTL_VERILOG_DIR)/$$module/*.v; fi; done)
|
29 |
|
|
|
30 |
|
|
# List of verilog includes from board RTL path - only for rule sensitivity
|
31 |
|
|
RTL_VERILOG_INCLUDES=$(shell ls $(BOARD_RTL_VERILOG_INCLUDE_DIR)/*.*)
|
32 |
|
|
|
33 |
|
|
# Debugging rules
|
34 |
|
|
|
35 |
|
|
print-board-modules:
|
36 |
|
|
@echo echo; echo "\t### Board verilog modules ###"; echo
|
37 |
|
|
@echo $(BOARD_RTL_VERILOG_MODULES)
|
38 |
|
|
|
39 |
|
|
print-common-modules-exclude:
|
40 |
|
|
@echo echo; echo "\t### Common verilog modules being excluded due to board versions ###"; echo
|
41 |
|
|
@echo "$(COMMON_VERILOG_MODULES_EXCLUDE)"
|
42 |
|
|
|
43 |
|
|
print-common-modules:
|
44 |
|
|
@echo echo; echo "\t### Verilog modules from common RTL dir ###"; echo
|
45 |
|
|
@echo $(COMMON_RTL_VERILOG_MODULES)
|
46 |
|
|
|
47 |
|
|
print-verilog-src:
|
48 |
|
|
@echo echo; echo "\t### Verilog source ###"; echo
|
49 |
|
|
@echo $(RTL_VERILOG_SRC)
|
50 |
558 |
julius |
|
51 |
|
|
|
52 |
|
|
ifeq ($(HAVE_VHDL), 1)
|
53 |
|
|
# We have some VHDL we should include.
|
54 |
|
|
|
55 |
|
|
# Currently only supported for board builds - no common VHDL included at present
|
56 |
|
|
BOARD_RTL_VHDL_DIR=$(BOARD_RTL_DIR)/vhdl
|
57 |
|
|
BOARD_RTL_VHDL_MODULES=$(shell ls $(BOARD_RTL_VHDL_DIR))
|
58 |
|
|
|
59 |
|
|
#
|
60 |
|
|
# VHDL DUT source variables
|
61 |
|
|
#
|
62 |
|
|
VHDL_FILE_EXT=vhd
|
63 |
|
|
|
64 |
|
|
RTL_VHDL_SRC=$(shell for module in $(BOARD_RTL_VHDL_MODULES); do if [ -d $(BOARD_RTL_VHDL_DIR)/$$module ]; then ls $(BOARD_RTL_VHDL_DIR)/$$module/*.$(VHDL_FILE_EXT); fi; done)
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
# Rule for debugging this script
|
68 |
|
|
print-vhdl-modules:
|
69 |
|
|
@echo echo; echo "\t### Board VHDL modules ###"; echo
|
70 |
|
|
@echo $(BOARD_RTL_VHDL_MODULES)
|
71 |
|
|
|
72 |
|
|
print-vhdl-src:
|
73 |
|
|
@echo echo; echo "\t### VHDL modules and source ###"; echo
|
74 |
|
|
@echo "modules: "; echo $(BOARD_RTL_VHDL_MODULES); echo
|
75 |
|
|
@echo "file extension: "$(VHDL_FILE_EXT)
|
76 |
|
|
@echo "source: "$(RTL_VHDL_SRC)
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
endif
|