boards.mk 9.46 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
43
44





45
46
47
48
49
50
51
52
53
ENABLE_K42 = YES
ENABLE_K43 = YES
ENABLE_K44 = YES






Leonardo Solis's avatar
Leonardo Solis committed
54
55
56
57
58
59
60
61
62
63

# Replace single Krnl_Prng_Arbiter
# See kernels 31, 32, 33, 34

# LS kernels
ENABLE_K12 = YES

# disable Krnl_LS_Arbiter
ENABLE_K15 = YES

64

Leonardo Solis's avatar
Leonardo Solis committed
65
66
67
68
69
70
71
72
ENABLE_K21 = YES

# PRNGS in GA for LS2 and LS3

ENABLE_K27 = YES



73
74
75



Leonardo Solis's avatar
Leonardo Solis committed
76
77
78
79
80

# krnl_ls4, Krnl_ls5
ENABLE_K39 = YES
ENABLE_K40 = YES

81

Leonardo Solis's avatar
Leonardo Solis committed
82
83
84
85
86
87
88
89

# krnl_ls6, Krnl_ls7, krnl_ls8, Krnl_ls9
ENABLE_K45 = YES
ENABLE_K46 = YES
ENABLE_K47 = YES
ENABLE_K48 = YES


90
91
ifeq ($(ENABLE_KRNL_GA),YES)
	KRNL_GA =-DENABLE_KRNL_GA
Leonardo Solis's avatar
Leonardo Solis committed
92
else
93
	KRNL_GA =
Leonardo Solis's avatar
Leonardo Solis committed
94
95
endif

96
97
ifeq ($(ENABLE_KRNL_CONFORM),YES)
	KRNL_CONFORM =-DENABLE_KRNL_CONFORM
Leonardo Solis's avatar
Leonardo Solis committed
98
else
99
	KRNL_CONFORM =
Leonardo Solis's avatar
Leonardo Solis committed
100
101
endif

102
103
ifeq ($(ENABLE_KRNL_INTERE),YES)
	KRNL_INTERE =-DENABLE_KRNL_INTERE
Leonardo Solis's avatar
Leonardo Solis committed
104
else
105
	KRNL_INTERE =
Leonardo Solis's avatar
Leonardo Solis committed
106
107
endif

108
109
ifeq ($(ENABLE_KRNL_INTRAE),YES)
	KRNL_INTRAE =-DENABLE_KRNL_INTRAE
Leonardo Solis's avatar
Leonardo Solis committed
110
else
111
	KRNL_INTRAE =
Leonardo Solis's avatar
Leonardo Solis committed
112
113
endif

114
115
116
117
118
119
120
121
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
122
else
123
	KRNL_PRNG_GG_UCHAR =
Leonardo Solis's avatar
Leonardo Solis committed
124
125
endif

126
127
128
129
130
131
ifeq ($(ENABLE_KRNL_PRNG_GG_FLOAT),YES)
	KRNL_PRNG_GG_FLOAT =-DENABLE_KRNL_PRNG_GG_FLOAT
else
	KRNL_PRNG_GG_FLOAT =
endif

132
133
134
135
136
ifeq ($(ENABLE_KRNL_PRNG_LS123_USHORT),YES)
	KRNL_PRNG_LS123_USHORT =-DENABLE_KRNL_PRNG_LS123_USHORT
else
	KRNL_PRNG_LS123_USHORT =
endif
137

138
139
140
141
142
ifeq ($(ENABLE_KRNL_PRNG_LS_FLOAT),YES)
	KRNL_PRNG_LS_FLOAT =-DENABLE_KRNL_PRNG_LS_FLOAT
else
	KRNL_PRNG_LS_FLOAT =
endif
143

144
145
146
147
148
ifeq ($(ENABLE_KRNL_PRNG_LS2_FLOAT),YES)
	KRNL_PRNG_LS2_FLOAT =-DENABLE_KRNL_PRNG_LS2_FLOAT
else
	KRNL_PRNG_LS2_FLOAT =
endif
149

150
151
ifeq ($(ENABLE_KRNL_PRNG_LS3_FLOAT),YES)
	KRNL_PRNG_LS3_FLOAT =-DENABLE_KRNL_PRNG_LS3_FLOAT
Leonardo Solis's avatar
Leonardo Solis committed
152
else
153
	KRNL_PRNG_LS3_FLOAT =
Leonardo Solis's avatar
Leonardo Solis committed
154
155
endif

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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

174

Leonardo Solis's avatar
Leonardo Solis committed
175

176
177
178
179
180
181
182
183
184
185










