boards.mk 9.82 KB
Newer Older
lvs's avatar
lvs committed
1
2
3
4
5
6
# By Default report is set to none, so report will be generated
# 'estimate' for estimate report generation
# 'system' for system report generation
REPORT:=none
PROFILE ?= no

Leonardo Solis's avatar
Leonardo Solis committed
7
8
9
10
11
12
OTHER_FLAGS=

ifeq ($(TARGETS), sw_emu)
	OTHER_FLAGS=-DSW_EMU
endif

Leonardo Solis's avatar
Leonardo Solis committed
13
14
15
#ifeq ($(TARGETS), hw_emu)
#	OTHER_FLAGS=-DSW_EMU
#endif
Leonardo Solis's avatar
Leonardo Solis committed
16

lvs's avatar
lvs committed
17
# Default C++ Compiler Flags and xocc compiler flags
Leonardo Solis's avatar
Leonardo Solis committed
18
CXXFLAGS:=-Wall -O0 -g -std=c++14 $(OTHER_FLAGS)
19

Leonardo Solis's avatar
Leonardo Solis committed
20
21
22
# =============================
# Enable Kernels
# ============================= 
23
24
ENABLE_KRNL_GA       = YES
ENABLE_KRNL_CONFORM  = YES
25
26
ENABLE_KRNL_INTERE   = YES
ENABLE_KRNL_INTRAE   = YES
Leonardo Solis's avatar
Leonardo Solis committed
27

28
29
30
31
ENABLE_KRNL_PRNG_BT_USHORT_FLOAT = YES
ENABLE_KRNL_PRNG_GG_UCHAR        = YES
ENABLE_KRNL_PRNG_GG_FLOAT        = YES

32
33
34
35
36
ENABLE_KRNL_PRNG_LS123_USHORT    = YES
ENABLE_KRNL_PRNG_LS_FLOAT  	 = YES
ENABLE_KRNL_PRNG_LS2_FLOAT       = YES
ENABLE_KRNL_PRNG_LS3_FLOAT       = YES

37
38
39
ENABLE_KRNL_PRNG_LS4_FLOAT       = YES
ENABLE_KRNL_PRNG_LS5_FLOAT       = YES
ENABLE_KRNL_PRNG_LS6_FLOAT       = YES
40
41
42
ENABLE_KRNL_PRNG_LS7_FLOAT       = YES
ENABLE_KRNL_PRNG_LS8_FLOAT       = YES
ENABLE_KRNL_PRNG_LS9_FLOAT       = YES
43

44
45
46
47
48
49
50
51
52
ENABLE_KRNL_LS  = YES
ENABLE_KRNL_LS2 = YES
ENABLE_KRNL_LS3 = YES
ENABLE_KRNL_LS4 = YES
ENABLE_KRNL_LS5 = YES
ENABLE_KRNL_LS6 = YES
ENABLE_KRNL_LS7 = YES
ENABLE_KRNL_LS8 = YES
ENABLE_KRNL_LS9 = YES
Leonardo Solis's avatar
Leonardo Solis committed
53

54
ENABLE_KRNL_IGL_ARBITER = YES
Leonardo Solis's avatar
Leonardo Solis committed
55

56
57
ifeq ($(ENABLE_KRNL_GA),YES)
	KRNL_GA =-DENABLE_KRNL_GA
Leonardo Solis's avatar
Leonardo Solis committed
58
else
59
	KRNL_GA =
Leonardo Solis's avatar
Leonardo Solis committed
60
61
endif

62
63
ifeq ($(ENABLE_KRNL_CONFORM),YES)
	KRNL_CONFORM =-DENABLE_KRNL_CONFORM
Leonardo Solis's avatar
Leonardo Solis committed
64
else
65
	KRNL_CONFORM =
Leonardo Solis's avatar
Leonardo Solis committed
66
67
endif

68
69
ifeq ($(ENABLE_KRNL_INTERE),YES)
	KRNL_INTERE =-DENABLE_KRNL_INTERE
Leonardo Solis's avatar
Leonardo Solis committed
70
else
71
	KRNL_INTERE =
Leonardo Solis's avatar
Leonardo Solis committed
72
73
endif

74
75
ifeq ($(ENABLE_KRNL_INTRAE),YES)
	KRNL_INTRAE =-DENABLE_KRNL_INTRAE
