Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 1 | # |
| 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 | |
| 23 | set(ETHOSU_CORE_SOFTWARE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../core_software" CACHE PATH "Path to Arm Ethos-U Core Software") |
| 24 | |
| 25 | set(CORE_SOFTWARE_RTOS "All" CACHE STRING "") |
Yulia Garbovich | afa0c81 | 2021-11-02 15:55:38 +0200 | [diff] [blame] | 26 | set(TFLU_BUILD_TYPE "release_with_logs" CACHE STRING "Tensorflow Lite Micro build type (release, release_with_logs, debug)") |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 27 | |
| 28 | add_subdirectory(${ETHOSU_CORE_SOFTWARE_PATH} core_software) |
| 29 | |
Yulia Garbovich | e9cdc63 | 2021-11-23 20:00:04 +0200 | [diff] [blame] | 30 | add_subdirectory(../../drivers drivers) |
| 31 | |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 32 | ############################################################################### |
| 33 | # Target |
| 34 | # |
| 35 | # ethosu_target_init # Init and drivers |
| 36 | # | |
| 37 | # v |
| 38 | # ethosu_target_startup # CMSIS startup |
| 39 | # | |
| 40 | # v |
| 41 | # ethosu_target_link # Target linker script |
| 42 | # | |
| 43 | # v |
| 44 | # ethosu_target_common # Common for all targets |
| 45 | ############################################################################### |
| 46 | |
Kristofer Jonsson | ec45155 | 2021-06-04 18:02:59 +0200 | [diff] [blame] | 47 | option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" OFF) |
| 48 | |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 49 | # Common |
| 50 | add_library(ethosu_target_common INTERFACE) |
| 51 | target_include_directories(ethosu_target_common INTERFACE include) |
| 52 | |
| 53 | # Link |
| 54 | add_library(ethosu_target_link INTERFACE) |
| 55 | target_link_libraries(ethosu_target_link INTERFACE ethosu_target_common) |
| 56 | |
Kristofer Jonsson | ec45155 | 2021-06-04 18:02:59 +0200 | [diff] [blame] | 57 | # Configuring caches |
| 58 | if (CPU_CACHE_ENABLE) |
| 59 | target_compile_definitions(ethosu_target_link INTERFACE CPU_CACHE_ENABLE) |
| 60 | endif() |
| 61 | |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 62 | # Startup |
| 63 | add_library(ethosu_target_startup INTERFACE) |
| 64 | target_link_libraries(ethosu_target_startup INTERFACE ethosu_target_link) |
Per Åstrand | dfcc017 | 2021-01-29 10:27:40 +0100 | [diff] [blame] | 65 | target_link_libraries(ethosu_target_startup INTERFACE cmsis_system) |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 66 | |
| 67 | # Init |
| 68 | add_library(ethosu_target_init INTERFACE) |
| 69 | target_link_libraries(ethosu_target_init INTERFACE ethosu_target_startup) |
| 70 | target_sources(ethosu_target_init INTERFACE src/init.cpp) |
| 71 | |