blob: eb7916bc8695d23d05d3093af4833a29431347de [file] [log] [blame]
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +01001#
Måns Nilsson21262ee2024-03-05 11:32:39 +01002# SPDX-FileCopyrightText: Copyright 2021, 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +01003# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# 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, WITHOUT
13# 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# Core software
20#############################################################################
21
22set(ETHOSU_CORE_SOFTWARE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../core_software" CACHE PATH "Path to Arm Ethos-U Core Software")
23
24set(CORE_SOFTWARE_RTOS "All" CACHE STRING "")
Måns Nilsson21262ee2024-03-05 11:32:39 +010025set(TFLM_BUILD_TYPE "release_with_logs" CACHE STRING "Tensorflow Lite Micro build type (release, release_with_logs, debug)")
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010026
27add_subdirectory(${ETHOSU_CORE_SOFTWARE_PATH} core_software)
28
Yulia Garboviche9cdc632021-11-23 20:00:04 +020029add_subdirectory(../../drivers drivers)
30
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010031###############################################################################
32# Target
33#
34# ethosu_target_init # Init and drivers
35# |
36# v
37# ethosu_target_startup # CMSIS startup
38# |
39# v
40# ethosu_target_link # Target linker script
41# |
42# v
43# ethosu_target_common # Common for all targets
44###############################################################################
45
Kristofer Jonssonec451552021-06-04 18:02:59 +020046option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" OFF)
47
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010048# Common
49add_library(ethosu_target_common INTERFACE)
50target_include_directories(ethosu_target_common INTERFACE include)
51
52# Link
53add_library(ethosu_target_link INTERFACE)
54target_link_libraries(ethosu_target_link INTERFACE ethosu_target_common)
55
Kristofer Jonssonec451552021-06-04 18:02:59 +020056# Configuring caches
57if (CPU_CACHE_ENABLE)
58 target_compile_definitions(ethosu_target_link INTERFACE CPU_CACHE_ENABLE)
59endif()
60
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010061# Startup
62add_library(ethosu_target_startup INTERFACE)
63target_link_libraries(ethosu_target_startup INTERFACE ethosu_target_link)
Per Åstranddfcc0172021-01-29 10:27:40 +010064target_link_libraries(ethosu_target_startup INTERFACE cmsis_system)
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010065
66# Init
67add_library(ethosu_target_init INTERFACE)
68target_link_libraries(ethosu_target_init INTERFACE ethosu_target_startup)
69target_sources(ethosu_target_init INTERFACE src/init.cpp)
70
Rajasekaran Kalidossfffdcf02024-04-10 11:31:47 +020071#
72# Print build status
73#
74
75message(STATUS "*******************************************************")
76message(STATUS "PROJECT_NAME : ${PROJECT_NAME}")
77message(STATUS "FAST_MEMORY_SIZE : ${FAST_MEMORY_SIZE}")
78message(STATUS "MEMORY_MODEL : ${MEMORY_MODEL}")
79message(STATUS "MEMORY_ARENA : ${MEMORY_ARENA}")
80message(STATUS "TARGET_CPU : ${TARGET_CPU}")
81message(STATUS "*******************************************************")