forked from dsrankin/HCAL_HLS4ML
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (35 loc) · 1.72 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
include $(GALAPAGOS_PATH)/include.mk
middleware_path = $(GALAPAGOS_PATH)/middleware
hls_path = $(middleware_path)/hls
python_path = $(middleware_path)/python
SRC_LIB=$(GALAPAGOS_PATH)/middleware/libGalapagos
CXXFLAGS = -DCPU -O2 -std=c++17 -pthread -isystem $(XILINX_VIVADO)/include -I$(GALAPAGOS_PATH)/middleware/include -I$(SRC_LIB) -I$(GALAPAGOS_PATH)/util/spdlog/include -I../nnet_utils
LDFLAGS = -lpthread
BOOST_LDFLAGS=-lboost_thread -lboost_system $(LDFLAGS)
MIDDLEWARE_DIR= $(shell pwd)/middlewareInput
CONFIG_DIR = conf_oneFPGA
LOGICALFILE= $(MIDDLEWARE_DIR)/$(CONFIG_DIR)/logical.xml
MAPFILE= $(MIDDLEWARE_DIR)/$(CONFIG_DIR)/map.xml
PROJECTNAME = test
all: hls4ml_hcal.o
hls4ml_hcal.o: hls4ml_hcal.cpp
$(CXX) $(CXXFLAGS) -c hls4ml_hcal.cpp -o $@ $(BOOST_LDFLAGS)
ereg_v1.o: ereg_v1.cpp
$(CXX) $(CXXFLAGS) -c ereg_v1.cpp -o $@ $(BOOST_LDFLAGS)
hls:
vivado_hls generate_hls.tcl
middleware:
python3.5 ${python_path}/globalFPGAParser.py --logicalFile=${LOGICALFILE} \
--mapFile=${MAPFILE} --projectName=${PROJECTNAME}
chmod +x $(GALAPAGOS_PATH)/projects/$(PROJECTNAME)/createCluster.sh
hlsmiddleware:
$(MAKE) -C $(hls_path)
cpu_send.exe: ereg_v1.o hls4ml_hcal.o cpu_send.cpp
$(CXX) $(CXXFLAGS) -I$(SRC_LIB) -I$(GALAPAGOS_PATH)/util/argparse -DCPU -DLOG_LEVEL=0 $^ -o $@ $(BOOST_LDFLAGS)
cpu_compute.exe: ereg_v1.o hls4ml_hcal.o cpu_compute.cpp
$(CXX) $(CXXFLAGS) -I$(SRC_LIB) -I$(GALAPAGOS_PATH)/util/argparse -DCPU -DLOG_LEVEL=0 $^ -o $@ $(BOOST_LDFLAGS)
cpu_node.exe: ereg_v1.o hls4ml_hcal.o cpu_node.cpp
$(CXX) $(CXXFLAGS) -I$(SRC_LIB) -I$(GALAPAGOS_PATH)/util/argparse -DCPU -DLOG_LEVEL=0 $^ -o $@ $(BOOST_LDFLAGS)
clean:
rm -rf $(GALAPAGOS_PATH)/hlsBuild/$(GALAPAGOS_BOARD_NAME)/ip/hls4ml_hcal
rm -rf *.exe *.txt *.o