Leonardo Solis's avatar
Leonardo Solis committed
186
187
188
189
190
191
ifeq ($(ENABLE_K12),YES)
	K12 =-DENABLE_KERNEL12
else
	K12 =
endif

192

Leonardo Solis's avatar
Leonardo Solis committed
193
194
195
196
197
198
199

ifeq ($(ENABLE_K15),YES)
	K15 =-DENABLE_KERNEL15
else
	K15 =
endif

200

Leonardo Solis's avatar
Leonardo Solis committed
201
202
203
204
205
206
207
208
209
210
211
212
213

ifeq ($(ENABLE_K21),YES)
	K21 =-DENABLE_KERNEL21
else
	K21 =
endif

ifeq ($(ENABLE_K27),YES)
	K27 =-DENABLE_KERNEL27
else
	K27 =
endif

214

Leonardo Solis's avatar
Leonardo Solis committed
215

216

Leonardo Solis's avatar
Leonardo Solis committed
217
218


219
220


Leonardo Solis's avatar
Leonardo Solis committed
221
222
223
224
225
226
227
228
229
230
231
232
233

ifeq ($(ENABLE_K39),YES)
	K39 =-DENABLE_KERNEL39
else
	K39 =
endif

ifeq ($(ENABLE_K40),YES)
	K40 =-DENABLE_KERNEL40
else
	K40 =
endif

234

Leonardo Solis's avatar
Leonardo Solis committed
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

ifeq ($(ENABLE_K42),YES)
	K42 =-DENABLE_KERNEL42
else
	K42 =
endif

ifeq ($(ENABLE_K43),YES)
	K43 =-DENABLE_KERNEL43
else
	K43 =
endif

ifeq ($(ENABLE_K44),YES)
	K44 =-DENABLE_KERNEL44
else
	K44 =
endif

ifeq ($(ENABLE_K45),YES)
	K45 =-DENABLE_KERNEL45
else
	K45 =
endif

ifeq ($(ENABLE_K46),YES)
	K46 =-DENABLE_KERNEL46
else
	K46 =
endif

ifeq ($(ENABLE_K47),YES)
	K47 =-DENABLE_KERNEL47
else
	K47 =
endif

ifeq ($(ENABLE_K48),YES)
	K48 =-DENABLE_KERNEL48
else
	K48 =
endif
lvs's avatar
lvs committed
277
278
279
280
281
282
283
284
285
286
# =============================
# Reproduce result (remove randomness)
# =============================
REPRO=NO

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

288
289
ENABLE_KERNELS = $(KRNL_GA) \
		 $(KRNL_CONFORM) \
290
291
		 $(KRNL_INTERE) \
		 $(KRNL_INTRAE) \
292
293
294
		 $(KRNL_PRNG_BT_USHORT_FLOAT) \
		 $(KRNL_PRNG_GG_UCHAR) \
		 $(KRNL_PRNG_GG_FLOAT) \
295
		 $(KRNL_PRNG_LS123_USHORT) \
296
	         $(KRNL_PRNG_LS_FLOAT)  \
297
298
		 $(KRNL_PRNG_LS2_FLOAT) \
		 $(KRNL_PRNG_LS3_FLOAT) \
299
300
301
		 $(KRNL_PRNG_LS4_FLOAT) \
		 $(KRNL_PRNG_LS5_FLOAT) \
		 $(KRNL_PRNG_LS6_FLOAT) \
302
303
		 $(K12) $(K15) \
		 $(K21)        $(K27)        \
304
305
		 $(K39) $(K40) \
		 $(K42) $(K43) $(K44) $(K45) $(K46) $(K47) $(K48)
lvs's avatar
lvs committed
306
307
308
309
310

# =============================
# Fixed-point
# =============================
# FIxed-POint COform flag (FIPOCO)
311
312
#FIXED_POINT_CONFORM=YES
FIXED_POINT_CONFORM=NO
lvs's avatar
lvs committed
313
314
315
316

FIXED_POINT_INTERE=NO
FIXED_POINT_INTRAE=NO

317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
#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
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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
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

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
442
# Definition of OTHER_FLAGS (moved to the top)
443

444
445
446
447
448
# 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

449
#https://www.xilinx.com/html_docs/xilinx2018_1/sdsoc_doc/nts1517252127891.html
lvs's avatar
lvs committed
450
#CLFLAGS:= --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s
451
#CLFLAGS:= --xp "param:compiler.version=31" --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s 
lvs's avatar
lvs committed
452
#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
453
#CLFLAGS:= --xp "param:compiler.version=31" --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s -I./ -I../ -I./device $(REP) $(FIPO_FLAG)
454
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)
455

lvs's avatar
lvs committed
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515

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),)