Skip to content

Commit

Permalink
MLECO-5486: Adding support for Arm Corstone-320
Browse files Browse the repository at this point in the history
First release of Arm Corstone-320 BSP v1.0.0 added to enable all
projects to be built for this new target. Recently updated version
of the NPU driver used to enable support for the new Arm Ethos-U85
NPU.

Change-Id: Ia684a011e14e0374dc9e3fef927deecbe04a49ce
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
  • Loading branch information
kshitij-sisodia-arm committed Oct 11, 2024
1 parent b9c9bf2 commit 171982f
Show file tree
Hide file tree
Showing 21 changed files with 16,989 additions and 111 deletions.
3 changes: 1 addition & 2 deletions cmsis-pack-examples/.ci/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"arm:tools/kitware/cmake": "^3.28.4",
"arm:tools/ninja-build/ninja": "^1.12.0",
"arm:compilers/arm/armclang": "^6.22.0",
"arm:compilers/arm/arm-none-eabi-gcc": "^13.2.1",
"arm:models/arm/avh-fvp": "^11.26.11"
"arm:models/arm/avh-fvp": "^11.27.31"
}
}
42 changes: 25 additions & 17 deletions cmsis-pack-examples/.github/workflows/AVH-FVP-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,26 @@ jobs:

matrix:
target: [
{proj: kws, board: AVH-SSE-300, model: FVP_Corstone_SSE-300, uart: mps3_board.uart0},
{proj: kws, board: AVH-SSE-300-U55, model: FVP_Corstone_SSE-300_Ethos-U55, uart: mps3_board.uart0},
{proj: kws, board: AVH-SSE-300-U65, model: FVP_Corstone_SSE-300_Ethos-U65, uart: mps3_board.uart0},
{proj: kws, board: AVH-SSE-310, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
{proj: kws, board: AVH-SSE-310-U55, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
{proj: kws, board: AVH-SSE-310-U65, model: FVP_Corstone_SSE-310_Ethos-U65, uart: mps3_board.uart0},
{proj: object-detection, board: AVH-SSE-300, model: FVP_Corstone_SSE-300, uart: mps3_board.uart0},
{proj: object-detection, board: AVH-SSE-300-U55, model: FVP_Corstone_SSE-300_Ethos-U55, uart: mps3_board.uart0},
{proj: object-detection, board: AVH-SSE-300-U65, model: FVP_Corstone_SSE-300_Ethos-U65, uart: mps3_board.uart0},
{proj: object-detection, board: AVH-SSE-310, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
{proj: object-detection, board: AVH-SSE-310-U55, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
{proj: object-detection, board: AVH-SSE-310-U65, model: FVP_Corstone_SSE-310_Ethos-U65, uart: mps3_board.uart0}
{proj: kws, board: AVH-SSE-300, model: FVP_Corstone_SSE-300, base: mps3, uart: uart0},
{proj: kws, board: AVH-SSE-300-U55, model: FVP_Corstone_SSE-300_Ethos-U55, base: mps3, uart: uart0},
{proj: kws, board: AVH-SSE-300-U65, model: FVP_Corstone_SSE-300_Ethos-U65, base: mps3, uart: uart0},
{proj: kws, board: AVH-SSE-310, model: FVP_Corstone_SSE-310, base: mps3, uart: uart0},
{proj: kws, board: AVH-SSE-310-U55, model: FVP_Corstone_SSE-310, base: mps3, uart: uart0},
{proj: kws, board: AVH-SSE-310-U65, model: FVP_Corstone_SSE-310_Ethos-U65, base: mps3, uart: uart0},
{proj: kws, board: AVH-SSE-315, model: FVP_Corstone_SSE-315, base: mps4, uart: uart0},
{proj: kws, board: AVH-SSE-315-U65, model: FVP_Corstone_SSE-315_Ethos-U65, base: mps4, uart: uart0},
{proj: kws, board: AVH-SSE-320, model: FVP_Corstone_SSE-320, base: mps4, uart: uart0},
{proj: kws, board: AVH-SSE-320-U85, model: FVP_Corstone_SSE-320_Ethos-U85, base: mps4, uart: uart0},
{proj: object-detection, board: AVH-SSE-300, model: FVP_Corstone_SSE-300, base: mps3, uart: uart0},
{proj: object-detection, board: AVH-SSE-300-U55, model: FVP_Corstone_SSE-300_Ethos-U55, base: mps3, uart: uart0},
{proj: object-detection, board: AVH-SSE-300-U65, model: FVP_Corstone_SSE-300_Ethos-U65, base: mps3, uart: uart0},
{proj: object-detection, board: AVH-SSE-310, model: FVP_Corstone_SSE-310, base: mps3, uart: uart0},
{proj: object-detection, board: AVH-SSE-310-U55, model: FVP_Corstone_SSE-310, base: mps3, uart: uart0},
{proj: object-detection, board: AVH-SSE-310-U65, model: FVP_Corstone_SSE-310_Ethos-U65, base: mps3, uart: uart0},
{proj: object-detection, board: AVH-SSE-315, model: FVP_Corstone_SSE-315, base: mps4, uart: uart0},
{proj: object-detection, board: AVH-SSE-315-U65, model: FVP_Corstone_SSE-315_Ethos-U65, base: mps4, uart: uart0},
{proj: object-detection, board: AVH-SSE-320, model: FVP_Corstone_SSE-320, base: mps4, uart: uart0},
{proj: object-detection, board: AVH-SSE-320-U85, model: FVP_Corstone_SSE-320_Ethos-U85, base: mps4, uart: uart0}
]

fail-fast: false
Expand Down Expand Up @@ -69,8 +77,8 @@ jobs:
run: |
${{ matrix.target.model }} \
-a ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/${{ matrix.target.proj }}.axf \
-f ./FVP/${{ matrix.target.model }}/fvp_config.txt \
-C ${{ matrix.target.uart }}.out_file=./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/fvp_stdout.log \
-f ./device/corstone/fvp-configs/${{ matrix.target.base }}_fvp_config.txt \
-C ${{ matrix.target.base }}_board.${{ matrix.target.uart }}.out_file=./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/fvp_stdout.log \
--simlimit 60 --stat
cat ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/fvp_stdout.log
Expand All @@ -79,7 +87,7 @@ jobs:
run: |
${{ matrix.target.model }} \
-a ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/${{ matrix.target.proj }}.axf \
-f ./FVP/${{ matrix.target.model }}/fvp_config.txt \
-C ${{ matrix.target.uart }}.out_file=./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/fvp_stdout.log \
-f ./device/corstone/fvp-configs/${{ matrix.target.base }}_fvp_config.txt \
-C ${{ matrix.target.base }}_board.${{ matrix.target.uart }}.out_file=./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/fvp_stdout.log \
--simlimit 60 --stat
cat ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/fvp_stdout.log
cat ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/fvp_stdout.log
7 changes: 0 additions & 7 deletions cmsis-pack-examples/FVP/FVP_Corstone_SSE-300/fvp_config.txt

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions cmsis-pack-examples/FVP/FVP_Corstone_SSE-310/fvp_config.txt

This file was deleted.

This file was deleted.

23 changes: 17 additions & 6 deletions cmsis-pack-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
- [Generate and build the project](#generate-and-build-the-project)
- [Execute Project](#execute-project)
- [Working with Virtual Streaming Interface](#working-with-virtual-streaming-interface)
- [Arm MPS3 based FVPs](#arm-mps3-based-fvps)
- [Arm MPS4 based FVPs](#arm-mps4-based-fvps)
- [Application output](#application-output)
- [Trademarks](#trademarks)
- [Licenses](#licenses)
Expand Down Expand Up @@ -48,10 +50,12 @@ Target platforms supported:
| Arm® Corstone™-300-U55 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 | All |
| Arm® Corstone™-300-U65 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U65 | All |
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 | All |
| Arm® Corstone™-310-U55 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 | All |
| Arm® Corstone™-310-U65 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U65 NPU | All |
| Arm® Corstone™-315 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
| Arm® Corstone™-315-U65 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U65 NPU | All |
| Arm® Corstone™-320 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
| Arm® Corstone™-320-U85 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U85 NPU | All |
| Alif™ Ensemble™ E7 AI/ML Kit | Physical board | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 NPU | All |
| STM32® F746G-Discovery | Physical board | Arm® Cortex®-M7 CPU | KWS |
| NXP® FRDM-K64F | Physical board | Arm® Cortex®-M4 CPU | KWS |
Expand Down Expand Up @@ -195,12 +199,15 @@ The built artifacts will be located under the `out/` directory in the project ro
The project is configured for execution on Arm Virtual Hardware which removes the requirement for
a physical hardware board.

- When using a Fixed Virtual Platform (FVP) installed locally:
- When using a Fixed Virtual Platform (FVP) installed locally by `vcpkg`:
```shell
$ FVP_Corstone_SSE-300_Ethos-U55 -a out/object-detection/AVH-SSE-300-U55/Release/object-detection.axf -f ./FVP/FVP_Corstone_SSE-300/fvp_config.txt
$ FVP_Corstone_SSE-300_Ethos-U55 \
-a out/object-detection/AVH-SSE-300-U55/Release/object-detection.axf \
-f device/corstone/fvp-configs/mps3_fvp_config.txt
```
> **NOTE**: The FVP defaults to running 128 MAC configuration for Arm® Ethos™-U55 NPU.
> However, our default neural network model for the NPU is for 256 MAC configuration.
> However, our default neural network model for the NPU is for 256 MAC configuration. The FVP
> configuration file sets the MAC units to be 256.
- [Keil Studio Cloud](https://studio.keil.arm.com/) integrates also the Arm Virtual Hardware
VHT_Corstone_SSE-300_Ethos-U55 model. The steps to use the example are:
Expand Down Expand Up @@ -235,7 +242,9 @@ your local machine and stream these over to the application running within the F

To run the VSI application, append the command line with the v_path argument. For example:

#### Arm Corstone-300 + Arm Corstone-310
#### Arm MPS3 based FVPs

For Arm Corstone-300 and Arm Corstone-310:

```shell
$ <path_to_installed_FVP> \
Expand All @@ -244,7 +253,9 @@ To run the VSI application, append the command line with the v_path argument. Fo
-C mps3_board.v_path=./device/corstone/vsi/video/python/
```

#### Arm Corstone-315
#### Arm MPS4 based FVPs

For Arm Corstone-315 and Arm Corstone-320:

```shell
$ <path_to_installed_FVP> \
Expand Down
3 changes: 1 addition & 2 deletions cmsis-pack-examples/cdefault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.4.0/tools/projmgr/schemas/cdefault.schema.json

default:
# Note that we need AC6@6.18 or higher to compile for Corstone-310 target.
compiler: AC6

misc:
# Note that we need AC6@6.18 or higher to compile for Arm Cortex-M85 based targets.
- for-compiler: AC6
CPP:
- -std=c++17
Expand Down
6 changes: 3 additions & 3 deletions cmsis-pack-examples/common/include/BufAttributes.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its
* SPDX-FileCopyrightText: Copyright 2022, 2024 Arm Limited and/or its
* affiliates <open-source-office@arm.com>
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -19,9 +19,9 @@
#ifndef BUF_ATTRIBUTES_HPP
#define BUF_ATTRIBUTES_HPP

#if defined(ETHOSU55) || defined(ETHOSU65)
#if defined(ETHOSU55) || defined(ETHOSU65) || defined(ETHOSU85)
#define ARM_NPU
#endif /* defined(ETHOSU55) || defined(ETHOSU65) */
#endif /* defined(ETHOSU55) || defined(ETHOSU65) || defined(ETHOSU85) */

#if defined(ARM_NPU)
/* When Arm NPU is defined, we use the config set by NPU mem parameters */
Expand Down
6 changes: 3 additions & 3 deletions cmsis-pack-examples/common/include/ethosu_mem_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Arm Limited. All rights reserved.
* Copyright (c) 2022, 2024 Arm Limited. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -25,11 +25,11 @@
#define ETHOS_U_MEM_BYTE_ALIGNMENT 16

#ifndef ETHOS_U_NPU_MEMORY_MODE
#if defined(ETHOSU65)
#if defined(ETHOSU65) || defined(ETHOSU85)
#define ETHOS_U_NPU_MEMORY_MODE ETHOS_U_NPU_MEMORY_MODE_DEDICATED_SRAM
#else
#define ETHOS_U_NPU_MEMORY_MODE ETHOS_U_MEMORY_MODE_SHARED_SRAM
#endif /* defined (ETHOSU65) */
#endif /* defined (ETHOSU65) || defined(ETHOSU85) */
#endif /* ETHOS_U_NPU_MEMORY_MODE */

#if (ETHOS_U_NPU_MEMORY_MODE == ETHOS_U_NPU_MEMORY_MODE_DEDICATED_SRAM)
Expand Down
16 changes: 12 additions & 4 deletions cmsis-pack-examples/device/corstone/corstone-device.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@

layer:

description: Corstone-300/310 device related components and files.
description: Arm Corstone reference package related components and files.

groups:
- group: Retarget
for-context:
- +AVH-SSE-300
- +AVH-SSE-310
- +AVH-SSE-315
- +AVH-SSE-300-U55
- +AVH-SSE-310-U55
- +AVH-SSE-300-U65
- +AVH-SSE-310
- +AVH-SSE-310-U55
- +AVH-SSE-310-U65
- +AVH-SSE-315
- +AVH-SSE-315-U65
- +AVH-SSE-320
- +AVH-SSE-320-U85

files:
- file: src/retarget.c
- file: src/uart_cmsdk_apb.c
Expand Down Expand Up @@ -58,15 +61,20 @@ layer:
- +AVH-SSE-300-U65
- +AVH-SSE-310-U65
- +AVH-SSE-315-U65
- component: Arm::Machine Learning:NPU Support:Ethos-U Driver&Generic U85
for-context:
- +AVH-SSE-320-U85
- component: tensorflow::Machine Learning:TensorFlow:Kernel&Ethos-U
for-context:
- +AVH-SSE-300-U55
- +AVH-SSE-310-U55
- +AVH-SSE-300-U65
- +AVH-SSE-310-U65
- +AVH-SSE-315-U65
- +AVH-SSE-320-U85
- component: tensorflow::Machine Learning:TensorFlow:Kernel&CMSIS-NN
for-context:
- +AVH-SSE-300
- +AVH-SSE-310
- +AVH-SSE-315
- +AVH-SSE-320
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Notes:
# Parameters:
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
#---------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Parameters:
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
#---------------------------------------------------------------------------------------------------
mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available)
mps4_board.subsystem.ethosu.num_macs=256 # (int , init-time) default = '0x100' : Number of 8x8 MACs performed per cycle (256 or 512)
#---------------------------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion cmsis-pack-examples/device/corstone/src/BoardInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int arm_ethosu_npu_init(void)
#if defined(CORSTONE300_FVP)
void* const ethosu_base_address = (void*)(ETHOS_U55_APB_BASE_S);
#else
void* const ethosu_base_address = (void*)(NPU0_APB_BASE_NS);
void* const ethosu_base_address = (void*)(NPU0_APB_BASE_S);
#endif

debug("Cache arena: 0x%p\n", get_cache_arena());
Expand Down
24 changes: 20 additions & 4 deletions cmsis-pack-examples/kws/kws.cproject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ project:
- group: Wav file based example
for-context:
- +AVH-SSE-300
- +AVH-SSE-310
- +AVH-SSE-315
- +AVH-SSE-300-U55
- +AVH-SSE-300-U65
- +AVH-SSE-310
- +AVH-SSE-310-U55
- +AVH-SSE-310-U65
- +AVH-SSE-315
- +AVH-SSE-315-U65
- +AVH-SSE-300-U55
- +AVH-SSE-310-U55
- +AVH-SSE-320
- +AVH-SSE-320-U85
- +FRDM-K64F

files:
Expand Down Expand Up @@ -69,13 +71,18 @@ project:
- +AVH-SSE-310-U65
- +AVH-SSE-315-U65

- file: src/kws_micronet_m_vela_Z256.tflite.cpp
for-context:
- +AVH-SSE-320-U85

- file: src/kws_micronet_m.tflite.cpp
for-context:
- +FRDM-K64F
- +STM32F746-DISCO
- +AVH-SSE-300
- +AVH-SSE-310
- +AVH-SSE-315
- +AVH-SSE-320

- group: Device Files
files:
Expand All @@ -84,19 +91,26 @@ project:
- +AVH-SSE-300
- +AVH-SSE-300-U55
- +AVH-SSE-300-U65

- file: linker/mps3-sse-310.sct
for-context:
- +AVH-SSE-310
- +AVH-SSE-310-U55
- +AVH-SSE-310-U65

- file: linker/mps4-sse-315.sct
for-context:
- +AVH-SSE-315
- +AVH-SSE-315-U65
- +AVH-SSE-320
- +AVH-SSE-320-U85

- file: linker/frdm-k64f.sct
for-context: +FRDM-K64F

- file: linker/stm32f746-disco.sct
for-context: +STM32F746-DISCO

- file: linker/alif-e7-m55-he.sct
for-context: +Alif-E7-M55-HE

Expand All @@ -115,6 +129,8 @@ project:
- +AVH-SSE-310-U65
- +AVH-SSE-315
- +AVH-SSE-315-U65
- +AVH-SSE-320
- +AVH-SSE-320-U85

- layer: ../device/frdm-k64f/frdm-k64f-device.clayer.yml
for-context:
Expand Down
Loading

0 comments on commit 171982f

Please sign in to comment.