blob: 0581a2cf2d6fd428586b75e045fe4d2a339a89ae [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001#----------------------------------------------------------------------------
2# Copyright (c) 2021 Arm Limited. All rights reserved.
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#----------------------------------------------------------------------------
17# minimum version of cmake = 3.15 for legit reason:
18# armclang support doesn't work work in previous releases
19cmake_minimum_required(VERSION 3.15.0)
20
21# Build in release mode by default
22if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
23 set(CMAKE_BUILD_TYPE Release CACHE INTERNAL "")
24endif()
25
26message(STATUS "Build type is set to ${CMAKE_BUILD_TYPE}")
27
28# Set language standards. TensorFlow Lite requires
29# std=c++11.
30set(CMAKE_C_STANDARD 99)
31set(CMAKE_CXX_STANDARD 11)
32
33# Make the standard a requirement => prevent fallback to previous
34# supported standard
35set(CMAKE_C_STANDARD_REQUIRED ON)
36set(CMAKE_CXX_STANDARD_REQUIRED ON)
37
38# We want to pass standard C/C++ flags, without gnu extensions
39set(CMAKE_C_EXTENSIONS OFF)
40set(CMAKE_CXX_EXTENSIONS OFF)
41
42project(arm_ethos_u55_eval
43 VERSION 21.03
44 DESCRIPTION "ARM Ethos-U55 Evaluation application for MPS3 FPGA Prototyping Board and FastModel")
45
46add_compile_definitions(PRJ_VER_STR="${PROJECT_VERSION}")
47add_compile_definitions(PRJ_DES_STR="${PROJECT_DESCRIPTION}")
48
49set(CMAKE_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/)
50set(DOWNLOAD_DEP_DIR ${CMAKE_BINARY_DIR}/dependencies)
51
52include(${CMAKE_SCRIPTS_DIR}/source_gen_utils.cmake)
53include(${CMAKE_SCRIPTS_DIR}/util_functions.cmake)
54
55if (${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
56 message(FATAL_ERROR "Source and build are in the same directory")
57else()
58 message(STATUS "Source directory: ${CMAKE_SOURCE_DIR}")
59 message(STATUS "Binary directory: ${CMAKE_BINARY_DIR}")
60endif()
61
62USER_OPTION(LOG_LEVEL "Log level for the application"
63 LOG_LEVEL_INFO
64 STRING)
65
66USER_OPTION(TENSORFLOW_SRC_PATH "Path to the root of the tensor flow directory"
67 "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/tensorflow"
68 PATH)
69
70USER_OPTION(TARGET_PLATFORM "Target platform to execute evaluation application: mps3, simple_platform, native"
71 mps3
72 STRING)
73
alexanderd580eee2021-05-04 21:24:22 +010074USER_OPTION(TARGET_SUBSYSTEM "Specify platform target subsystem: sse-300 or none"
alexander3c798932021-03-26 21:42:19 +000075 sse-300
76 STRING)
77
78USER_OPTION(ETHOS_U55_ENABLED "Select if Ethos-U55 is available for the platform and subsystem"
79 ON
80 BOOL)
81
82USER_OPTION(USE_CASE_BUILD "Optional. Defines the use-case to build from the available sources. By default, all use-cases are built."
83 all
84 STRING)
85
86USER_OPTION(CPU_PROFILE_ENABLED "Output CPU performance profiling information. Should be used only for MPS3 board."
87 OFF
88 BOOL)
89
90if (TARGET_PLATFORM STREQUAL mps3)
91 message(STATUS "Platform: MPS3 FPGA Prototyping Board or SSE-XXX FVP")
92elseif (TARGET_PLATFORM STREQUAL simple_platform)
93 message(STATUS "Platform: Simple platform within minimal peripherals")
94elseif (TARGET_PLATFORM STREQUAL native)
95 message(STATUS "Platform: Native (Linux based x86_64/aarch64 system)")
96else ()
97 message(FATAL_ERROR "Invalid platform specified: ${TARGET_PLATFORM}")
98endif ()
99
100enforce_compiler_version()
101setup_source_generator()
102
103set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
104set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
105set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
106set(SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/source)
Isabella Gottardi85209832021-04-20 14:08:52 +0100107set(TEST_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/tests)
108list(APPEND USE_CASES_TESTS_SEARCH_DIR_LIST ${TEST_SRCS}/use_case)
alexander3c798932021-03-26 21:42:19 +0000109
110if (CPU_PROFILE_ENABLED)
111 set(PROFILING_OPT "${PROFILING_OPT} -DCPU_PROFILE_ENABLED")
112endif()
113
114# Include platform specific sources
115if (TARGET_PLATFORM STREQUAL native)
116 set(PLATFORM_SOURCES_CMAKE_FILE ${CMAKE_SCRIPTS_DIR}/${TARGET_PLATFORM}-sources.cmake)
117else ()
118 set(PLATFORM_SOURCES_CMAKE_FILE ${CMAKE_SCRIPTS_DIR}/bare-metal-sources.cmake)
119
120 USER_OPTION(CMSIS_SRC_PATH
121 "Path to CMSIS-5 sources"
122 "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/cmsis"
123 PATH
124 )
125
126 if (CMAKE_BUILD_TYPE STREQUAL Debug AND CMAKE_CXX_COMPILER_ID STREQUAL ARMClang)
127 USER_OPTION(ARMCLANG_DEBUG_DWARF_LEVEL
128 "Dwarf conformance level for armclang toolchain"
129 "4" # Default = 4 (Arm-DS etc). For model debugger specify "3"
130 STRING
131 )
132 elseif (DEFINED ARMCLANG_DEBUG_DWARF_LEVEL)
133 message(WARNING "ARMCLANG_DEBUG_DWARF_LEVEL definition is unsupported"
134 "within current configuration. Removing definition...")
135 unset(ARMCLANG_DEBUG_DWARF_LEVEL CACHE)
136 endif()
137
138endif ()
139message(STATUS "Including ${PLATFORM_SOURCES_CMAKE_FILE}")
140include(${PLATFORM_SOURCES_CMAKE_FILE})
141
142if (${CMAKE_CROSSCOMPILING})
143 enable_language(ASM)
144
145 # For non-native builds, we build with CMSIS-DSP support.
146 include(${CMAKE_SCRIPTS_DIR}/cmsis-dsp.cmake)
147
148 # All CMSIS headers to be used:
149 set(CMSIS_HEADERS
150 ${CMSIS_DSP_INC_DIR}
151 ${CMSIS_CORE_INC_DIR}
152 ${CMSIS_SRC_PATH}/Device/ARM/ARMCM55/Include
153 ${CMSIS_SRC_PATH}/Device/ARM/ARMCM55/Include/Template)
154endif ()
155
156# If we need NPU libraries:
157if (ETHOS_U55_ENABLED)
158
159 message(STATUS "Using ARM Ethos-U55 - adding core-driver and timing-adapter-driver includes and libraries")
160 USER_OPTION(ETHOS_U55_TIMING_ADAPTER_SRC_PATH
161 "Path to Ethos-U55 timing adapter sources"
162 "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/core-software/drivers/timing_adapter"
163 PATH
164 )
165
166 USER_OPTION(ETHOS_U55_DRIVER_SRC_PATH
167 "Path to Ethos-U55 core driver sources"
168 "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/core_driver"
169 PATH
170 )
171
172 include_directories("${ETHOS_U55_TIMING_ADAPTER_SRC_PATH}/include/")
173
174 add_subdirectory("${ETHOS_U55_TIMING_ADAPTER_SRC_PATH}" ${CMAKE_BINARY_DIR}/timing-adapter)
175
176 set(ETHOSU_INCLUDES ${ETHOS_U55_TIMING_ADAPTER_SRC_PATH}/include
177 ${ETHOS_U55_DRIVER_SRC_PATH}/include)
178
179 list(APPEND ETHOS_U55_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtiming_adapter.a)
180endif ()
181
182include(${CMAKE_SCRIPTS_DIR}/tensorflow.cmake)
183
184set(DEP_TENSORFLOW_LITE_MICRO_SUB_DIR ${TENSORFLOW_SRC_PATH}/tensorflow/lite/micro)
185set(DEP_TENSORFLOW_LITE_MICRO_MAKE_DIR ${DEP_TENSORFLOW_LITE_MICRO_SUB_DIR}/tools/make/targets)
186set(DEP_FLATBUF_INCLUDE ${DEP_TENSORFLOW_LITE_MICRO_SUB_DIR}/tools/make/downloads/flatbuffers/include)
187
188set(TENSORFLOW_LIBRARY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${TENSORFLOW_LITE_MICRO_PLATFORM_LIB_NAME})
189
190set(DEP_TF_INCLUDE_DIRS
191 ${TENSORFLOW_SRC_PATH}
192 ${DEP_TENSORFLOW_LITE_MICRO_SUB_DIR}
193 ${ETHOSU_INCLUDES}
194 ${CMSIS_HEADERS}
195 )
196
197## All TPIP includes
198set(DEP_RUNTIME_INCLUDE_DIRS
199 ${DEP_TF_INCLUDE_DIRS}
200 ${DEP_FLATBUF_INCLUDE}
201 )
202
203# Our entry point into tensorflow world:
204file(GLOB_RECURSE SRC_TENSORFLOW_LITE_MICRO
205 ${SRC_PATH}/application/tensorflow-lite-micro/**/*.cc
206 ${SRC_PATH}/application/tensorflow-lite-micro/*.cc
207 )
208
209set(HAL_DIR ${SRC_PATH}/application/hal)
210
211# HAL API sources
212file(GLOB_RECURSE SRC_HAL
213 "${HAL_DIR}/hal.c"
214 )
215
216# Set platform specific HAL sources; these should be provided
217# by each platform's cmake include file
218list(APPEND SRC_HAL ${SRC_PLAT_HAL})
219
220# Include directories:
221set(APPLICATION_INCLUDE_DIRS
222 ${HAL_DIR}/include
223 ${SRC_PATH}/application/tensorflow-lite-micro/include
224 ${SRC_PATH}/application/main/include
225 ${PLAT_INCLUDE_DIRS}
226 )
227
228file(GLOB_RECURSE SRC_APPLICATION
229 "${SRC_PATH}/application/main/*.cc"
230 "${SRC_PATH}/application/main/*.cpp"
231 "${SRC_PATH}/application/main/*.c"
232 "${SRC_PATH}/application/main/**/*.cc"
233 "${SRC_PATH}/application/main/**/*.cpp"
234 "${SRC_PATH}/application/main/**/*.c"
235 )
236list(FILTER SRC_APPLICATION EXCLUDE REGEX ".*main\\.c.*$")
237
238list(JOIN USE_CASE_BUILD "" USE_CASE_BUILD_STR)
Isabella Gottardi85209832021-04-20 14:08:52 +0100239list(APPEND USE_CASES_SEARCH_DIR_LIST ${SRC_PATH}/use_case)
240message(STATUS "Use-cases source paths: ${USE_CASES_SEARCH_DIR_LIST}.")
alexander3c798932021-03-26 21:42:19 +0000241if (${USE_CASE_BUILD_STR} STREQUAL all)
Isabella Gottardi85209832021-04-20 14:08:52 +0100242 foreach(USE_CASES_SEARCH_DIR ${USE_CASES_SEARCH_DIR_LIST})
243 SUBDIRLIST(USE_CASES_SUBDIRS ${USE_CASES_SEARCH_DIR})
244 list(APPEND USE_CASES ${USE_CASES_SUBDIRS})
245 endforeach()
alexander3c798932021-03-26 21:42:19 +0000246else()
247 set(USE_CASES ${USE_CASE_BUILD})
248endif()
249
alexander3c798932021-03-26 21:42:19 +0000250if (NOT ${CMAKE_CROSSCOMPILING})
251
252 #Test TPIP
253 set(TEST_TPIP ${DOWNLOAD_DEP_DIR}/test)
254 file(MAKE_DIRECTORY ${TEST_TPIP})
255 set(TEST_TPIP_INCLUDE ${TEST_TPIP}/include)
256 file(MAKE_DIRECTORY ${TEST_TPIP_INCLUDE})
257
258 include(ExternalProject)
259
260 ExternalProject_Add(catch2-headers
261 URL https://github.com/catchorg/Catch2/releases/download/v2.11.1/catch.hpp
262 DOWNLOAD_NO_EXTRACT 1
263 CONFIGURE_COMMAND ""
264 BUILD_COMMAND bash -c "cp -R <DOWNLOAD_DIR>/catch.hpp ${TEST_TPIP_INCLUDE}"
265 INSTALL_COMMAND ""
266 )
267endif ()
268
269message(STATUS "Building use-cases: ${USE_CASES}.")
270foreach(use_case ${USE_CASES})
271
Isabella Gottardi85209832021-04-20 14:08:52 +0100272 set(SRC_USE_CASE "")
273 foreach(USE_CASES_SEARCH_DIR ${USE_CASES_SEARCH_DIR_LIST})
274 if (EXISTS ${USE_CASES_SEARCH_DIR}/${use_case})
275 message(STATUS "Found sources for use-case ${use_case}")
276 set(SRC_USE_CASE ${USE_CASES_SEARCH_DIR})
277 break()
278 endif ()
279 endforeach()
280
281 if (${SRC_USE_CASE} STREQUAL "")
282 message(FATAL_ERROR "Failed to find sources for ${use_case}!")
alexander3c798932021-03-26 21:42:19 +0000283 endif ()
284 # Executable application:
285 set(TARGET_NAME "ethos-u-${use_case}")
286
Isabella Gottardi2181d0a2021-04-07 09:27:38 +0100287 set(DEFAULT_MODEL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources_downloaded/${use_case})
288 set(DEFAULT_TEST_DATA_DIR ${DEFAULT_MODEL_DIR})
alexander3c798932021-03-26 21:42:19 +0000289 set(SRC_GEN_DIR ${CMAKE_BINARY_DIR}/generated/${use_case}/src)
290 set(INC_GEN_DIR ${CMAKE_BINARY_DIR}/generated/${use_case}/include)
291
292 # Remove old files and recreate dirs
293 file(REMOVE_RECURSE ${SRC_GEN_DIR} ${INC_GEN_DIR})
294 file(MAKE_DIRECTORY ${SRC_GEN_DIR} ${INC_GEN_DIR})
295
296 file(GLOB_RECURSE UC_SRC
Isabella Gottardi85209832021-04-20 14:08:52 +0100297 "${SRC_USE_CASE}/${use_case}/src/*.cpp"
298 "${SRC_USE_CASE}/${use_case}/src/*.cc"
299 "${SRC_USE_CASE}/${use_case}/src/*.c"
300 "${SRC_USE_CASE}/${use_case}/src/**/*.cpp"
301 "${SRC_USE_CASE}/${use_case}/src/**/*.cc"
302 "${SRC_USE_CASE}/${use_case}/src/**/*.c"
alexander3c798932021-03-26 21:42:19 +0000303 )
304
305 set(UC_INCLUDE
Isabella Gottardi85209832021-04-20 14:08:52 +0100306 ${SRC_USE_CASE}/${use_case}/include
alexander3c798932021-03-26 21:42:19 +0000307 )
308
309 file(GLOB UC_CMAKE_FILE
Isabella Gottardi85209832021-04-20 14:08:52 +0100310 "${SRC_USE_CASE}/${use_case}/*.cmake"
alexander3c798932021-03-26 21:42:19 +0000311 )
312
313 include(${UC_CMAKE_FILE})
314
315 file(GLOB_RECURSE SRC_GEN
316 "${SRC_GEN_DIR}/*.cc"
317 "${SRC_GEN_DIR}/*.cpp"
318 "${SRC_GEN_DIR}/*.c"
319 )
320
321 set(SRC_MAIN
322 "${SRC_PATH}/application/main/Main.cc"
323 )
324
325 set(UC_LIB_NAME lib${TARGET_NAME})
326
327 # Consolidated application static lib:
328 add_library(${UC_LIB_NAME} STATIC
329 ${SRC_APPLICATION}
330 ${SRC_TENSORFLOW_LITE_MICRO}
331 ${SRC_HAL}
332 ${UC_SRC}
333 ${SRC_GEN}
334 )
335 target_include_directories(${UC_LIB_NAME} PUBLIC
336 ${APPLICATION_INCLUDE_DIRS}
337 ${DEP_RUNTIME_INCLUDE_DIRS}
338 ${UC_INCLUDE}
339 ${INC_GEN_DIR}
340 )
341
342 # Set the activation buffer size
343 target_compile_definitions(${UC_LIB_NAME} PUBLIC
344 "ACTIVATION_BUF_SZ=${${use_case}_ACTIVATION_BUF_SZ}")
345
346 add_dependencies(${UC_LIB_NAME} tensorflow-lite-micro)
347
348 if (${CMAKE_CROSSCOMPILING})
349 # If we are building timing adapter, set the dependency:
350 if (ETHOS_U55_ENABLED)
351 message(STATUS "Adding timing_adapter as a dependency to ${UC_LIB_NAME}")
352 add_dependencies(${UC_LIB_NAME} timing_adapter)
353 endif()
354
355 # If building with CMSIS-DSP support:
356 if (DEFINED CMSIS_DSP_TARGET)
357 message(STATUS "Adding ${CMSIS_DSP_TARGET} as a dependency to ${UC_LIB_NAME}")
358 add_dependencies(${UC_LIB_NAME} ${CMSIS_DSP_TARGET})
359 endif()
360 endif()
361
362 target_link_libraries(${UC_LIB_NAME} PUBLIC
363 ${TENSORFLOW_LIBRARY}
364 $<$<BOOL:${ETHOS_U55_ENABLED}>:${ETHOS_U55_LIBS}>
365 $<$<BOOL:${CMSIS_DSP_LIB}>:${CMSIS_DSP_LIB}>)
366
367 add_executable(${TARGET_NAME} ${SRC_MAIN})
368
369 target_link_libraries(${TARGET_NAME} ${UC_LIB_NAME})
370
371 if (${CMAKE_CROSSCOMPILING})
372 set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".axf")
373 endif()
374
375 if (${TARGET_PLATFORM} STREQUAL mps3)
376
377 SET(SECTORS_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sectors/${use_case})
378 file(REMOVE_RECURSE ${SECTORS_DIR})
379 file(MAKE_DIRECTORY ${SECTORS_DIR})
380
381 add_custom_command(TARGET ${TARGET_NAME}
382 POST_BUILD
383 COMMAND fromelf --bin --output=${SECTORS_DIR}/
384 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET_NAME}.axf)
385
386 add_custom_target(
387 run-${use_case} ALL
388 COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/py/gen_fpga_mem_map.py
389 --scatter_file_path ${SCAT_FILE}
390 --target_subsystem ${TARGET_SUBSYSTEM}
391 --output_file_path ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/images-${use_case}.txt
392 COMMENT "Generating FPGA mappings file")
393 elseif (${TARGET_PLATFORM} STREQUAL native)
Isabella Gottardi85209832021-04-20 14:08:52 +0100394
395 # If native build tests
396 set(TEST_SRC_USE_CASE "")
397 foreach(USE_CASES_TESTS_SEARCH_DIR ${USE_CASES_TESTS_SEARCH_DIR_LIST})
398
399 if (EXISTS ${USE_CASES_TESTS_SEARCH_DIR}/${use_case})
400 message(STATUS "Found tests for use-case ${use_case} at ${USE_CASES_TESTS_SEARCH_DIR}/${use_case}.")
401 set(TEST_SRC_USE_CASE ${USE_CASES_TESTS_SEARCH_DIR})
402 break()
403 endif ()
404 endforeach()
405
alexander3c798932021-03-26 21:42:19 +0000406 # Add tests only if they exists for the usecase
Isabella Gottardi85209832021-04-20 14:08:52 +0100407 if (NOT ${TEST_SRC_USE_CASE} STREQUAL "")
alexander3c798932021-03-26 21:42:19 +0000408
409 set(TEST_RESOURCES_INCLUDE
410 "${TEST_SRCS}/utils/"
Isabella Gottardicce00052021-04-26 09:24:02 +0100411 "${TEST_SRC_USE_CASE}/${use_case}/include/"
alexander3c798932021-03-26 21:42:19 +0000412 )
413
414 # Define Test sources and new target to run unit tests
415 file(GLOB_RECURSE TEST_SOURCES
416 "${TEST_SRCS}/common/*.cpp"
417 "${TEST_SRCS}/common/*.cc"
418 "${TEST_SRCS}/utils/*.cc"
419 "${TEST_SRCS}/utils/*.cpp"
Isabella Gottardi85209832021-04-20 14:08:52 +0100420 "${TEST_SRC_USE_CASE}/${use_case}/*.cpp"
421 "${TEST_SRC_USE_CASE}/${use_case}/*.cc"
422 "${TEST_SRC_USE_CASE}/${use_case}/*.c"
423 "${TEST_SRC_USE_CASE}/${use_case}/**/*.cpp"
424 "${TEST_SRC_USE_CASE}/${use_case}/**/*.cc"
425 "${TEST_SRC_USE_CASE}/${use_case}/**/*.c"
alexander3c798932021-03-26 21:42:19 +0000426 )
427
Isabella Gottardi2181d0a2021-04-07 09:27:38 +0100428 set(TEST_SRC_GEN_DIR ${CMAKE_BINARY_DIR}/generated/${use_case}/tests/src)
429 set(TEST_INC_GEN_DIR ${CMAKE_BINARY_DIR}/generated/${use_case}/tests/include)
430 file(MAKE_DIRECTORY ${TEST_SRC_GEN_DIR} ${TEST_INC_GEN_DIR})
alexander3c798932021-03-26 21:42:19 +0000431
Isabella Gottardi2181d0a2021-04-07 09:27:38 +0100432 # Generate test data files to be included in x86 tests
433 generate_test_data_code(
434 INPUT_DIR "${DEFAULT_TEST_DATA_DIR}"
435 DESTINATION_SRC ${TEST_SRC_GEN_DIR}
436 DESTINATION_HDR ${TEST_INC_GEN_DIR}
437 NAMESPACE "test"
438 )
439
440 file(GLOB_RECURSE TEST_SOURCES_GEN
441 "${TEST_SRC_GEN_DIR}/*.cc"
442 "${TEST_SRC_GEN_DIR}/**/*.cc"
443 )
444 message(STATUS "Adding ${TEST_SOURCES_GEN} to test sources")
445 list(APPEND TEST_SOURCES ${TEST_SOURCES_GEN})
446 list(APPEND TEST_RESOURCES_INCLUDE ${TEST_INC_GEN_DIR})
alexander3c798932021-03-26 21:42:19 +0000447
448 set(TEST_TARGET_NAME "${CMAKE_PROJECT_NAME}-${use_case}-tests")
449 add_executable(${TEST_TARGET_NAME} ${TEST_SOURCES})
450 target_include_directories(${TEST_TARGET_NAME} PUBLIC
451 ${TEST_TPIP_INCLUDE} ${TEST_RESOURCES_INCLUDE})
452 target_link_libraries(${TEST_TARGET_NAME} libethos-u-${use_case})
453 target_compile_definitions(${TEST_TARGET_NAME} PRIVATE
454 "ACTIVATION_BUF_SZ=${${use_case}_ACTIVATION_BUF_SZ}"
455 TESTS)
456
457 add_dependencies(
458 "${TEST_TARGET_NAME}"
459 "catch2-headers"
460 )
Isabella Gottardi85209832021-04-20 14:08:52 +0100461
alexander3c798932021-03-26 21:42:19 +0000462 endif ()
463 endif ()
464endforeach()
465
466print_useroptions()