-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdsagen2.mk
96 lines (79 loc) · 2.83 KB
/
dsagen2.mk
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
# Directory setup
SS_APPS ?= $(SS)/dsa-apps
DSAGEN_MF_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
DSAGEN_DIR ?= $(dir $(DSAGEN_MF_PATH))
ADG_DIR ?= $(DSAGEN_DIR)adg
SS_BINARY_DIR ?= $(DSAGEN_DIR)workloads
ifndef DSAGEN_DIR
$(error DSAGEN_DIR is unset. You must set it yourself)
else
# $(info Running with DSAGEN_DIR=$(DSAGEN_DIR))
export ADG_DIR=$(DSAGEN_DIR)adg
endif
# Workloads set
WORKLOAD_SET := vision machsuite dsp
# Workloads (SS: Stream Specialized)
MICROBENCH := \
vecadd vecmax matadd move submat transpose triangle fansum slp coal dual copy copy-4d \
pad acc max-acc prefix sr fanout tri-simp move-spad spad mv mv-unroll invariant outer update-trivial cdiv \
ind-simple ind-diverge ind-1d-2d ind-2d-read ind-2d-acc update update-nb update-small mvo mvo-no-pipe sr-sum \
biased-mv \
#hist join buffet buffet-4d # not tested
#acc-pene norm norm-2d temporal # broken
# Xilinx Vitis Vision Kernels
VISION_KERNELS := accumulate accumulate_weighted accumulate_squared blur vecmax convert_bitdepth channel_extract bgr2grayscale derivative
# MachSuite Kernels
MACHSUITE_KERNELS := stencil-3d stencil-2d gemm ellpack crs #backprop
# DSP Kernels
DSP_KERNELS := mm2 fft cholesky solver fir
# Default workloads
ifeq ($(WORKLOAD), vision)
SS_TESTS := $(VISION_KERNELS)
SS_APP_DIR := $(SS_APPS)/compiled/MultiCore/Vision
else ifeq ($(WORKLOAD), machsuite)
SS_TESTS := $(MACHSUITE_KERNELS)
SS_APP_DIR := $(SS_APPS)/compiled/MultiCore/MachSuite
else ifeq ($(WORKLOAD), dsp)
SS_TESTS := $(DSP_KERNELS)
SS_APP_DIR := $(SS_APPS)/compiled/MultiCore/Dsp
else
WORKLOAD := microbench
SS_TESTS := $(MICROBENCH)
SS_APP_DIR := $(SS_APPS)/compiled/Tests
endif
# Default Hardware (Architecture Description Graph, ADG)
ifndef ADG
ADG := $(ADG_DIR)/Mesh7x5-Full64-Full7I5O.json
endif
# Run all Stream Specialized workloads
ss-run-%:
make CONFIG=$(CONFIG) BINARY=$(SS_BINARY_DIR)/$(WORKLOAD)/ss-$*.riscv run-binary-fast
.PHONY: ss-run
ss-run: $(addprefix ss-run-, $(SS_TESTS))
# Debug all Stream Specialized workloads
ss-debug-%:
make CONFIG=$(CONFIG) BINARY=$(SS_BINARY_DIR)/$(WORKLOAD)/ss-$*.riscv run-binary-debug
.PHONY: ss-debug
ss-debug: $(addprefix ss-debug-, $(SS_TESTS))
# Compile each workload set
compile-%:
make -j -C workloads WORKLOAD=$* all
# Clean each workload set
clean-%:
rm -rf workloads/$*
make -C workloads WORKLOAD=$* clean
# Run each workload set
run-%:
make -j WORKLOAD=$* ss-run
debug-%:
make -j WORKLOAD=$* ss-debug
# Run all workload sets
runall: $(addprefix run-, $(WORKLOAD_SET))
debugall: $(addprefix debug-, $(WORKLOAD_SET))
# Collect result
collectcycle-%:
$(SS_APPS)/compiled/Common/wash_trace.sh $(SS_BINARY_DIR)/$(WORKLOAD)/ss-$*.riscv $(output_dir)/ss-$*.out
collectcycle: $(addprefix collectcycle-, $(SS_TESTS))
collectset-%:
make WORKLOAD=$* collectcycle
collectall: $(addprefix collectset-, $(WORKLOAD_SET))