Leonardo Solis's avatar
Leonardo Solis committed
76
else
77
	KRNL_INTRAE =
Leonardo Solis's avatar
Leonardo Solis committed
78
79
endif

80
81
82
83
84
85
86
87
ifeq ($(ENABLE_KRNL_PRNG_BT_USHORT_FLOAT),YES)
	KRNL_PRNG_BT_USHORT_FLOAT =-DENABLE_KRNL_PRNG_BT_USHORT_FLOAT
else
	KRNL_PRNG_BT_USHORT_FLOAT =
endif

ifeq ($(ENABLE_KRNL_PRNG_GG_UCHAR),YES)
	KRNL_PRNG_GG_UCHAR =-DENABLE_KRNL_PRNG_GG_UCHAR
Leonardo Solis's avatar
Leonardo Solis committed
88
else
89
	KRNL_PRNG_GG_UCHAR =
Leonardo Solis's avatar
Leonardo Solis committed
90
91
endif

92
93
94
95
96
97
ifeq ($(ENABLE_KRNL_PRNG_GG_FLOAT),YES)
	KRNL_PRNG_GG_FLOAT =-DENABLE_KRNL_PRNG_GG_FLOAT
else
	KRNL_PRNG_GG_FLOAT =
endif

98
99
100
101
102
ifeq ($(ENABLE_KRNL_PRNG_LS123_USHORT),YES)
	KRNL_PRNG_LS123_USHORT =-DENABLE_KRNL_PRNG_LS123_USHORT
else
	KRNL_PRNG_LS123_USHORT =
endif
103

104
105
106
107
108
ifeq ($(ENABLE_KRNL_PRNG_LS_FLOAT),YES)
	KRNL_PRNG_LS_FLOAT =-DENABLE_KRNL_PRNG_LS_FLOAT
else
	KRNL_PRNG_LS_FLOAT =
endif
109

110
111
112
113
114
ifeq ($(ENABLE_KRNL_PRNG_LS2_FLOAT),YES)
	KRNL_PRNG_LS2_FLOAT =-DENABLE_KRNL_PRNG_LS2_FLOAT
else
	KRNL_PRNG_LS2_FLOAT =
endif
115

116
117
ifeq ($(ENABLE_KRNL_PRNG_LS3_FLOAT),YES)
	KRNL_PRNG_LS3_FLOAT =-DENABLE_KRNL_PRNG_LS3_FLOAT
Leonardo Solis's avatar
Leonardo Solis committed
118
else
119
	KRNL_PRNG_LS3_FLOAT =
Leonardo Solis's avatar
Leonardo Solis committed
120
121
endif

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
ifeq ($(ENABLE_KRNL_PRNG_LS4_FLOAT),YES)
	KRNL_PRNG_LS4_FLOAT =-DENABLE_KRNL_PRNG_LS4_FLOAT
else
	KRNL_PRNG_LS4_FLOAT =
endif

ifeq ($(ENABLE_KRNL_PRNG_LS5_FLOAT),YES)
	KRNL_PRNG_LS5_FLOAT =-DENABLE_KRNL_PRNG_LS5_FLOAT
else
	KRNL_PRNG_LS5_FLOAT =
endif

ifeq ($(ENABLE_KRNL_PRNG_LS6_FLOAT),YES)
	KRNL_PRNG_LS6_FLOAT =-DENABLE_KRNL_PRNG_LS6_FLOAT
else
	KRNL_PRNG_LS6_FLOAT =
endif

140
141
142
143
144
ifeq ($(ENABLE_KRNL_PRNG_LS7_FLOAT),YES)
	KRNL_PRNG_LS7_FLOAT =-DENABLE_KRNL_PRNG_LS7_FLOAT
else
	KRNL_PRNG_LS7_FLOAT =
endif
145

146
147
148
149
150
ifeq ($(ENABLE_KRNL_PRNG_LS8_FLOAT),YES)
	KRNL_PRNG_LS8_FLOAT =-DENABLE_KRNL_PRNG_LS8_FLOAT
else
	KRNL_PRNG_LS8_FLOAT =
endif
Leonardo Solis's avatar
Leonardo Solis committed
151

152
153
154
155
156
ifeq ($(ENABLE_KRNL_PRNG_LS9_FLOAT),YES)
	KRNL_PRNG_LS9_FLOAT =-DENABLE_KRNL_PRNG_LS9_FLOAT
