forked from Xilinx/kria-vitis-platforms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (84 loc) · 2.56 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
# (C) Copyright 2020 - 2021 Xilinx, Inc.
# SPDX-License-Identifier: Apache-2.0
CP = cp -f
PWD = $(shell readlink -f .)
# the platform directory has to be an absolute path when passed to v++
PFM_DIR = $(PWD)/platforms
PFM_VER = 202110_1
# valid platforms / overlays
PFM_LIST = kv260_ispMipiRx_vcu_DP kv260_vcuDecode_vmixDP kv260_ispMipiRx_vmixDP kv260_ispMipiRx_DP
OVERLAY_LIST = smartcam aibox-reid defect-detect nlp-smartvision benchmark
# override platform name based on overlay
ifeq ($(OVERLAY),smartcam)
override PFM = kv260_ispMipiRx_vcu_DP
endif
ifeq ($(OVERLAY),aibox-reid)
override PFM = kv260_vcuDecode_vmixDP
endif
ifeq ($(OVERLAY),defect-detect)
override PFM = kv260_ispMipiRx_vmixDP
endif
ifeq ($(OVERLAY),nlp-smartvision)
override PFM = kv260_ispMipiRx_DP
endif
ifeq ($(OVERLAY),benchmark)
override PFM = kv260_ispMipiRx_vcu_DP
endif
PFM_XPFM = $(PFM_DIR)/xilinx_$(PFM)_$(PFM_VER)/$(PFM).xpfm
VITIS_DIR = overlays/examples
VITIS_OVERLAY_DIR = $(VITIS_DIR)/$(OVERLAY)
VITIS_OVERLAY_BIT = $(VITIS_OVERLAY_DIR)/binary_container_1/link/int/system.bit
.PHONY: help
help:
@echo 'Usage:'
@echo ''
@echo ' make overlay OVERLAY=<val>'
@echo ' Build the Vitis application overlay.'
@echo ''
@echo ' Valid options for OVERLAY: ${OVERLAY_LIST}'
@echo ''
@echo ' make platform PFM=<val> JOBS=<n>'
@echo ' Build the Vitis platform.'
@echo ''
@echo ' Valid options for PFM: ${PFM_LIST}'
@echo ' JOBS: optional param to set number of synthesis jobs (default 8)'
@echo ''
@echo ' make clean'
@echo ' Clean runs'
@echo ''
.PHONY: overlay
overlay: $(VITIS_OVERLAY_BIT)
$(VITIS_OVERLAY_BIT): $(PFM_XPFM)
@valid=0; \
for o in $(OVERLAY_LIST); do \
if [ "$$o" = "$(OVERLAY)" ]; then \
valid=1; \
break; \
fi \
done; \
if [ "$$valid" -ne 1 ]; then \
echo 'Invalid parameter OVERLAY=$(OVERLAY). Choose one of: $(OVERLAY_LIST)'; \
exit 1; \
fi; \
echo 'Build $(OVERLAY) Vitis overlay using platform $(PFM)'; \
$(MAKE) -C $(VITIS_OVERLAY_DIR) all PLATFORM=$(PFM_XPFM)
.PHONY: platform
platform: $(PFM_XPFM)
$(PFM_XPFM):
@valid=0; \
for p in $(PFM_LIST); do \
if [ "$$p" = "$(PFM)" ]; then \
valid=1; \
break; \
fi \
done; \
if [ "$$valid" -ne 1 ]; then \
echo 'Invalid parameter PFM=$(PFM). Choose one of: $(PFM_LIST)'; \
exit 1; \
fi; \
echo 'Create Vitis platform $(PFM)'; \
$(MAKE) -C $(PFM_DIR) platform PLATFORM=$(PFM) VERSION=$(PFM_VER)
.PHONY: clean
clean:
$(foreach o, $(OVERLAY_LIST), $(MAKE) -C $(VITIS_DIR)/$(o) clean;)
$(foreach p, $(PFM_LIST), $(MAKE) -C $(PFM_DIR) clean PLATFORM=$(p) VERSION=$(PFM_VER);)