blob: 7a0b068ab0612090d58b324148fa5b0324e48134 [file] [log] [blame]
Kshitij Sisodiab59ba682021-11-23 17:19:52 +00001#----------------------------------------------------------------------------
Isabella Gottardiee4920b2022-02-25 14:29:32 +00002# Copyright (c) 2021-2022 Arm Limited. All rights reserved.
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
91 "Path to CMSIS-5 DSP sources"
92 "${DEPENDENCY_ROOT_DIR}/cmsis-dsp"
93 PATH)
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000094
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000095 # If we need NPU libraries:
96 if (ETHOS_U_NPU_ENABLED)
97 USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH
98 "Path to Ethos-U NPU timing adapter sources"
Richard Burtonb4123fd2022-03-04 09:19:09 +000099 "${DEPENDENCY_ROOT_DIR}/core-platform/drivers/timing_adapter"
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000100 PATH
101 )
102
103 USER_OPTION(ETHOS_U_NPU_DRIVER_SRC_PATH
104 "Path to Ethos-U NPU core driver sources"
105 "${DEPENDENCY_ROOT_DIR}/core-driver"
106 PATH
107 )
108
109 USER_OPTION(ETHOS_U_NPU_ID "Arm Ethos-U NPU IP (U55 or U65)"
110 "U55"
111 STRING)
112
113 if ((ETHOS_U_NPU_ID STREQUAL U55) OR (ETHOS_U_NPU_ID STREQUAL U65))
114 if (ETHOS_U_NPU_ID STREQUAL U55)
115 set(DEFAULT_NPU_MEM_MODE "Shared_Sram")
Isabella Gottardiee4920b2022-02-25 14:29:32 +0000116 set(DEFAULT_NPU_CONFIG_ID "H128")
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000117 elseif(ETHOS_U_NPU_ID STREQUAL U65)
118 set(DEFAULT_NPU_MEM_MODE "Dedicated_Sram")
Isabella Gottardiee4920b2022-02-25 14:29:32 +0000119 set(DEFAULT_NPU_CONFIG_ID "Y256")
120 set(DEFAULT_NPU_CACHE_SIZE "393216")
121
122 USER_OPTION(ETHOS_U_NPU_CACHE_SIZE "Arm Ethos-U65 NPU Cache Size"
123 "${DEFAULT_NPU_CACHE_SIZE}"
124 STRING)
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000125 endif()
126 else ()
127 message(FATAL_ERROR "Non compatible Ethos-U NPU processor ${ETHOS_U_NPU_ID}")
128 endif ()
129
130 USER_OPTION(ETHOS_U_NPU_MEMORY_MODE "Specifies the memory mode used in the Vela command."
131 "${DEFAULT_NPU_MEM_MODE}"
132 STRING)
133
134 USER_OPTION(ETHOS_U_NPU_CONFIG_ID "Specifies the configuration ID for the NPU."
135 "${DEFAULT_NPU_CONFIG_ID}"
136 STRING)
137
138 if (ETHOS_U_NPU_ID STREQUAL U55)
139 set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u55_high_end.cmake")
140 else ()
141 set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u65_high_end.cmake")
142 endif ()
143
Kshitij Sisodiad5679cc2022-03-03 16:30:07 +0000144 USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_ENABLED "Specifies if the Ethos-U timing adapter is enabled"
145 ON
146 BOOL)
147
148 if (ETHOS_U_NPU_TIMING_ADAPTER_ENABLED)
149 USER_OPTION(TA_CONFIG_FILE "Path to the timing adapter configuration file"
150 ${DEFAULT_TA_CONFIG_FILE_PATH}
151 FILEPATH)
152 endif()
Kshitij Sisodiab59ba682021-11-23 17:19:52 +0000153 endif()
154endif()