else
	KRNL_PRNG_LS9_FLOAT =
endif
157

158
159
160
161
162
ifeq ($(ENABLE_KRNL_LS),YES)
	KRNL_LS =-DENABLE_KRNL_LS
else
	KRNL_LS =
endif
163

164
165
ifeq ($(ENABLE_KRNL_LS2),YES)
	KRNL_LS2 =-DENABLE_KRNL_LS2
Leonardo Solis's avatar
Leonardo Solis committed
166
else
167
	KRNL_LS2 =
Leonardo Solis's avatar
Leonardo Solis committed
168
169
endif

170
171
172
173
174
ifeq ($(ENABLE_KRNL_LS3),YES)
	KRNL_LS3 =-DENABLE_KRNL_LS3
else
	KRNL_LS3 =
endif
175

176
177
178
179
180
ifeq ($(ENABLE_KRNL_LS4),YES)
	KRNL_LS4 =-DENABLE_KRNL_LS4
else
	KRNL_LS4 =
endif
Leonardo Solis's avatar
Leonardo Solis committed
181

182
183
ifeq ($(ENABLE_KRNL_LS5),YES)
	KRNL_LS5 =-DENABLE_KRNL_LS5
Leonardo Solis's avatar
Leonardo Solis committed
184
else
185
	KRNL_LS5 =
Leonardo Solis's avatar
Leonardo Solis committed
186
187
endif

188
189
190
191
192
ifeq ($(ENABLE_KRNL_LS6),YES)
	KRNL_LS6 =-DENABLE_KRNL_LS6
else
	KRNL_LS6 =
endif
193

194
195
196
197
198
ifeq ($(ENABLE_KRNL_LS7),YES)
	KRNL_LS7 =-DENABLE_KRNL_LS7
else
	KRNL_LS7 =
endif
Leonardo Solis's avatar
Leonardo Solis committed
199

200
201
ifeq ($(ENABLE_KRNL_LS8),YES)
	KRNL_LS8 =-DENABLE_KRNL_LS8
Leonardo Solis's avatar
Leonardo Solis committed
202
else
203
	KRNL_LS8 =
Leonardo Solis's avatar
Leonardo Solis committed
204
205
endif

206
207
ifeq ($(ENABLE_KRNL_LS9),YES)
	KRNL_LS9 =-DENABLE_KRNL_LS9
Leonardo Solis's avatar
Leonardo Solis committed
208
else
209
	KRNL_LS9 =
Leonardo Solis's avatar
Leonardo Solis committed
210
211
endif

212
213
ifeq ($(ENABLE_KRNL_IGL_ARBITER),YES)
	KRNL_IGL_ARBITER =-DENABLE_KRNL_IGL_ARBITER
Leonardo Solis's avatar
Leonardo Solis committed
214
else
215
	KRNL_IGL_ARBITER =
Leonardo Solis's avatar
Leonardo Solis committed
216
217
endif

lvs's avatar
lvs committed
218
219
220
221
222
223
224
225
226
227
# =============================
# Reproduce result (remove randomness)
# =============================
REPRO=NO

ifeq ($(REPRO), YES)
	REP=-DREPRO
else	
	REP=
endif
228

229
230
ENABLE_KERNELS = $(KRNL_GA) \
		 $(KRNL_CONFORM) \
231
232
		 $(KRNL_INTERE) \
		 $(KRNL_INTRAE) \
233
234
235
		 $(KRNL_PRNG_BT_USHORT_FLOAT) \
		 $(KRNL_PRNG_GG_UCHAR) \
		 $(KRNL_PRNG_GG_FLOAT) \
236
		 $(KRNL_PRNG_LS123_USHORT) \
237
	         $(KRNL_PRNG_LS_FLOAT)  \
238
239
		 $(KRNL_PRNG_LS2_FLOAT) \
		 $(KRNL_PRNG_LS3_FLOAT) \
240
241
242
		 $(KRNL_PRNG_LS4_FLOAT) \
		 $(KRNL_PRNG_LS5_FLOAT) \
		 $(KRNL_PRNG_LS6_FLOAT) \
243
244
245
		 $(KRNL_PRNG_LS7_FLOAT) \
		 $(KRNL_PRNG_LS8_FLOAT) \
		 $(KRNL_PRNG_LS9_FLOAT) \
