-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
160 lines (143 loc) · 6.55 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
# ###########################################################
# ██████ ███ ███ ███████ ███ ███ ██ ████████
# ██ ██ ████ ████ ██ ████ ████ ██ ██
# ██████ ██ ████ ██ █████ ██ ████ ██ ██ ██
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ██████ ██ ██ ███████ ██ ██ ██ ██
# 2023-2024, Jozsef Mozer
# ###########################################################
# Ignore timing violations? --> ignore for bringup
ERROR_ON_HOLD_VIOLATION=FALSE
.PHONY: all kernel clean clean_platform platform rtl_xo hls_xo rtl_ip xclbin xclbin_debug docs
all: platform rtl_ip rtl_xo hls_xo xclbin
kernel: rtl_ip rtl_xo hls_xo
platform:
@echo "############################################################################"
@echo "# CREATING PS PLATFORM"
@echo "############################################################################"
cd platform/WorkSpace/; vivado -mode batch -script zcu106_custom_platform.tcl
cd platform/WorkSpace/; make all COMMON_IMAGE_ZYNQMP=xilinx-zynqmp-common-v2023.2/
rtl_ip:
@echo "############################################################################"
@echo "# PACKAGING RTL IP"
@echo "############################################################################"
vivado -mode batch -source scripting/package_ip.tcl -log ./logs/package_ip.log
rtl_xo:
@echo "############################################################################"
@echo "# CREATING RTL XO FILE"
@echo "############################################################################"
vivado -mode batch -source scripting/package_xo.tcl -log ./logs/rtl_xo.log
hls_xo:
@echo "############################################################################"
@echo "# CREATING DMA INTERFACE XO FILE"
@echo "############################################################################"
v++ -t hw \
-c \
--log_dir ./logs/hls_xo \
--report_dir ./logs/hls_xo \
--platform ./platform/WorkSpace/zcu106_custom/export/zcu106_custom/zcu106_custom.xpfm \
--kernel_frequency 100 \
-k hls_dma \
./src/hls_dma/hls_dma.cpp \
--save-temps \
--temp_dir ./build/hls_if/build \
-o ./build/hls_dma.xo
xclbin:
@echo "############################################################################"
@echo "# COMPILING XCLBIN"
@echo "############################################################################"
rm -rf _x
rm -rf .Xil
v++ -t hw \
--link \
--log_dir ./logs/xclbin \
--report_dir ./logs/xclbin \
--advanced.param compiler.errorOnHoldViolation=${ERROR_ON_HOLD_VIOLATION} \
--advanced.param compiler.userPostSysLinkOverlayTcl=scripting/post_link.tcl \
--platform ./platform/WorkSpace/zcu106_custom/export/zcu106_custom/zcu106_custom.xpfm \
--config ./scripting/connections.cfg \
./build/tanimoto.xo \
./build/hls_dma.xo \
--save-temps \
-o ./build/tanimoto_krnl.xclbin
cp -rf ./_x/link/vivado/vpl/prj/prj.runs/impl_1/system_wrapper.bit ./platform/WorkSpace/petalinux_project/images/linux/system.bit
xclbin_debug:
@echo "############################################################################"
@echo "# COMPILING XCLBIN FOR ILA USE"
@echo "############################################################################"
rm -rf _x
rm -rf .Xil
v++ -t hw \
--link \
--log_dir ./logs/xclbin \
--report_dir ./logs/xclbin \
--advanced.param compiler.errorOnHoldViolation=${ERROR_ON_HOLD_VIOLATION} \
--advanced.param compiler.userPostSysLinkOverlayTcl=scripting/post_link.tcl \
--platform ./platform/WorkSpace/zcu106_custom/export/zcu106_custom/zcu106_custom.xpfm \
--config ./scripting/connections_debug.cfg \
./build/tanimoto.xo \
./build/hls_dma.xo \
--save-temps \
-o ./build/tanimoto_krnl.xclbin
clean_platform:
rm -rf platform/WorkSpace/zcu106_custom_platform/
rm -rf platform/WorkSpace/zcu106_custom/
rm -rf platform/WorkSpace/device-tree-xlnx/
rm -rf platform/WorkSpace/mydevice/
rm -rf platform/WorkSpace/sysroot/
rm -rf platform/WorkSpace/tmp/
clean_workspace:
find platform/WorkSpace -mindepth 1 -maxdepth 1 \
! -name 'app_component' \
! -name 'device-tree-xlnx' \
! -name 'Makefile' \
! -name 'mydevice' \
! -name 'petalinux_build.sh' \
! -name 'petalinux_project' \
! -name 'platform_creation.py' \
! -name 'sysroot' \
! -name 'system-user.dtsi' \
! -name 'xilinx-zcu106-v2023.2-10140544.bsp' \
! -name 'xilinx-zynqmp-common-v2023.2' \
! -name 'zcu106_custom' \
! -name 'zcu106_custom_platform' \
! -name 'zcu106_custom_platform.tcl' \
-exec rm -rf {} +
clean:
@echo "############################################################################"
@echo "# CLEANING UP WORKSPACE"
@echo "############################################################################"
rm -rf logs
find . -type f -name '*.log' -delete
find . -type f -name '*.jou' -delete
find . -type f -name '*.str' -delete
rm -rf src/tanimoto_rtl
rm -rf _x
rm -rf .Xil
rm -rf platform/WorkSpace/.Xil
rm hls_dma.xo.compile_summary
rm tanimoto_krnl.xclbin.link_summary
rm -rf .ipcache
docs:
rm -rf README.md
cat docs/src_markdown/DOCS_HEADER.md > README.md
@echo "## RTL Kernel" >> README.md
cat docs/src_markdown/BIT_ADDER.md >> README.md
cat docs/src_markdown/BIT_CNTR.md >> README.md
cat docs/src_markdown/CNT1.md >> README.md
cat docs/src_markdown/COMPARATOR.md >> README.md
cat docs/src_markdown/VEC_CAT.md >> README.md
cat docs/src_markdown/TANIMOTO_TOP.md >> README.md
help:
@echo "platform: Create ZCU106 processor subsystem and the corresponding .xsa file."
@echo "kernel: Create all parts of the PL kernel. (rtl_ip, rtl_xo, hls_xo)"
@echo "rtl_ip: Create Vivado project from RTL sources and export .xsa file."
@echo "rtl_xo: Generate .xo file containing the RTL kernel."
@echo "hls_xo: Generate .xo file of the interface written in HLS."
@echo "xclbin: Generate .xclbin file that can be used as an OpenCL target in Vitis."
@echo "all: All of the above."
@echo "clean: Remove all generated and build files, except for platform build results and final .xo files."
@echo "clean_platform: Remove zcu106_custom_platform and zcu106_custom."
@echo "clean_workspace: Clean Vitis workspace files. Needs to be run for Vitis GUI to recognize platforms and the app_component."
@echo "docs: Compile documentation to README.md."
@echo "help: Print this message."