|
1 |
| -# Copyright 2023-2024 Arm Limited and/or its affiliates. |
| 1 | +# Copyright 2023-2025 Arm Limited and/or its affiliates. |
2 | 2 | #
|
3 | 3 | # This source code is licensed under the BSD-style license found in the
|
4 | 4 | # LICENSE file in the root directory of this source tree.
|
@@ -44,6 +44,37 @@ set(PYTHON_EXECUTABLE
|
44 | 44 | CACHE PATH "Define to override python executable used"
|
45 | 45 | )
|
46 | 46 |
|
| 47 | +# Download ethos_u dependency if needed. |
| 48 | +include(FetchContent) |
| 49 | +set(ethos_u_base_rev "24.08") |
| 50 | +FetchContent_Declare( |
| 51 | + ethos_u |
| 52 | + GIT_REPOSITORY https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u.git |
| 53 | + GIT_TAG ${ethos_u_base_rev} |
| 54 | + SOURCE_DIR ${ETHOS_SDK_PATH} |
| 55 | + BINARY_DIR ${ETHOS_SDK_PATH} |
| 56 | + SUBBUILD_DIR ${ETHOS_SDK_PATH}/../ethos_u-subbuild |
| 57 | + SOURCE_SUBDIR none |
| 58 | + ) |
| 59 | + |
| 60 | +FetchContent_MakeAvailable(ethos_u) |
| 61 | + |
| 62 | +# Get ethos_u externals only if core_platform folder does not already exist. |
| 63 | +if(NOT EXISTS "${ETHOS_SDK_PATH}/core_platform") |
| 64 | + execute_process(COMMAND ${PYTHON_EXECUTABLE} fetch_externals.py -c ${ethos_u_base_rev}.json fetch |
| 65 | + WORKING_DIRECTORY ${ETHOS_SDK_PATH} |
| 66 | + COMMAND_ECHO STDOUT |
| 67 | + ) |
| 68 | +endif() |
| 69 | + |
| 70 | +# Always patch the core_platform repo since this is fast enough. |
| 71 | +set(core_platform_base_rev "b728c774158248ba2cad8e78a515809e1eb9b77f") |
| 72 | +set(patch_dir "examples/arm/ethos-u-setup") |
| 73 | +execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH}/core_platform ${core_platform_base_rev} ${patch_dir}" |
| 74 | + WORKING_DIRECTORY ${ET_DIR_PATH} |
| 75 | + COMMAND_ECHO STDOUT |
| 76 | +) |
| 77 | + |
47 | 78 | # Selects timing adapter values matching system_config.
|
48 | 79 | # Default is Ethos_U55_High_End_Embedded, simulating optimal hardware for the Corestone-300.
|
49 | 80 | set(SYSTEM_CONFIG "Ethos_U55_High_End_Embedded" CACHE STRING "System config")
|
|
0 commit comments