-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
286 lines (241 loc) · 9.65 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
##############################################################
# Main makefile for the Aegean repo.
# From the Aegean repo you can build a multicore patmos
# system with an argo NoC.
##############################################################
# Copyright:
# DTU, BSD License
# Authors:
# Wolfgang Puffitsch
# Rasmus Bo Sorensen
##############################################################
# Include user makefile for local configurations
-include config.mk
# The project being build when calling
# "make platform|compile|sim|synth|config"
AEGEAN_PLATFORM?=default-altde2-115
# Tests to be run by buildbot
BUILDBOT_TESTS?=corethread_test test_cmp libctest
# Aegean path names
AEGEAN_PATH?=$(CURDIR)
AEGEAN_PLATFORM_FILE=$(AEGEAN_PATH)/config/$(AEGEAN_PLATFORM).xml
BUILD_PATH?=$(AEGEAN_PATH)/build/$(AEGEAN_PLATFORM)
#For BUILDING AUDIO PLATFORM (default disabled):
AUDIO_ENABLED?=0
#AUDIO FILES:
AUDIO_APP?=default_audio_app
FX_LIST?=FX_List
LATENCY?=latency_autogen.json
AUDIO_APP_FILE=$(AEGEAN_PATH)/audio_apps/$(AUDIO_APP).json
FX_LIST_FILE=$(AEGEAN_PATH)/audio_apps/$(FX_LIST).json
LATENCY_FILE=$(AEGEAN_PATH)/audio_apps/$(LATENCY)
#NoC Reconfiguration (for AUDIO): 1=Enabled, 2=Disabled
NOC_RECONFIG?=0
#destination for auto-generated NoC schedule (for AUDIO)
AEGEAN_NOCSCHED?=default-altde2-115-audio-nocsched
AEGEAN_NOCSCHED_FILE=$(AEGEAN_PATH)/config/$(AEGEAN_NOCSCHED).xml
#if NoC reconfiguration is disabled, all2all schedule for NoC (for AUDIO)
AEGEAN_NOCSCHED_FILE_ALL2ALL=$(CURDIR)/config/default-altde2-115-audio-nocsched-all2all.xml
BUILD_NOCSCHED_PATH?=$(AEGEAN_PATH)/build/$(AEGEAN_NOCSCHED)
# Source file variables
PATMOS_PATH?=$(CURDIR)/../patmos
ARGO_PATH?=$(CURDIR)/../argo
AEGEAN_SRC_PATH?=$(AEGEAN_PATH)/vhdl
AEGEAN_SRC=$(patsubst %,$(BUILD_PATH)/%,\
noc.vhd aegean.vhd)
TEST_SRC=$(patsubst %,$(AEGEAN_SRC_PATH)/%,\
packages/test.vhd sim/pll.vhd)
MEM_SRC=$(patsubst %,$(PATMOS_PATH)/hardware/modelsim/%,\
conversions.vhd gen_utils.vhd sim_ssram_512x36.vhd \
CY7C10612DV33/package_timing.vhd \
CY7C10612DV33/package_utility.vhd \
CY7C10612DV33/cy7c10612dv33.vhd)
TESTBENCH_SRC=$(patsubst %,$(BUILD_PATH)/%,\
aegean_top.vhd aegean_testbench.vhd)
# Tool paths
SIM_PATH?=$(AEGEAN_SRC_PATH)/sim
SYNTH_PATH=$(BUILD_PATH)/quartus
SYNTH_PATH_XILINX=$(BUILD_PATH)/ise
VLIB=vlib -quiet work
VCOM?=vcom -quiet -93 -work $(BUILD_PATH)/work
VCOM08?=vcom -quiet -2008 -work $(BUILD_PATH)/work
VLOG?=vlog -quiet -work $(BUILD_PATH)/work
VSIM?=vsim -novopt -lib $(BUILD_PATH)/work
ifeq ($(WINDIR),)
S=:
else
S=\;
endif
# mainly for OS X: try to use wine if modelsim is not in path...
VCOM_AVAILABLE := $(shell which vcom 2> /dev/null; echo $$?)
ifeq ($(VCOM_AVAILABLE), 1)
PREFIX=wine
else
PREFIX=
endif
# Temporary file specifying the configuration of the latest platform build
PGEN=$(BUILD_PATH)/.pgen
ARGO_SRC=$(BUILD_PATH)/.argo_src
VLOG_SRC=$(BUILD_PATH)/.vlog_src
.PHONY: sim synth config platform compile buildbot-test
.FORCE:
all: platform
#########################################################################
# Generation of source code for the platform described in AEGEAN_PLATFORM
# Call make platform
#########################################################################
projectname:
@echo "Current project name:"
@echo $(AEGEAN_PLATFORM)
audio-app-name:
@echo "Current Audio APP name":
@echo $(AUDIO_APP)
audio-setup: clean-noc-sched audio-generate noc-sched audio-latency
audio-generate: $(AUDIO_APP_FILE)
@python3 $(AEGEAN_PATH)/python/audioFXGen.py $(FX_LIST_FILE) $(AUDIO_APP_FILE) $(AEGEAN_NOCSCHED_FILE) $(NOC_RECONFIG) $(LATENCY_FILE)
audio-latency: $(LATENCY_FILE)
ifeq ($(NOC_RECONFIG),1)
@python3 $(AEGEAN_PATH)/python/audioLatencyCalc.py $(LATENCY_FILE) $(NOC_RECONFIG) $(AEGEAN_NOCSCHED_FILE)
else
@python3 $(AEGEAN_PATH)/python/audioLatencyCalc.py $(LATENCY_FILE) $(NOC_RECONFIG) $(AEGEAN_NOCSCHED_FILE_ALL2ALL)
endif
noc-sched-name:
@echo "Current NoC scheduling topoligy:"
@echo $(AEGEAN_NOCSCHED)
noc-sched: $(AEGEAN_NOCSCHED_FILE_USED) $(BUILD_NOCSCHED_PATH)
ifeq ($(NOC_RECONFIG),1)
@echo "GENERATING nocinit.c FILE FROM NoC TDM SCHEDULE"
@echo "NoC schedule file: "
@echo $(AEGEAN_NOCSCHED_FILE)
@python3 $(AEGEAN_PATH)/python/nocSchedMain.py $(AEGEAN_NOCSCHED_FILE)
else
@echo "GENERATING nocinit.c FILE FROM NoC TDM SCHEDULE"
@echo "NoC schedule file: "
@echo $(AEGEAN_NOCSCHED_FILE_ALL2ALL)
@python3 $(AEGEAN_PATH)/python/nocSchedMain.py $(AEGEAN_NOCSCHED_FILE_ALL2ALL)
endif
$(BUILD_NOCSCHED_PATH):
mkdir -p $(BUILD_NOCSCHED_PATH)/xml
platform: $(BUILD_PATH)/nocinit.c
$(BUILD_PATH)/nocinit.c: $(PGEN)
$(PGEN): $(AEGEAN_PLATFORM_FILE) $(BUILD_PATH) quartus_files ise_files
@python3 $(AEGEAN_PATH)/python/main.py $(AEGEAN_PLATFORM_FILE) $(AUDIO_ENABLED)
@echo $(AEGEAN_PLATFORM)+$(BUILD_PATH) > $(PGEN)
$(BUILD_PATH):
mkdir -p $(BUILD_PATH)/xml
quartus_files: \
$(BUILD_PATH)/quartus/aegean_top.cdf \
$(BUILD_PATH)/quartus/aegean_top.qpf \
$(BUILD_PATH)/quartus/aegean_top.qsf \
$(BUILD_PATH)/quartus/aegean_top.sdc
$(BUILD_PATH)/quartus/aegean_top.cdf: $(AEGEAN_PATH)/quartus/aegean_top.cdf
-mkdir -p $(dir $@)
-cp $< $@
$(BUILD_PATH)/quartus/aegean_top.qpf: $(AEGEAN_PATH)/quartus/aegean_top.qpf
-mkdir -p $(dir $@)
-cp $< $@
$(BUILD_PATH)/quartus/aegean_top.qsf: $(AEGEAN_PATH)/quartus/aegean_top.qsf
-mkdir -p $(dir $@)
-cp $< $@
$(BUILD_PATH)/quartus/aegean_top.sdc: $(AEGEAN_PATH)/quartus/aegean_top.sdc
-mkdir -p $(dir $@)
-cp $< $@
ise_files: \
$(SYNTH_PATH_XILINX)/$(AEGEAN_PLATFORM)_sync.xise \
$(SYNTH_PATH_XILINX)/ml605_sync.ucf \
$(SYNTH_PATH_XILINX)/ml605_async.ucf \
$(SYNTH_PATH_XILINX)/$(AEGEAN_PLATFORM)_async.xise
$(SYNTH_PATH_XILINX)/$(AEGEAN_PLATFORM)_sync.xise: $(AEGEAN_PATH)/ise/ml605oc_sync.xise
-mkdir -p $(dir $@)
-cp $< $@
$(SYNTH_PATH_XILINX)/ml605_sync.ucf: $(AEGEAN_PATH)/ise/ml605_sync.ucf
-mkdir -p $(dir $@)
-cp $< $@
$(SYNTH_PATH_XILINX)/ml605_async.ucf: $(AEGEAN_PATH)/ise/ml605_async.ucf
-mkdir -p $(dir $@)
-cp $< $@
$(SYNTH_PATH_XILINX)/$(AEGEAN_PLATFORM)_async.xise: $(AEGEAN_PATH)/ise/ml605oc_async.xise
-mkdir -p $(dir $@)
-cp $< $@
##########################################################################
# Compilation of source code for the platform described in AEGEAN_PLATFORM
# Call make compile
##########################################################################
compile: $(BUILD_PATH)/work compile-argo compile-vlog $(AEGEAN_SRC)
$(PREFIX) $(VCOM) $(AEGEAN_SRC)
$(BUILD_PATH)/work:
mkdir -p $(BUILD_PATH)
cd $(BUILD_PATH) && $(PREFIX) $(VLIB)
compile-argo: $(BUILD_PATH)/work $(shell cat $(ARGO_SRC)) $(ARGO_SRC)
$(PREFIX) $(VCOM08) $(shell cat $(ARGO_SRC))
compile-vlog: $(BUILD_PATH)/work $(shell cat $(VLOG_SRC)) $(VLOG_SRC)
$(PREFIX) $(VLOG) $(shell cat $(VLOG_SRC))
#########################################################################
# Map Xilinx libraries
#########################################################################
map-xilinx-libs:
vmap secureip $(SECUREIPPATH)/secureip
vmap unisim $(UNISIMPATH)/unisim
#########################################################################
# Simulation of source code for the platform described in AEGEAN_PLATFORM
# Call make sim
#########################################################################
sim: compile $(BUILD_PATH)/work $(TEST_SRC) $(TESTBENCH_SRC)
$(PREFIX) $(VCOM) $(TEST_SRC) $(MEM_SRC) $(TESTBENCH_SRC)
$(PREFIX) $(VSIM) -do $(SIM_PATH)/aegean.do aegean_testbench
sim-fpga: map-xilinx-libs compile $(BUILD_PATH)/work compile $(TEST_SRC) $(TESTBENCH_SRC)
$(PREFIX) $(VCOM) $(TEST_SRC) $(MEM_SRC) $(TESTBENCH_SRC)
$(PREFIX) $(VSIM) -do $(SIM_PATH)/aegean.do aegean_testbench
synth: $(PATMOS_SOURCE) $(CONFIG_SRC) $(shell cat $(ARGO_SRC)) $(AEGEAN_SRC) $(ARGO_SRC)
quartus_map $(SYNTH_PATH)/aegean_top --verilog_macro="SYNTHESIS"
quartus_fit $(SYNTH_PATH)/aegean_top
quartus_asm $(SYNTH_PATH)/aegean_top
quartus_sta $(SYNTH_PATH)/aegean_top
config:
quartus_pgm -c USB-Blaster -m JTAG $(SYNTH_PATH)/aegean_top.cdf
clean-noc-sched:
-rm -rf $(BUILD_NOCSCHED_PATH)
clean:
-rm -rf $(BUILD_PATH)
cleanall:
-rm -rf $(AEGEAN_PATH)/build
test:
for test in $(BUILDBOT_TESTS); \
do \
make -C ../patmos APP=$$test comp ; \
quartus_pgm -c USB-Blaster -m JTAG $(SYNTH_PATH)/aegean_top.cdf ; \
patserdow -v /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700aiK5-if00-port0 ../patmos/tmp/$$test.elf ; \
done
buildbot-test: clean platform compile synth test
help:
@echo "================================================================================"
@echo "== This is the help target of the Aegean main Makefile."
@echo "== The variable AEGEAN_PLATFORM set the platform specification"
@echo "== in the config directory."
@echo "=="
@echo "== Targets:"
@echo "=="
@echo "== noc-sched : Generate the NoC schedule."
@echo "=="
@echo "== all : Builds all that is needed to simulate the"
@echo "== described platform."
@echo "=="
@echo "== platform : Generates the source files for the platform described"
@echo "== in AEGEAN_PLATFORM file."
@echo "=="
@echo "== audio-setup : Generates the NoC TDM scheduling XML file and the"
@echo "== audioinit.c file first. Then, it generates the"
@echo "== nocinit.c file from the NoCschedule."
@echo "=="
@echo "== compile : Compiles the full platform."
@echo "=="
@echo "== sim : Starts the simulation of the platform."
@echo "=="
@echo "== synth : Synthesises the platform."
@echo "=="
@echo "== clean : Cleans the build directory of the specified"
@echo "== platform specification."
@echo "=="
@echo "== cleanall : Cleans all the build directories."
@echo "=="
@echo "================================================================================"