-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
196 lines (161 loc) · 5.64 KB
/
Makefile
File metadata and controls
196 lines (161 loc) · 5.64 KB
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
# MIT License
# Copyright (c) 2025 Giuseppe Sorrentino, Paolo Salvatore Galfano, Davide Conficconi, Eleonora D'Arnese
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
ECHO=@echo
.PHONY: help
APP_NAME ?= trilli_app
TARGET := hw
PLATFORM := xilinx_vck5000_gen4x8_xdma_2_202210_1
help::
$(ECHO) "Makefile Usage:"
$(ECHO) " make build_hw [TARGET=hw_emu]"
$(ECHO) ""
$(ECHO) " make build_sw"
$(ECHO) ""
$(ECHO) " make clean"
$(ECHO) ""
CFG = default.cfg
CONFIG = $(abspath $(CFG))
include ${CONFIG}
# can be either STEP or TX
TASK := STEP
hw_dependencies := compile_aie compile_data_movers
ifeq ($(TASK),STEP)
hw_dependencies += compile_krnl_mutual_info
else ifneq ($(TASK),TX)
$(error TASK must be either STEP or TX: `$(TASK)` is not valid)
endif
build_hw: $(hw_dependencies) hw_link
compile_aie:
make -C ./aie aie_compile
compile_krnl_mutual_info:
make -C ./mutual_info compile TARGET=$(TARGET) PLATFORM=$(PLATFORM)
compile_data_movers:
make -C ./data_movers compile TARGET=$(TARGET) PLATFORM=$(PLATFORM)
hw_link:
make -C ./hw all TARGET=$(TARGET) PLATFORM=$(PLATFORM)
# Build software object
build_sw:
make -C ./sw all
build_app:
make -C ./3DIRG_application build_host EXECUTABLE=$(APP_NAME)
config:
$(info using config file $(CONFIG))
$(info )
$(info ************ Generating configuration files ************)
$(info - DIMENSION $(DIMENSION))
$(info - N_COUPLES $(N_COUPLES))
$(info - N_COUPLES_MAX $(N_COUPLES_MAX))
$(info - HIST_PE $(HIST_PE))
$(info - ENTROPY_PE $(ENTROPY_PE))
$(info - INT_PE $(INT_PE))
$(info - PIXELS_PER_READ $(PIXELS_PER_READ))
$(info ********************************************************)
$(info )
cd common/generator && python3 generator.py -vts -id $(DIMENSION) -ncm $(N_COUPLES_MAX) -pe $(HIST_PE) -pen $(ENTROPY_PE) -intpe $(INT_PE) -op ../ -ppr $(PIXELS_PER_READ)
mv common/mutual_info.hpp mutual_info/include/hw/mutualInfo
make -C ./aie generate_input_data
make -C ./hw generate_config
make -C ./data_movers generate_movers_body
make -C ./sw switch_dataset
config_and_build:
echo make config
echo make build_hw
echo make build_sw
testbench:
make -C ./data_movers testbench_all
testbench_c:
make -C ./aie aie_compile_x86
make -C ./data_movers testbench_all
testbench_noaie:
make -C ./data_movers testbench_noaie
NAME := hw_build
XCLBIN := hw/overlay_hw.xclbin
pack:
mkdir -p build/$(NAME)/dataset
mkdir -p build/$(NAME)/dataset_output
mkdir -p build/$(NAME)/dataset_sw_output
rm -f sw/dataset/*.png
cp -r sw/dataset/** build/$(NAME)/dataset/
cp sw/host_overlay.exe build/$(NAME)/
cp $(XCLBIN) build/$(NAME)/overlay_hw.xclbin
cp sw/generate_dataset.sh build/$(NAME)/
cp sw/remove_dataset.sh build/$(NAME)/
cp scripts/run_scaling_depth.sh build/$(NAME)/
cp scripts/run_for_SoA_comparison.sh build/$(NAME)/
cp $(CONFIG) build/$(NAME)/
$(info )
$(info Packed application in build/$(NAME)/ using bitstream $(XCLBIN))
$(info )
pack_app: build_app
mkdir -p build/$(NAME)/PET/
mkdir -p build/$(NAME)/CT/
cp scripts/README.txt build/$(NAME)/PET/
cp scripts/README.txt build/$(NAME)/CT/
cp $(XCLBIN) build/$(NAME)/overlay_hw.xclbin
cp -r 3DIRG_application/$(APP_NAME) build/$(NAME)/
cp exec.sh build/$(NAME)/
cp 3DIRG_application/generate_dataset.sh build/$(NAME)/
cp 3DIRG_application/remove_dataset.sh build/$(NAME)/
cp sw/dataset/duplicate_slices.sh build/$(NAME)/PET/
cp sw/dataset/duplicate_slices.sh build/$(NAME)/CT/
cp -r sw/dataset/size_512 build/$(NAME)/PET/
cp -r sw/dataset/size_512 build/$(NAME)/CT/
cp $(CONFIG) build/$(NAME)/
$(info )
$(info Packed application in build/$(NAME)/ using bitstream $(XCLBIN))
$(info )
build_and_pack_app:
$(info )
$(info *********************** Building ***********************)
$(info - NAME $(NAME))
$(info - TARGET $(TARGET))
$(info - PLATFORM $(PLATFORM))
$(info ********************************************************)
$(info )
make config
make build_hw
make build_app
make pack_app
build_and_pack:
$(info )
$(info *********************** Building ***********************)
$(info - NAME $(NAME))
$(info - TARGET $(TARGET))
$(info - PLATFORM $(PLATFORM))
$(info ********************************************************)
$(info )
make config
make build_hw
make build_sw
make pack
# Clean objects
clean: clean_aie clean_mutual_info clean_data_movers clean_hw clean_sw
clean_mutual_info:
make -C ./mutual_info clean
clean_aie:
make -C ./aie clean
clean_krnl_histogram:
make -C ./krnl_histogram clean
clean_data_movers:
make -C ./data_movers clean
clean_hw:
make -C ./hw clean
clean_sw:
make -C ./sw clean
clean_app:
make -C ./3DIRG_application EXECUTABLE=$(APP_NAME) clean