-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (67 loc) · 2.54 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
# Todo: write help for this Makefile which is printed in a target
# -------------------------------- General definitions --------------------------------
# CPP compiler
CC = g++
# Python interpreter
PYTHON = python3
# Vitis V++ compiler
VPP = v++
RM = rm -rf
# Makefile path (absolute)
MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
# Project path
PROJ_ROOT := $(patsubst %/,%,$(dir $(MK_PATH)))
SRC_ROOT := $(PROJ_ROOT)/src
INC_ROOT := $(PROJ_ROOT)/include
BIN_DIR := $(PROJ_ROOT)/bin
# Xilinx root directory
XLX_ROOT := $(SRC_ROOT)
# Refrence source directory
SRC_REF := $(SRC_ROOT)/reference
# Test matrix data path
DATA_PATH := $(PROJ_ROOT)/data
# ---------------------------------- Xilinx definitions ------------------------------------
# Implicit targets for kernels and related utilities are defined in the following included file
include ./xilinx.mk
XLX_EXEC_ARGS += $(XLX_SINGLE_XCLBIN) #bin/build_dir.hw.1/hihispmv.xclbin
## Some interesting matrices
XLX_MATRIX := psmigr_2/psmigr_2_row_sorted.mtx
XLX_DEVICE_ID := 0 # Deviced Id
XLX_TEST := 0 # Test Type
XLX_CU_COUNT := 16 # Compute Units
XLX_TILES := 0 # Tiles in a partition - Inactive for now
XLX_PART_METHOD := 2 # Partition method
XLX_ITERS := 100 # Iterations
XLX_RUNS := 10 # Runs
HW_SIZE := 1875 # Hardware size (max. square tile size)
XLX_EXEC_ARGS += $(DATA_PATH)/$(XLX_MATRIX) $(XLX_DEVICE_ID) $(XLX_TEST) $(XLX_CU_COUNT) \
$(XLX_TILES) $(HW_SIZE) $(XLX_PART_METHOD) $(XLX_ITERS) $(XLX_RUNS)
# ---------------------------------------- Pre targets -------------------------------------
.pre:
mkdir -p $(BIN_DIR)
.pre_xilinx: .pre
mkdir -p $(XLX_TEMP_DIR)
mkdir -p $(XLX_BUILD_DIR)
# -------------------------------- Xilinx specific targets --------------------------------
build_xilinx_spmv_host: .pre
$(CC) $(CXXFLAGS_XILINX) $(XLX_SPMV_HOST_SRC) -o $(XLX_SPMV_HOST_BIN) $(CXXLDFLAGS_XILINX)
# ------------ Explicit XO compilation targets for implcit targets in "xilinx.mk" ------------
# Explicit XCLBIN compilation targets for implcit targets in "xilinx.mk"
build_xilinx_spmv_xclbin: $(XLX_SINGLE_XCLBIN)
# Emulator config. generation
emconfig:
ifeq ($(TARGET),$(filter $(TARGET), sw_emu hw_emu))
emconfigutil --platform $(PLATFORM) --od bin/
endif
# Execute xilinx
test_xilinx_spmv:
$(EXEC_PRE_COMMAND) $(XLX_SPMV_HOST_BIN) $(XLX_EXEC_ARGS)
# -------------------------------- Misc. targets --------------------------------
clean:
$(RM) $(XLX_SPMV_HOST_BIN)
$(RM) *.log
$(RM) *.out
cleanall: clean
$(RM) $(BIN_DIR)
$(RM) $(DATA_PATH)
git clean -dXf