blob: d41a7d3899afef6f3544d8077d9656fb19f14d7a [file] [log] [blame]
Kristofer Jonsson43ce4912020-11-20 09:42:53 +01001#
2# Copyright (c) 2020 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#############################################################################
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010020# Default parameters
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010021#############################################################################
22
23set(TARGET_CPU "cortex-m55")
24
25if (NOT CMAKE_TOOLCHAIN_FILE)
26 set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/toolchain/armclang.cmake")
27endif()
28
Kristofer Jonsson715c07b2021-02-25 09:49:34 +010029set(ETHOSU_COMMAND_DEFAULT ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/run_ctest.py -t corstone-300)
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010030
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010031#############################################################################
32# Project
33#############################################################################
34
35cmake_minimum_required(VERSION 3.15.6)
36
37project(ethos-u-corstone-300 VERSION 0.0.1)
38
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010039include(CTest)
40
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010041include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/helpers.cmake)
42
43#############################################################################
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010044# Corstone-300
45#############################################################################
46
Per Åstrand79929ff2021-01-26 14:42:43 +010047get_filename_component(ETHOSU_TARGET ${CMAKE_CURRENT_SOURCE_DIR} NAME)
48message("Configuring target ${ETHOSU_TARGET}")
49
Per Åstranddfcc0172021-01-29 10:27:40 +010050# Enable trustzone support in core_software
51set(TRUSTZONE_BUILD ON)
52
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010053add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common target)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010054
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010055# Linker script
56ethosu_target_link_options(ethosu_target_link INTERFACE
57 LINK_FILE platform
58 ENTRY Reset_Handler)
59
60# Add drivers
61target_sources(ethosu_target_startup INTERFACE
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010062 retarget.c
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010063 uart.c
64 target.cpp)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010065
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010066target_compile_definitions(ethosu_core_driver PUBLIC ETHOSU)
67target_link_libraries(ethosu_target_startup INTERFACE ethosu_core_driver)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010068
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010069###############################################################################
70# Applications
71###############################################################################
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010072
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010073# Add all applications
74add_subdirectory(../../applications applications)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010075