246
247
248
249
250
251
252
253
254
		 $(KRNL_LS)  \
		 $(KRNL_LS2) \
		 $(KRNL_LS3) \
		 $(KRNL_LS4) \
		 $(KRNL_LS5) \
		 $(KRNL_LS6) \
		 $(KRNL_LS7) \
		 $(KRNL_LS8) \
		 $(KRNL_LS9) \
255
		 $(KRNL_IGL_ARBITER)
lvs's avatar
lvs committed
256
257
258
259
260

# =============================
# Fixed-point
# =============================
# FIxed-POint COform flag (FIPOCO)
261
262
#FIXED_POINT_CONFORM=YES
FIXED_POINT_CONFORM=NO
lvs's avatar
lvs committed
263
264
265
266

FIXED_POINT_INTERE=NO
FIXED_POINT_INTRAE=NO

267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
#FIXED_POINT_LS1=YES
#FIXED_POINT_LS2=YES
#FIXED_POINT_LS3=YES
#FIXED_POINT_LS4=YES
#FIXED_POINT_LS5=YES
#FIXED_POINT_LS6=YES
#FIXED_POINT_LS7=YES
#FIXED_POINT_LS8=YES
#FIXED_POINT_LS9=YES
FIXED_POINT_LS1=NO
FIXED_POINT_LS2=NO
FIXED_POINT_LS3=NO
FIXED_POINT_LS4=NO
FIXED_POINT_LS5=NO
FIXED_POINT_LS6=NO
FIXED_POINT_LS7=NO
FIXED_POINT_LS8=NO
FIXED_POINT_LS9=NO
lvs's avatar
lvs committed
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391

SINGLE_COPY_POP_ENE=YES

SEPARATE_FGRID_INTERE=NO

ifeq ($(FIXED_POINT_CONFORM), YES)
	FIPOCO_FLAG=-DFIXED_POINT_CONFORM
else	
	FIPOCO_FLAG=
endif

ifeq ($(FIXED_POINT_INTERE), YES)
	FIPOIE_FLAG=-DFIXED_POINT_INTERE
else	
	FIPOIE_FLAG=
endif

ifeq ($(FIXED_POINT_INTRAE), YES)
	FIPOIA_FLAG=-DFIXED_POINT_INTRAE
else	
	FIPOIA_FLAG=
endif

ifeq ($(FIXED_POINT_LS1), YES)
	FIPOLS1_FLAG=-DFIXED_POINT_LS1
else	
	FIPOLS1_FLAG=
endif

ifeq ($(FIXED_POINT_LS2), YES)
	FIPOLS2_FLAG=-DFIXED_POINT_LS2
else	
	FIPOLS2_FLAG=
endif

ifeq ($(FIXED_POINT_LS3), YES)
	FIPOLS3_FLAG=-DFIXED_POINT_LS3
else	
	FIPOLS3_FLAG=
endif

ifeq ($(FIXED_POINT_LS4), YES)
	FIPOLS4_FLAG=-DFIXED_POINT_LS4
else	
	FIPOLS4_FLAG=
endif

ifeq ($(FIXED_POINT_LS5), YES)
	FIPOLS5_FLAG=-DFIXED_POINT_LS5
else	
	FIPOLS5_FLAG=
endif



ifeq ($(FIXED_POINT_LS6), YES)
	FIPOLS6_FLAG=-DFIXED_POINT_LS6
else	
	FIPOLS6_FLAG=
endif

ifeq ($(FIXED_POINT_LS7), YES)
	FIPOLS7_FLAG=-DFIXED_POINT_LS7
else	
	FIPOLS7_FLAG=
endif

ifeq ($(FIXED_POINT_LS8), YES)
	FIPOLS8_FLAG=-DFIXED_POINT_LS8
else	
	FIPOLS8_FLAG=
endif

ifeq ($(FIXED_POINT_LS9), YES)
	FIPOLS9_FLAG=-DFIXED_POINT_LS9
else	
	FIPOLS9_FLAG=
endif



ifeq ($(SINGLE_COPY_POP_ENE), YES)
	COPYPOPENE_FLAG=-DSINGLE_COPY_POP_ENE
else	
	COPYPOPENE_FLAG=
endif

ifeq ($(SEPARATE_FGRID_INTERE), YES)
	SEP_FGRID_FLAG=-DSEPARATE_FGRID_INTERE
