Skip to content

Commit 7454494

Browse files
Merge pull request #144 from kshitij-sisodia-arm/feature/ci-workflows
CI workflows for cmsis-pack-examples
2 parents 2321def + 15c7506 commit 7454494

File tree

11 files changed

+243
-17
lines changed

11 files changed

+243
-17
lines changed

cmsis-pack-examples/.ci/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Continuous Integration (CI) Tests for CMSIS-Pack based Machine Learning Examples
2+
3+
4+
Content of `.ci` Directory | Description
5+
:----------------------------|:-----------------
6+
`vcpkg-configuration.json` | Tool setup for the CI test.
7+
8+
9+
## GitHub Action Workflows
10+
11+
The [GitHub Actions](https://docs.github.com/en/actions) in the directory `.github/workflows` are the scripts for the CI tests. These scripts contain detailed comments about each step that is executed.
12+
13+
These examples use the [Arm® Compiler for Embedded](https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded) (AC6) toolchain. As such all workflows are using this compiler.
14+
15+
- `AVH-FVP-CI.yml` implements the *AVH build and execution test* that runs on [Arm Virtual Hardware - Fixed Virtual Platforms (AVH FVP)](https://arm-software.github.io/AVH/main/simulation/html/index.html) simulation models. The directory `FVP` contains configuration files for the FVP simulation models.
16+
17+
- `Hardware-CI.yml` implmentes the *Hardware build test* that runs on evaluation boards. The output of this build test is stored as artifacts and can be downloaded to the evaluation board for execution.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"registries": [
3+
{
4+
"name": "arm",
5+
"kind": "artifact",
6+
"location": "https://artifacts.tools.arm.com/vcpkg-registry"
7+
}
8+
],
9+
"requires": {
10+
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.4.0",
11+
"arm:tools/kitware/cmake": "^3.28.4",
12+
"arm:tools/ninja-build/ninja": "^1.12.0",
13+
"arm:compilers/arm/armclang": "^6.22.0",
14+
"arm:compilers/arm/arm-none-eabi-gcc": "^13.2.1",
15+
"arm:models/arm/avh-fvp": "^11.26.11"
16+
}
17+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its
2+
# affiliates <[email protected]>
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://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,
13+
# WITHOUT 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+
name: AVH build and execution test
18+
on:
19+
workflow_dispatch:
20+
pull_request:
21+
branches: [main]
22+
push:
23+
branches: [main]
24+
schedule:
25+
- cron: '00 20 * * 6'
26+
27+
jobs:
28+
AVH:
29+
strategy:
30+
31+
matrix:
32+
target: [
33+
{proj: kws, board: AVH-SSE-300, model: FVP_Corstone_SSE-300, uart: mps3_board.uart0},
34+
{proj: kws, board: AVH-SSE-300-U55, model: FVP_Corstone_SSE-300_Ethos-U55, uart: mps3_board.uart0},
35+
{proj: kws, board: AVH-SSE-300-U65, model: FVP_Corstone_SSE-300_Ethos-U65, uart: mps3_board.uart0},
36+
{proj: kws, board: AVH-SSE-310, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
37+
{proj: kws, board: AVH-SSE-310-U55, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
38+
{proj: kws, board: AVH-SSE-310-U65, model: FVP_Corstone_SSE-310_Ethos-U65, uart: mps3_board.uart0},
39+
{proj: object-detection, board: AVH-SSE-300, model: FVP_Corstone_SSE-300, uart: mps3_board.uart0},
40+
{proj: object-detection, board: AVH-SSE-300-U55, model: FVP_Corstone_SSE-300_Ethos-U55, uart: mps3_board.uart0},
41+
{proj: object-detection, board: AVH-SSE-300-U65, model: FVP_Corstone_SSE-300_Ethos-U65, uart: mps3_board.uart0},
42+
{proj: object-detection, board: AVH-SSE-310, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
43+
{proj: object-detection, board: AVH-SSE-310-U55, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
44+
{proj: object-detection, board: AVH-SSE-310-U65, model: FVP_Corstone_SSE-310_Ethos-U65, uart: mps3_board.uart0}
45+
]
46+
47+
fail-fast: false
48+
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout repo
53+
uses: actions/checkout@v4
54+
55+
- name: Install tools
56+
uses: ARM-software/cmsis-actions/vcpkg@v1
57+
with:
58+
config: ".ci/vcpkg-configuration.json"
59+
60+
- name: Activate Arm tool license
61+
uses: ARM-software/cmsis-actions/armlm@v1
62+
63+
- name: Build project ${{ matrix.target.proj }} for target ${{ matrix.target.board }} with AC6
64+
run: |
65+
cbuild mlek.csolution.yml --update-rte --packs --context ${{ matrix.target.proj }}+${{ matrix.target.board }}
66+
67+
- name: Execute project ${{ matrix.target.proj }}, target ${{ matrix.target.board }}, build Release on AVH ${{ matrix.target.model }}
68+
if: always()
69+
run: |
70+
${{ matrix.target.model }} \
71+
-a ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/${{ matrix.target.proj }}.axf \
72+
-f ./FVP/${{ matrix.target.model }}/fvp_config.txt \
73+
-C ${{ matrix.target.uart }}.out_file=./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/fvp_stdout.log \
74+
--simlimit 60 --stat
75+
cat ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Release/fvp_stdout.log
76+
77+
- name: Execute project ${{ matrix.target.proj }}, target ${{ matrix.target.board }}, build Debug on AVH ${{ matrix.target.model }}
78+
if: always()
79+
run: |
80+
${{ matrix.target.model }} \
81+
-a ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/${{ matrix.target.proj }}.axf \
82+
-f ./FVP/${{ matrix.target.model }}/fvp_config.txt \
83+
-C ${{ matrix.target.uart }}.out_file=./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/fvp_stdout.log \
84+
--simlimit 60 --stat
85+
cat ./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/Debug/fvp_stdout.log
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its
2+
# affiliates <[email protected]>
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://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,
13+
# WITHOUT 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+
name: Hardware build test
18+
on:
19+
workflow_dispatch:
20+
pull_request:
21+
branches: [main]
22+
push:
23+
branches: [main]
24+
schedule:
25+
- cron: '00 20 * * 6'
26+
27+
jobs:
28+
HW:
29+
strategy:
30+
31+
matrix:
32+
target: [
33+
{proj: kws, board: FRDM-K64F},
34+
{proj: kws, board: STM32F746-DISCO}
35+
# {proj: kws, board: Alif-E7-M55-HP},
36+
# {proj: object-detection, board: Alif-E7-M55-HP}
37+
]
38+
39+
fail-fast: false
40+
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout repo
45+
uses: actions/checkout@v4
46+
47+
- name: Install tools
48+
uses: ARM-software/cmsis-actions/vcpkg@v1
49+
with:
50+
config: ".ci/vcpkg-configuration.json"
51+
52+
- name: Activate Arm tool license
53+
uses: ARM-software/cmsis-actions/armlm@v1
54+
55+
- name: Build project ${{ matrix.target.proj }} for target ${{ matrix.target.board }} with AC6
56+
run: |
57+
cbuild mlek.csolution.yml --update-rte --packs --context ${{ matrix.target.proj }}+${{ matrix.target.board }}
58+
59+
- name: Upload build Artifact
60+
if: always()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ${{ matrix.target.proj }}_${{ matrix.target.board }}_AC6
64+
path: |
65+
./out/${{ matrix.target.proj }}/${{ matrix.target.board }}/
66+
retention-days: 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Notes:
2+
# Parameters:
3+
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
4+
#---------------------------------------------------------------------------------------------------
5+
mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
6+
mps3_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)
7+
#---------------------------------------------------------------------------------------------------
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Notes:
2+
# Parameters:
3+
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
4+
#---------------------------------------------------------------------------------------------------
5+
mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
6+
mps3_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)
7+
ethosu.num_macs=256 # (int , init-time) default = '0x80' : Number of 8x8 MACs performed per cycle
8+
#---------------------------------------------------------------------------------------------------
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Notes:
2+
# Parameters:
3+
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
4+
#---------------------------------------------------------------------------------------------------
5+
mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
6+
mps3_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)
7+
ethosu.num_macs=256 # (int , init-time) default = '0x100' : Number of 8x8 MACs performed per cycle
8+
#---------------------------------------------------------------------------------------------------
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Parameters:
2+
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
3+
#---------------------------------------------------------------------------------------------------
4+
mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
5+
mps3_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)
6+
ethosu.num_macs=256 # (int , init-time) default = '0x100' : Number of 8x8 MACs performed per cycle (32, 64, 128, or 256)
7+
#---------------------------------------------------------------------------------------------------
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Parameters:
2+
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
3+
#---------------------------------------------------------------------------------------------------
4+
mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
5+
mps3_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)
6+
ethosu.num_macs=256 # (int , init-time) default = '0x100' : Number of 8x8 MACs performed per cycle (256 or 512)
7+
#---------------------------------------------------------------------------------------------------

cmsis-pack-examples/README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![License](https://img.shields.io/github/license/Arm-Examples/mlek-cmsis-pack-examples?label)](https://github.com/Arm-Examples/mlek-cmsis-pack-examples/blob/main/LICENSE)
2+
[![AVH build and execution test](https://img.shields.io/github/actions/workflow/status/Arm-Examples/mlek-cmsis-pack-examples/AVH-FVP-CI.yml?logo=arm&logoColor=0091bd&label=AVH%20build%20and%20execution%20test)](/.github/workflows/AVH-FVP-CI.yml)
3+
[![Hardware build test](https://img.shields.io/github/actions/workflow/status/Arm-Examples/mlek-cmsis-pack-examples/Hardware-CI.yml?logo=arm&logoColor=0091bd&label=Hardware%20build%20test)](./.github/workflows/Hardware-CI.yml)
4+
15
# CMSIS-Pack based Machine Learning Examples
26

37
- [CMSIS-Pack based Machine Learning Examples](#cmsis-pack-based-machine-learning-examples)
@@ -8,12 +12,13 @@
812
- [Object detection](#object-detection)
913
- [Keyword spotting](#keyword-spotting)
1014
- [Prerequisites](#prerequisites)
11-
- [Support for Visual Studio Code](#support-for-visual-studio-code)
12-
- [Tools](#tools)
15+
- [Visual Studio Code](#visual-studio-code)
1316
- [Packs](#packs)
1417
- [Building the examples](#building-the-examples)
18+
- [Launch project in Visual Studio Code](#launch-project-in-visual-studio-code)
1519
- [Download Software Packs](#download-software-packs)
1620
- [Generate and build the project](#generate-and-build-the-project)
21+
- [Execute project](#execute-project)
1722
- [Application output](#application-output)
1823
- [Trademarks](#trademarks)
1924
- [Licenses](#licenses)
@@ -25,6 +30,7 @@ This repository contains Machine Learning (ML) examples using the CMSIS-Pack fro
2530
[ML Embedded Evaluation Kit](https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ml-embedded-evaluation-kit/+/refs/heads/main).
2631

2732
## Examples
33+
2834
Currently, the following examples are supported:
2935

3036
- **Object detection** - detects objects in the input image.
@@ -36,8 +42,12 @@ Target platforms supported:
3642

3743
| Name | Type | IP | Examples |
3844
|-----------------------|---------------------|-----------------------------------------------|----------|
39-
| Arm® Corstone™-300 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 or Arm® Ethos™-U65 NPU | All |
40-
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 or Arm® Ethos™-U65 NPU | All |
45+
| Arm® Corstone™-300 | Virtual or physical | Arm® Cortex®-M55 CPU | All |
46+
| Arm® Corstone™-300-U55 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 | All |
47+
| Arm® Corstone™-300-U65 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U65 | All |
48+
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
49+
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 | All |
50+
| Arm® Corstone™-310-U65 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U65 NPU | All |
4151
| Alif™ Ensemble™ E7 AI/ML Kit | Physical board | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 NPU | All |
4252
| STM32® F746G-Discovery| Physical board | Arm® Cortex®-M7 CPU | KWS |
4353
| NXP® FRDM-K64F | Physical board | Arm® Cortex®-M4 CPU | KWS |
@@ -75,7 +85,6 @@ This example can detect up to twelve keywords in the input audio stream. The
7585

7686
More details about the input for this example can be found [here](https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ml-embedded-evaluation-kit/+/refs/heads/main/docs/use_cases/kws.md#preprocessing-and-feature-extraction).
7787

78-
7988
# Prerequisites
8089

8190
## Visual Studio Code
@@ -98,7 +107,6 @@ CMSIS-Pack defines a standardized way to deliver software components, device par
98107
support information and code. A list of available CMSIS-Packs can be found
99108
[here](https://developer.arm.com/tools-and-software/embedded/cmsis/cmsis-packs).
100109

101-
102110
# Building the examples
103111

104112
## Launch project in Visual Studio Code
@@ -180,7 +188,7 @@ a physical hardware board.
180188

181189
- When using a Fixed Virtual Platform installed locally:
182190
```shell
183-
$ <path_to_installed_FVP> -a ./out/kws/AVH-SSE-300-U55/Debug/kws.Debug+AVH-SSE-300-U55.axf -C ethosu.num_macs=256
191+
$ <path_to_installed_FVP> -a ./out/kws/AVH-SSE-300-U55/Debug/kws.Debug+AVH-SSE-300-U55.axf -f ./FVP/FVP_Corstone_SSE-300/fvp_config.txt
184192
```
185193
> **NOTE**: The FVP defaults to running 128 MAC configuration for Arm® Ethos™-U55 NPU.
186194
> However, our default neural network model for the NPU is for 256 MAC configuration.

0 commit comments

Comments
 (0)