blob: 97e9b4034f6be637e57adcf1d78ac47e97780069 [file] [log] [blame]
Kshitij Sisodiab59ba682021-11-23 17:19:52 +00001#----------------------------------------------------------------------------
Richard Burtonf32a86a2022-11-15 11:46:11 +00002# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
Kshitij Sisodiab59ba682021-11-23 17:19:52 +00003# 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
Kshitij Sisodia8c61c0a2022-05-17 11:16:22 +010046USER_OPTION(TARGET_SUBSYSTEM "Specify platform target subsystem: sse-300, sse-310 or none"
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000047 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
Eanna O Cathain4c0ac912022-09-22 15:18:34 +010080USER_OPTION(USE_SINGLE_INPUT "Select if a use case should execute using a default known input file"
81 OFF
82 BOOL)
83
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000084if (NOT TARGET_PLATFORM STREQUAL native)
85
86 USER_OPTION(CMSIS_SRC_PATH
87 "Path to CMSIS-5 sources"
88 "${DEPENDENCY_ROOT_DIR}/cmsis"
89 PATH)
Maksims Svecovs254853c2022-08-30 12:58:02 +010090 USER_OPTION(CMSIS_DSP_SRC_PATH
Richard Burton71f282e2022-12-01 12:31:23 +000091 "Path to CMSIS-5 DSP sources"
Maksims Svecovs254853c2022-08-30 12:58:02 +010092 "${DEPENDENCY_ROOT_DIR}/cmsis-dsp"
93 PATH)
Richard Burton71f282e2022-12-01 12:31:23 +000094 USER_OPTION(CMSIS_NN_SRC_PATH
95 "Path to CMSIS-5 NN sources"
96 "${DEPENDENCY_ROOT_DIR}/cmsis-nn"
97 PATH)
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000098
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000099 # If we need NPU libraries:
100 if (ETHOS_U_NPU_ENABLED)
101 USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH
102 "Path to Ethos-U NPU timing adapter sources"
Richard Burtonb4123fd2022-03-04 09:19:09 +0000103 "${DEPENDENCY_ROOT_DIR}/core-platform/drivers/timing_adapter"
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000104 PATH
105 )
106
107 USER_OPTION(ETHOS_U_NPU_DRIVER_SRC_PATH
108 "Path to Ethos-U NPU core driver sources"
109 "${DEPENDENCY_ROOT_DIR}/core-driver"
110 PATH
111 )
112
113 USER_OPTION(ETHOS_U_NPU_ID "Arm Ethos-U NPU IP (U55 or U65)"
114 "U55"
115 STRING)
116
117 if ((ETHOS_U_NPU_ID STREQUAL U55) OR (ETHOS_U_NPU_ID STREQUAL U65))
118 if (ETHOS_U_NPU_ID STREQUAL U55)
119 set(DEFAULT_NPU_MEM_MODE "Shared_Sram")
Isabella Gottardiee4920b2022-02-25 14:29:32 +0000120 set(DEFAULT_NPU_CONFIG_ID "H128")
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000121 elseif(ETHOS_U_NPU_ID STREQUAL U65)
122 set(DEFAULT_NPU_MEM_MODE "Dedicated_Sram")
Isabella Gottardiee4920b2022-02-25 14:29:32 +0000123 set(DEFAULT_NPU_CONFIG_ID "Y256")
124 set(DEFAULT_NPU_CACHE_SIZE "393216")
125
126 USER_OPTION(ETHOS_U_NPU_CACHE_SIZE "Arm Ethos-U65 NPU Cache Size"
127 "${DEFAULT_NPU_CACHE_SIZE}"
128 STRING)
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000129 endif()
130 else ()
131 message(FATAL_ERROR "Non compatible Ethos-U NPU processor ${ETHOS_U_NPU_ID}")
132 endif ()
133
134 USER_OPTION(ETHOS_U_NPU_MEMORY_MODE "Specifies the memory mode used in the Vela command."
135 "${DEFAULT_NPU_MEM_MODE}"
136 STRING)
137
138 USER_OPTION(ETHOS_U_NPU_CONFIG_ID "Specifies the configuration ID for the NPU."
139 "${DEFAULT_NPU_CONFIG_ID}"
140 STRING)
141
142 if (ETHOS_U_NPU_ID STREQUAL U55)
143 set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u55_high_end.cmake")
144 else ()
145 set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u65_high_end.cmake")
146 endif ()
147
Kshitij Sisodiad5679cc2022-03-03 16:30:07 +0000148 USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_ENABLED "Specifies if the Ethos-U timing adapter is enabled"
149 ON
150 BOOL)
151
152 if (ETHOS_U_NPU_TIMING_ADAPTER_ENABLED)
153 USER_OPTION(TA_CONFIG_FILE "Path to the timing adapter configuration file"
154 ${DEFAULT_TA_CONFIG_FILE_PATH}
155 FILEPATH)
156 endif()
Sarah Blades00481442022-10-03 16:38:23 +0100157
158 USER_OPTION(BUILD_FVP_TESTS "Build tests for CTest driven FVP runs for built applications"
159 OFF
160 BOOL)
161
162 if (BUILD_FVP_TESTS)
163 USER_OPTION(FVP_PATH "Path to FVP for verifying execution"
164 ""
165 FILEPATH)
166 endif()
167
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000168 endif()
169endif()