-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
91 lines (75 loc) · 2.59 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
# Copyright (c) 2024 RapidStream Design Automation, Inc. and contributors. All rights reserved.
# The contributor(s) of this file has/have agreed to the RapidStream Contributor License Agreement.
ROOT_DIR := $(shell git rev-parse --show-toplevel)
PLATFORM := xilinx_u280_gen3x16_xdma_1_202211_1
GRP_UTIL := $(ROOT_DIR)/common/util/get_group.py
KERNEL_NAME := VecAdd
SRC_DIR := design
TARGET := hw
RS_SCRIPT := $(CURDIR)/run.py
TEMP_DIR := $(CURDIR)/build/$(notdir $(RS_SCRIPT))
KERNEL_XO := $(TEMP_DIR)/$(KERNEL_NAME).xo
KERNEL_XCLBIN := $(TEMP_DIR)/$(KERNEL_NAME).xclbin
RS_KERNEL_XCLBIN := $(TEMP_DIR)/$(KERNEL_NAME)_rs.xclbin
INCLUDE := -I $(XILINX_HLS)/include
CFLAGS := $(INCLUDE) $(OPT_LEVEL)
CXX := g++
HOST := app.exe
RS_TARGET := $(TEMP_DIR)/dse/candidate_0/exported/VecAdd.xo
TIMING_RPT := impl_1_hw_bb_locked_timing_summary_routed.rpt
SUCCESS := "Build Successful"
SLACK_GETTER := $(ROOT_DIR)/common/util/get_slack.py
BUILD_LOG := $(TEMP_DIR)/build.json
RSXX := rapidstream
all: $(RS_KERNEL_XCLBIN)
$(RSXX) $(SLACK_GETTER) -d $(TEMP_DIR) -i $(TIMING_RPT) -o $(BUILD_LOG) -c clk_kernel_00_unbuffered_net -p 3.333
echo $(SUCCESS)
$(RS_KERNEL_XCLBIN): $(RS_TARGET)
v++ -l -t ${TARGET} \
--platform $(PLATFORM) \
--kernel $(KERNEL_NAME) \
--connectivity.nk $(KERNEL_NAME):1:$(KERNEL_NAME) \
--config $(SRC_DIR)/link_config.ini \
--temp_dir $(TEMP_DIR) \
-o $@ \
$^
rs_opt:$(RS_TARGET)
$(RS_TARGET): $(KERNEL_XO)
$(RSXX) $(RS_SCRIPT)
$(KERNEL_XCLBIN): $(KERNEL_XO)
v++ -l -t ${TARGET} \
--platform $(PLATFORM) \
--kernel $(KERNEL_NAME) \
--connectivity.nk $(KERNEL_NAME):1:$(KERNEL_NAME) \
--config $(SRC_DIR)/link_config.ini \
--temp_dir $(TEMP_DIR) \
-o $@ \
$^
sw_emu: $(KERNEL_XCLBIN) $(HOST)
XCL_EMULATION_MODE=sw_emu ./app.exe $<
hw: $(KERNEL_XCLBIN) $(HOST)
xo:$(KERNEL_XO)
$(KERNEL_XO): $(SRC_DIR)/$(KERNEL_NAME).cpp $(SRC_DIR)/$(KERNEL_NAME).h
v++ -c -t ${TARGET} \
--platform $(PLATFORM) \
-k $(KERNEL_NAME) \
--temp_dir $(TEMP_DIR) \
-o $@ \
$^
host:$(HOST)
$(HOST): $(SRC_DIR)/host.cpp
$(CXX) -Wall -g -std=c++11 $^ -o app.exe \
-I${XILINX_XRT}/include/ \
-I${XILINX_VIVADO}/include/ \
-L${XILINX_XRT}/lib/ -lOpenCL -lpthread -lrt -lstdc++
csim:$(SRC_DIR)/main.cpp $(SRC_DIR)/VecAdd.cpp
$(CXX) $(CFLAGS) $^ -o main.exe
./main.exe
show_groups:
rapidstream $(GRP_UTIL) -i $(TEMP_DIR)/passes/0-imported.json \
-o $(TEMP_DIR)/module_types.csv
clean:
rm -rf $(TEMP_DIR) *.log
rm -rf .Xil .run
rm -rf *.exe
rm -rf .ipcache