blob: c7340445dafa58ed6f17dd57746530d5846b57fa [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 Jonssonf62c3d72021-01-21 17:39:03 +010029set(ETHOSU_COMMAND_DEFAULT
30 FVP_Corstone_SSE-300_Ethos-U55
31 -C mps3_board.visualisation.disable-visualisation=1
32 -C mps3_board.telnetterminal0.start_telnet=0
33 -C mps3_board.uart0.out_file="-"
34 -C mps3_board.uart0.unbuffered_output=1
35 -C mps3_board.uart0.shutdown_tag="EXITTHESIM")
36
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010037#############################################################################
38# Project
39#############################################################################
40
41cmake_minimum_required(VERSION 3.15.6)
42
43project(ethos-u-corstone-300 VERSION 0.0.1)
44
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010045include(CTest)
46
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010047include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/helpers.cmake)
48
49#############################################################################
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010050# Corstone-300
51#############################################################################
52
Per Åstrand79929ff2021-01-26 14:42:43 +010053get_filename_component(ETHOSU_TARGET ${CMAKE_CURRENT_SOURCE_DIR} NAME)
54message("Configuring target ${ETHOSU_TARGET}")
55
Per Åstranddfcc0172021-01-29 10:27:40 +010056# Enable trustzone support in core_software
57set(TRUSTZONE_BUILD ON)
58
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010059add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common target)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010060
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010061# Linker script
62ethosu_target_link_options(ethosu_target_link INTERFACE
63 LINK_FILE platform
64 ENTRY Reset_Handler)
65
66# Add drivers
67target_sources(ethosu_target_startup INTERFACE
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010068 retarget.c
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010069 uart.c
70 target.cpp)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010071
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010072target_compile_definitions(ethosu_core_driver PUBLIC ETHOSU)
73target_link_libraries(ethosu_target_startup INTERFACE ethosu_core_driver)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010074
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010075###############################################################################
76# Applications
77###############################################################################
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010078
Kristofer Jonssonf62c3d72021-01-21 17:39:03 +010079# Add all applications
80add_subdirectory(../../applications applications)
Kristofer Jonsson43ce4912020-11-20 09:42:53 +010081