-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
215 lines (162 loc) · 8.78 KB
/
CMakeLists.txt
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
cmake_minimum_required(VERSION 3.12)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_COMPILER_LAUNCHER "ccache")
set(CMAKE_CXX_COMPILER_LAUNCHER "ccache")
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
if(TOOLCHAIN STREQUAL GCC)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
set(platform MemPool CACHE STRING "Platform (MemPool, QEMU, Siracusa, Siracusa_w_neureka, PULP-Open, Generic, Snitch)")
set_property(CACHE platform PROPERTY STRINGS MemPool QEMU Siracusa Siracusa_w_neureka PULP-Open Generic Snitch)
if(platform STREQUAL MemPool)
message(STATUS "Building for platform 'MemPool'")
elseif(platform STREQUAL QEMU-ARM)
message(STATUS "Building for platform 'QEMU-ARM'")
elseif(platform STREQUAL Siracusa)
message(STATUS "Building for platform 'Siracusa'")
elseif(platform STREQUAL Siracusa_w_neureka)
message(STATUS "Building for platform 'Siracusa_w_neureka'")
elseif(platform STREQUAL PULPOpen)
message(STATUS "Building for platform 'PULP-Open'")
elseif(platform STREQUAL Generic)
message(STATUS "Building for platform 'Generic'")
elseif(platform STREQUAL Snitch)
message(STATUS "Building for platform 'Snitch'")
else()
message(FATAL_ERROR "Invalid platform '${platform}' specified!")
endif()
# Import useful functions / macros
include(${CMAKE_CURRENT_LIST_DIR}/cmake/Util.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/common.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/simulation.cmake)
message(STATUS "============================= Project Configuration ============================")
message(STATUS "[Deeploy] platform = " ${platform})
message(STATUS "[Deeploy] use_dma = " ${use_dma})
message(STATUS "================================================================================")
message(STATUS "")
if(platform STREQUAL MemPool)
set(mempool_flavour mempool_ita CACHE STRING "Platform (mempool, mempool_ita or minpool)")
set_property(CACHE mempool_flavour PROPERTY STRINGS mempool minpool mempool_ita)
if(TOOLCHAIN STREQUAL LLVM)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/mempool/toolchain_llvm.cmake)
else()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/mempool/toolchain_gcc.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/mempool/${mempool_flavour}.cmake)
project(deeploy LANGUAGES C ASM)
add_subdirectory(TargetLibraries/MemPool)
add_subdirectory(TargetLibraries/Generic)
add_subdirectory(DeeployTest)
target_include_directories(deeploymempool PUBLIC TargetLibraries/Generic/inc)
target_link_libraries(deeploylib INTERFACE deeploymempool deeploybasic)
message(STATUS "============================= MemPool Configuration ============================")
message(STATUS "[cMake ] mempool_flavour = " ${mempool_flavour})
message(STATUS "[cMake ] boot_addr = " ${boot_addr})
message(STATUS "[cMake ] l2_base = " ${l2_base})
message(STATUS "[cMake ] l2_size = " ${l2_size})
message(STATUS "[cMake ] l2_banks = " ${l2_banks})
message(STATUS "[cMake ] seq_mem_size = " ${seq_mem_size})
message(STATUS "[cMake ] stack_size = " ${stack_size})
message(STATUS "[cMake ] axi_data_width = " ${axi_data_width})
message(STATUS "[cMake ] ro_line_width = " ${ro_line_width})
message(STATUS "[cMake ] dmas_per_group = " ${dmas_per_group})
message(STATUS "[cMake ] xqueue_size = " ${xqueue_size})
message(STATUS "[cMake ] xpulpimg = " ${xpulpimg})
message(STATUS "[cMake ] num_cores = " ${num_cores})
message(STATUS "[cMake ] num_eff_cores = " ${num_eff_cores})
message(STATUS "[cMake ] num_groups = " ${num_groups})
message(STATUS "[cMake ] num_cores_per_tile = " ${num_cores_per_tile})
message(STATUS "[cMake ] banking_factor = " ${banking_factor})
message(STATUS "[cMake ] axi_hier_radix = " ${axi_hier_radix})
message(STATUS "[cMake ] axi_masters_per_group = " ${axi_masters_per_group})
if(mempool_flavour STREQUAL mempool_ita)
message(STATUS "=============================== ITA Configuration ==============================")
message(STATUS "[cMake ] ita_pe = " ${ita_pe})
endif()
message(STATUS "================================================================================")
message(STATUS "")
endif()
if(platform STREQUAL Generic)
if(TOOLCHAIN STREQUAL LLVM)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/generic/toolchain_llvm.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/generic/generic.cmake)
project(deeploy LANGUAGES C ASM)
message(STATUS "============================= Generic Configuration ============================")
message(STATUS "[cMake ] CPU = " ${CMAKE_SYSTEM_PROCESSOR})
message(STATUS "================================================================================")
message(STATUS "")
add_subdirectory(TargetLibraries/Generic)
add_subdirectory(DeeployTest)
target_link_libraries(deeploylib INTERFACE deeploybasic)
endif()
if(platform STREQUAL QEMU-ARM)
if(TOOLCHAIN STREQUAL LLVM)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/cmsis/toolchain_llvm.cmake)
else()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/cmsis/toolchain_gcc.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/cmsis/cmsis.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/cmsis/qemu.cmake)
project(deeploy LANGUAGES C ASM)
message(STATUS "============================= QEMU Configuration ============================")
message(STATUS "[cMake ] CPU = " ${CPU})
message(STATUS "[cMake ] FABI = " ${FABI})
message(STATUS "[cMake ] FPU = " ${FPU})
message(STATUS "================================================================================")
message(STATUS "")
add_subdirectory(TargetLibraries/Generic)
add_subdirectory(TargetLibraries/CMSIS)
add_subdirectory(DeeployTest)
target_include_directories(deeploycmsis PUBLIC TargetLibraries/Generic/inc)
target_link_libraries(deeploylib INTERFACE deeploybasic deeploycmsis)
endif()
if(platform STREQUAL Siracusa OR platform STREQUAL Siracusa_w_neureka OR platform STREQUAL PULPOpen)
if(TOOLCHAIN STREQUAL LLVM)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/pulp/toolchain_llvm.cmake)
else()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/pulp/toolchain_gcc.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/pulp/pulp.cmake)
if(platform STREQUAL Siracusa OR platform STREQUAL Siracusa_w_neureka)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/pulp/siracusa/siracusa.cmake)
elseif(platform STREQUAL PULPOpen)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/pulp/pulp-open/pulp-open.cmake)
endif()
project(deeploy LANGUAGES C ASM)
message(STATUS "============================= ${platform} Configuration ============================")
message(STATUS "[cMake ] ISA = " ${ISA})
message(STATUS "[cMake ] Cluster Cores = " ${PE})
message(STATUS "[cMake ] Fabric Controller = " ${FC})
message(STATUS "[cMake ] Number of used cores = " ${NUM_CORES})
message(STATUS "================================================================================")
message(STATUS "")
add_subdirectory(TargetLibraries/Generic)
add_subdirectory(TargetLibraries/PULPOpen)
target_include_directories(deeploypulp PUBLIC TargetLibraries/Generic/inc)
add_subdirectory(DeeployTest)
target_link_libraries(deeploylib INTERFACE deeploybasic deeploypulp)
endif()
if(platform STREQUAL Snitch)
if(TOOLCHAIN STREQUAL LLVM)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/snitch/toolchain_llvm.cmake)
else()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/snitch/toolchain_gcc.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/snitch/snitch.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/snitch/snitch_cluster/snitch_cluster.cmake)
project(deeploy LANGUAGES C ASM)
message(STATUS "============================= ${platform} Configuration ============================")
message(STATUS "[cMake ] Number of total cores = " ${NUM_CORES})
message(STATUS "================================================================================")
message(STATUS "")
add_subdirectory(TargetLibraries/Generic)
add_subdirectory(TargetLibraries/Snitch)
target_include_directories(deeploysnitch PUBLIC TargetLibraries/Generic/inc)
add_subdirectory(DeeployTest)
target_link_libraries(deeploylib INTERFACE deeploybasic deeploysnitch)
endif()
print_simulation_config()