This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
options.cmake
66 lines (52 loc) · 2.65 KB
/
options.cmake
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
# These options can be set with command line: e.g cmake . -DTESTS=ON
# or by UI (e.g ccmake)
# Check tests before actual build
option(TESTS "Set to ON to build and run tests" OFF)
# Do ABFT on hw or sw
option(ENABLE_HARDWARE_ABFT "Set to ON to build accelerator with ABFT" ON)
option(NODSP "Do not use DSP for convolution kernel" OFF)
# Clocking wizard input clock (AXI clock)
set(INPUT_CLK 100.f CACHE STRING "Clocking wizard iput clock (MHz)")
set(SAFE_CLK 100.f CACHE STRING "Static safe frequency (MHz) - only used for speedup measurements")
# Datamover and accelerator clock IDs
set(DMCLKID 0 CACHE STRING "Data mover clock ID")
set(CLKID 1 CACHE STRING "Accelerator clock ID")
# Version of SDx for headers/libraries
set(SDXVERSION "2018.2" CACHE STRING "SDx version for headers/libraries (you still need to source settings64.sh)")
set(XILINXPATH "/opt/Xilinx" CACHE STRING "Path to Xilinx's tool installation directory")
# Target SDSoC platform, either name for a standard one, or an path
# (in which case it will be resolved to an absolute path)
set(PLATFORM "/path/to/platform/zc706oc" CACHE STRING "SDx platform (path or standard name)")
set(SDSARGS "--remote_ip_cache ~/ip_cache -sds-sys-config linux -sds-proc linux" CACHE STRING "sds compiler-specific arguments")
# number of batches (independent inputs)
set(BATCHES 2 CACHE STRING "batches")
# Tile sizes
set(Tr 13 CACHE STRING "Tile size (rows)")
set(Tc 13 CACHE STRING "Tile size (columns)")
set(Tn 32 CACHE STRING "Tile size (input feature maps) /!\ Needs to be a factor of Un")
set(Tm 64 CACHE STRING "Tile size (output feature maps) /!\ Needs to be a factor of Um")
# Unroll factor
# Note: HW uses 4 * Um * Un DSP for convolution, zybo has 80
set(Um 16 CACHE STRING "Unroll factor on M dimension")
set(Un 32 CACHE STRING "Unroll factor on N dimension")
# Convolution parameters
set(N 192 CACHE STRING "Convolution input feature maps")
set(M 128 CACHE STRING "Convolution output feature maps")
set(R 13 CACHE STRING "Convolution output rows")
set(C 13 CACHE STRING "Convolution output columns")
set(K 3 CACHE STRING "Convolution kernel size")
set(S 1 CACHE STRING "Convolution stride. /!\ Keep S=1. Non-strided convolution and checksums are not fully implemented!")
set(DATA_WL 16 CACHE STRING "Convolution data word length for i/o (doubled for internal results)")
# Enable 8 bits mode
if(DATA_WL LESS "2")
set(NODSP ON)
endif()
# elseif(DATA_WL LESS "9")
# # elseif(DATA_WL EQUAL "8")
# set(OPTIDSP ON)
# math(EXPR OPTIDSPSTEPS "1 + (24 - ${DATA_WL}) / (2 * ${DATA_WL})")
# endif()
set(OPTIDSP OFF)
# Compute some values based on options
math(EXPR K2 "${K} * ${K}")
math(EXPR OUTPUT_FIFO_DEPTH "${Tr} * ${Tc} * ${Tm} / ${Um}")