Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 1 | # |
Måns Nilsson | 21262ee | 2024-03-05 11:32:39 +0100 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: Copyright 2021, 2024 Arm Limited and/or its affiliates <open-source-office@arm.com> |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 3 | # 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 | |
| 22 | set(ETHOSU_CORE_SOFTWARE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../core_software" CACHE PATH "Path to Arm Ethos-U Core Software") |
| 23 | |
| 24 | set(CORE_SOFTWARE_RTOS "All" CACHE STRING "") |
Måns Nilsson | 21262ee | 2024-03-05 11:32:39 +0100 | [diff] [blame] | 25 | set(TFLM_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] | 26 | |
| 27 | add_subdirectory(${ETHOSU_CORE_SOFTWARE_PATH} core_software) |
| 28 | |
Yulia Garbovich | e9cdc63 | 2021-11-23 20:00:04 +0200 | [diff] [blame] | 29 | add_subdirectory(../../drivers drivers) |
| 30 | |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 31 | ############################################################################### |
| 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 Jonsson | ec45155 | 2021-06-04 18:02:59 +0200 | [diff] [blame] | 46 | option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" OFF) |
| 47 | |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 48 | # Common |
| 49 | add_library(ethosu_target_common INTERFACE) |
| 50 | target_include_directories(ethosu_target_common INTERFACE include) |
| 51 | |
| 52 | # Link |
| 53 | add_library(ethosu_target_link INTERFACE) |
| 54 | target_link_libraries(ethosu_target_link INTERFACE ethosu_target_common) |
| 55 | |
Kristofer Jonsson | ec45155 | 2021-06-04 18:02:59 +0200 | [diff] [blame] | 56 | # Configuring caches |
| 57 | if (CPU_CACHE_ENABLE) |
| 58 | target_compile_definitions(ethosu_target_link INTERFACE CPU_CACHE_ENABLE) |
| 59 | endif() |
| 60 | |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 61 | # Startup |
| 62 | add_library(ethosu_target_startup INTERFACE) |
| 63 | target_link_libraries(ethosu_target_startup INTERFACE ethosu_target_link) |
Per Åstrand | dfcc017 | 2021-01-29 10:27:40 +0100 | [diff] [blame] | 64 | target_link_libraries(ethosu_target_startup INTERFACE cmsis_system) |
Kristofer Jonsson | f62c3d7 | 2021-01-21 17:39:03 +0100 | [diff] [blame] | 65 | |
| 66 | # Init |
| 67 | add_library(ethosu_target_init INTERFACE) |
| 68 | target_link_libraries(ethosu_target_init INTERFACE ethosu_target_startup) |
| 69 | target_sources(ethosu_target_init INTERFACE src/init.cpp) |
| 70 | |
Rajasekaran Kalidoss | fffdcf0 | 2024-04-10 11:31:47 +0200 | [diff] [blame^] | 71 | # |
| 72 | # Print build status |
| 73 | # |
| 74 | |
| 75 | message(STATUS "*******************************************************") |
| 76 | message(STATUS "PROJECT_NAME : ${PROJECT_NAME}") |
| 77 | message(STATUS "FAST_MEMORY_SIZE : ${FAST_MEMORY_SIZE}") |
| 78 | message(STATUS "MEMORY_MODEL : ${MEMORY_MODEL}") |
| 79 | message(STATUS "MEMORY_ARENA : ${MEMORY_ARENA}") |
| 80 | message(STATUS "TARGET_CPU : ${TARGET_CPU}") |
| 81 | message(STATUS "*******************************************************") |