else	
	SEP_FGRID_FLAG=
endif

FIPO_FLAG = $(FIPOCO_FLAG) \
	    $(FIPOIE_FLAG) \
	    $(FIPOIA_FLAG) \
	    $(FIPOLS1_FLAG) \
	    $(FIPOLS2_FLAG) \
	    $(FIPOLS3_FLAG) \
	    $(FIPOLS4_FLAG) \
	    $(FIPOLS5_FLAG) \
	    $(FIPOLS6_FLAG) \
	    $(FIPOLS7_FLAG) \
	    $(FIPOLS8_FLAG) \
	    $(FIPOLS9_FLAG) \
	    $(COPYPOPENE_FLAG) $(SEP_FGRID_FLAG) 

Leonardo Solis's avatar
Leonardo Solis committed
392
# Definition of OTHER_FLAGS (moved to the top)
393

394
395
396
397
398
# Set manually the frequency to 200 MHz
# TODO: make it configurable from Makefile
# https://forums.xilinx.com/t5/SDAccel/SDAccel-asks-to-set-lower-frequency-by-specifying-kernel/td-p/799137
#OTHER_FLAGS+=--kernel_frequency 200

399
#https://www.xilinx.com/html_docs/xilinx2018_1/sdsoc_doc/nts1517252127891.html
lvs's avatar
lvs committed
400
#CLFLAGS:= --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s
401
#CLFLAGS:= --xp "param:compiler.version=31" --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s 
lvs's avatar
lvs committed
402
#CLFLAGS:= --xp "param:compiler.version=31" --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s -I./ -I../ -I./device
Leonardo Solis's avatar
Leonardo Solis committed
403
#CLFLAGS:= --xp "param:compiler.version=31" --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s -I./ -I../ -I./device $(REP) $(FIPO_FLAG)
404
CLFLAGS:= --xp "param:compiler.version=31" --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s -g -I./ -I../ -I./device $(REP) $(FIPO_FLAG) $(OTHER_FLAGS)
405

lvs's avatar
lvs committed
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465

ifneq ($(REPORT),none)
CLFLAGS += --report $(REPORT)
endif 

ifeq ($(PROFILE),yes)
CLFLAGS += --profile_kernel data:all:all:all
endif

LDCLFLAGS:=$(CLFLAGS)

ifdef XILINX_SDX
XILINX_SDACCEL=${XILINX_SDX}
endif

ifndef XILINX_SDACCEL
$(error XILINX_SDX variable is not set, please set correctly and rerun)
endif

VIVADO=$(XILINX_VIVADO)/bin/vivado

# Use the Xilinx OpenCL compiler
CLC:=$(XILINX_SDACCEL)/bin/xocc
LDCLC:=$(CLC)
EMCONFIGUTIL := $(XILINX_SDACCEL)/bin/emconfigutil

# By default build for X86, this could also be set to POWER to build for power
ARCH:=X86

DEVICES:= xilinx:kcu1500:dynamic

ifeq ($(ARCH),POWER)
CXX:=$(XILINX_SDACCEL)/gnu/ppc64le/4.9.3/lnx64/bin/powerpc64le-linux-gnu-g++
else
CXX:=$(XILINX_SDACCEL)/bin/xcpp
endif

#if COMMON_REPO is not defined use the default value support existing Designs
COMMON_REPO ?= ../../

# By default build for hardware can be set to
#   hw_emu for hardware emulation
#   sw_emu for software emulation
#   or a collection of all or none of these
TARGETS:=hw

# By default only have one device in the system
NUM_DEVICES:=1

# sanitize_dsa - create a filesystem friendly name from dsa name
#   $(1) - name of dsa
COLON=:
PERIOD=.
UNDERSCORE=_
sanitize_dsa = $(strip $(subst $(PERIOD),$(UNDERSCORE),$(subst $(COLON),$(UNDERSCORE),$(1))))

device2dsa = $(if $(filter $(suffix $(1)),.xpfm),$(shell $(COMMON_REPO)/utility/parsexpmf.py $(1) dsa 2>/dev/null),$(1))
device2sandsa = $(call sanitize_dsa,$(call device2dsa,$(1)))
device2dep = $(if $(filter $(suffix $(1)),.xpfm),$(dir $(1))/$(shell $(COMMON_REPO)/utility/parsexpmf.py $(1) hw 2>/dev/null) $(1),)