blob: 9a1328755aa0b6fded7e0f1a6d860d2cedff3175 [file] [log] [blame]
Kshitij Sisodiab59ba682021-11-23 17:19:52 +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
18#----------------------------------------------------------------------------
19# This file should contain all the common user options for the application
20# For use case specific options, see individual usecase.cmake files under
21# each example use case.
22#----------------------------------------------------------------------------
23
24if (NOT DEFINED USER_OPTIONS_INCLUDED)
25 set(USER_OPTIONS_INCLUDED ON)
26else()
27 return()
28endif()
29
30message(STATUS "Assessing common user options...")
31
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000032include(${CMAKE_CURRENT_LIST_DIR}/util_functions.cmake)
33
34USER_OPTION(LOG_LEVEL "Log level for the application"
35 LOG_LEVEL_INFO
36 STRING)
37
38USER_OPTION(TENSORFLOW_SRC_PATH "Path to the root of the tensor flow directory"
39 "${DEPENDENCY_ROOT_DIR}/tensorflow"
40 PATH)
41
42USER_OPTION(TARGET_PLATFORM "Target platform to execute evaluation application: mps3, simple_platform, native"
43 mps3
44 STRING)
45
46USER_OPTION(TARGET_SUBSYSTEM "Specify platform target subsystem: sse-300 or none"
47 sse-300
48 STRING)
49
50if (TARGET_PLATFORM STREQUAL native)
51 set(NPU_AVAILABLE OFF)
52else()
53 set(NPU_AVAILABLE ON)
54endif()
55
56USER_OPTION(ETHOS_U_NPU_ENABLED "If Arm Ethos-U NPU is enabled in the target system."
57 ${NPU_AVAILABLE}
58 BOOL)
59
60USER_OPTION(USE_CASE_BUILD "Optional. Defines the use-case to build from the available sources. By default, all use-cases are built."
61 all
62 STRING)
63
64USER_OPTION(CPU_PROFILE_ENABLED "Output CPU performance profiling information. Should be used only for MPS3 board."
65 OFF
66 BOOL)
67
68USER_OPTION(TENSORFLOW_LITE_MICRO_BUILD_TYPE "TensorFlow Lite Mirco build type (release/debug etc.)"
69 $<IF:$<CONFIG:RELEASE>,release_with_logs,debug>
70 STRING)
71
72USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS "Select if TPIP downloads should be cleaned before each build."
73 OFF
74 BOOL)
75
76USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_BUILD "Select if clean target should be added to a list of targets"
77 ON
78 BOOL)
79
80if (NOT TARGET_PLATFORM STREQUAL native)
81
82 USER_OPTION(CMSIS_SRC_PATH
83 "Path to CMSIS-5 sources"
84 "${DEPENDENCY_ROOT_DIR}/cmsis"
85 PATH)
86
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000087 # If we need NPU libraries:
88 if (ETHOS_U_NPU_ENABLED)
89 USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH
90 "Path to Ethos-U NPU timing adapter sources"
91 "${DEPENDENCY_ROOT_DIR}/core-software/drivers/timing_adapter"
92 PATH
93 )
94
95 USER_OPTION(ETHOS_U_NPU_DRIVER_SRC_PATH
96 "Path to Ethos-U NPU core driver sources"
97 "${DEPENDENCY_ROOT_DIR}/core-driver"
98 PATH
99 )
100
101 USER_OPTION(ETHOS_U_NPU_ID "Arm Ethos-U NPU IP (U55 or U65)"
102 "U55"
103 STRING)
104
105 if ((ETHOS_U_NPU_ID STREQUAL U55) OR (ETHOS_U_NPU_ID STREQUAL U65))
106 if (ETHOS_U_NPU_ID STREQUAL U55)
107 set(DEFAULT_NPU_MEM_MODE "Shared_Sram")
108 set(DEFAULT_NPU_CONFIG_ID "H128")
109 elseif(ETHOS_U_NPU_ID STREQUAL U65)
110 set(DEFAULT_NPU_MEM_MODE "Dedicated_Sram")
111 set(DEFAULT_NPU_CONFIG_ID "Y256")
112 endif()
113 else ()
114 message(FATAL_ERROR "Non compatible Ethos-U NPU processor ${ETHOS_U_NPU_ID}")
115 endif ()
116
117 USER_OPTION(ETHOS_U_NPU_MEMORY_MODE "Specifies the memory mode used in the Vela command."
118 "${DEFAULT_NPU_MEM_MODE}"
119 STRING)
120
121 USER_OPTION(ETHOS_U_NPU_CONFIG_ID "Specifies the configuration ID for the NPU."
122 "${DEFAULT_NPU_CONFIG_ID}"
123 STRING)
124
125 if (ETHOS_U_NPU_ID STREQUAL U55)
126 set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u55_high_end.cmake")
127 else ()
128 set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u65_high_end.cmake")
129 endif ()
130
131 USER_OPTION(TA_CONFIG_FILE "Path to the timing adapter configuration file"
132 ${DEFAULT_TA_CONFIG_FILE_PATH}
133 FILEPATH)
134 endif()
135endif()