blob: 3e222bee6b174a407b9f6a2e3d87ecf57dfa1cac [file] [log] [blame]
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +01001#
2# Copyright (c) 2021 Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6# Licensed under the Apache License, Version 2.0 (the License); you may
7# not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an AS IS BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19#############################################################################
20# Core software
21#############################################################################
22
23set(ETHOSU_CORE_SOFTWARE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../core_software" CACHE PATH "Path to Arm Ethos-U Core Software")
24
25set(CORE_SOFTWARE_RTOS "All" CACHE STRING "")
26
27add_subdirectory(${ETHOSU_CORE_SOFTWARE_PATH} core_software)
28
29###############################################################################
30# Target
31#
32# ethosu_target_init # Init and drivers
33# |
34# v
35# ethosu_target_startup # CMSIS startup
36# |
37# v
38# ethosu_target_link # Target linker script
39# |
40# v
41# ethosu_target_common # Common for all targets
42###############################################################################
43
Kristofer Jonssonec451552021-06-04 18:02:59 +020044option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" OFF)
45
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010046# Common
47add_library(ethosu_target_common INTERFACE)
48target_include_directories(ethosu_target_common INTERFACE include)
49
50# Link
51add_library(ethosu_target_link INTERFACE)
52target_link_libraries(ethosu_target_link INTERFACE ethosu_target_common)
53
Kristofer Jonssonec451552021-06-04 18:02:59 +020054# Configuring caches
55if (CPU_CACHE_ENABLE)
56 target_compile_definitions(ethosu_target_link INTERFACE CPU_CACHE_ENABLE)
57endif()
58
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010059# Startup
60add_library(ethosu_target_startup INTERFACE)
61target_link_libraries(ethosu_target_startup INTERFACE ethosu_target_link)
Per Åstranddfcc0172021-01-29 10:27:40 +010062target_link_libraries(ethosu_target_startup INTERFACE cmsis_system)
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010063
64# Init
65add_library(ethosu_target_init INTERFACE)
66target_link_libraries(ethosu_target_init INTERFACE ethosu_target_startup)
67target_sources(ethosu_target_init INTERFACE src/init.cpp)
68