1+ # Copyright 2026 Arm Limited and/or its affiliates.
2+ #
3+ # SPDX-License-Identifier: Apache-2.0
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the License); you may
6+ # not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # 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, WITHOUT
13+ # 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 : Build and Run FVP_Audio Example
18+ on :
19+
20+ workflow_dispatch :
21+ pull_request :
22+ paths :
23+ # Execute workflow when PR modifies this file
24+ - .github/workflows/Build_Run_FVP_Audio.yml
25+ # Execute workflow when PR modifies example directory
26+ - example/FVP_Audio/**
27+ push :
28+ # Execute workflow when main branch is updated
29+ branches : [main]
30+
31+ # schedule:
32+ # - cron: '00 20 * * 6'
33+
34+ concurrency :
35+ group : ${{ github.workflow }}-${{ github.ref }}
36+ cancel-in-progress : true
37+
38+ jobs :
39+ Build_Run :
40+ strategy :
41+ matrix :
42+ context : [
43+ {proj: FVP_Audio, build_type: Debug, target_type: SSE-300, model: FVP_Corstone_SSE-300, layer: Corstone-300, mps: mps3},
44+ {proj: FVP_Audio, build_type: Release, target_type: SSE-300, model: FVP_Corstone_SSE-300, layer: Corstone-300, mps: mps3},
45+
46+ {proj: FVP_Audio, build_type: Debug, target_type: SSE-310, model: FVP_Corstone_SSE-310, layer: Corstone-310, mps: mps3},
47+ {proj: FVP_Audio, build_type: Release, target_type: SSE-310, model: FVP_Corstone_SSE-310, layer: Corstone-310, mps: mps3},
48+
49+ {proj: FVP_Audio, build_type: Debug, target_type: SSE-315, model: FVP_Corstone_SSE-315, layer: Corstone-315, mps: mps4},
50+ {proj: FVP_Audio, build_type: Release, target_type: SSE-315, model: FVP_Corstone_SSE-315, layer: Corstone-315, mps: mps4},
51+
52+ {proj: FVP_Audio, build_type: Debug, target_type: SSE-320, model: FVP_Corstone_SSE-320, layer: Corstone-320, mps: mps4},
53+ {proj: FVP_Audio, build_type: Release, target_type: SSE-320, model: FVP_Corstone_SSE-320, layer: Corstone-320, mps: mps4}
54+ ]
55+ toolchain : [
56+ {name: AC6, ext: axf},
57+ {name: GCC, ext: elf},
58+ {name: CLANG, ext: elf}
59+ ]
60+
61+ fail-fast : false
62+
63+ runs-on : ubuntu-latest
64+
65+ steps :
66+ - name : Checkout current repository
67+ uses : actions/checkout@v6
68+
69+ - name : Set up Python 3.9
70+ uses : actions/setup-python@v6
71+ with :
72+ python-version : ' 3.9'
73+
74+ - name : Install Python packages
75+ run : |
76+ sudo apt-get update
77+ sudo apt-get install -y portaudio19-dev
78+ python3 --version
79+ python3 -m pip install --user opencv-python
80+ python3 -m pip install --user pyaudio
81+
82+ - name : Install tools
83+ uses : ARM-software/cmsis-actions/vcpkg@v1
84+ with :
85+ config : " .ci/vcpkg-configuration.json"
86+
87+ - name : Activate Arm tool license
88+ uses : ARM-software/cmsis-actions/armlm@v1
89+
90+ - name : Fix FVP libstdc++ compatibility
91+ run : |
92+ FVP_PATH=$(dirname $(which FVP_Corstone_SSE-300))
93+ if [ -f "$FVP_PATH/../fmtplib/libstdc++.so.6" ]; then
94+ echo "Renaming old libstdc++.so.6 to avoid version conflicts"
95+ mv "$FVP_PATH/../fmtplib/libstdc++.so.6" "$FVP_PATH/../fmtplib/libstdc++.so.6.bak"
96+ fi
97+
98+ - name : Initialize CMSIS pack root folder
99+ run : |
100+ cpackget init https://www.keil.com/pack/index.pidx
101+ cpackget update-index
102+
103+ - name : Add local CMSIS packs
104+ run : |
105+ cpackget add ./ARM.AVH_FVP.pdsc
106+
107+ - name : Build example
108+ working-directory : ./example/FVP_Audio
109+ run : |
110+ cbuild FVP_Audio.csolution.yml \
111+ --context .${{matrix.context.build_type}}+${{matrix.context.target_type}} \
112+ --toolchain ${{matrix.toolchain.name}} \
113+ --update-rte --rebuild --packs
114+
115+ - name : Execute example
116+ working-directory : ./example/FVP_Audio
117+ run : |
118+ ${{ matrix.context.model }} \
119+ -a ./out/${{matrix.context.proj}}/${{matrix.context.target_type}}/${{matrix.context.build_type}}/${{matrix.context.proj}}.${{matrix.toolchain.ext}} \
120+ -f ./board/${{matrix.context.layer}}/fvp_config.txt \
121+ -C ${{matrix.context.mps}}_board.v_path=./board/${{matrix.context.layer}}/vsi/python/ \
122+ -C ${{matrix.context.mps}}_board.uart0.out_file=${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log \
123+ --simlimit 30
124+
125+ - name : Show UART output
126+ working-directory : ./example/FVP_Audio
127+ run : |
128+ echo "FVP UART output:"
129+ cat ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log
130+
131+ - name : Check UART output
132+ # Disable SSE-320 output check due to known issue with FVP UART output
133+ if : matrix.context.target_type != 'SSE-320'
134+ working-directory : ./example/FVP_Audio
135+ run : |
136+ echo "Check FVP UART output:"
137+ COUNT=$(grep "Audio streaming stopped." ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log | wc -l)
138+ if [ "$COUNT" -ge 1 ]; then
139+ echo "Passed"
140+ else
141+ echo "Failed"
142+ exit 1
143+ fi
144+
145+ - name : Check audio output
146+ working-directory : ./example/FVP_Audio
147+ run : |
148+ echo "Check output file:"
149+ if [ -f "./sample/AudioOut.wav" ]; then
150+ echo "Passed"
151+ else
152+ echo "Failed"
153+ exit 1
154+ fi
155+
156+ - name : Upload FVP UART output log
157+ uses : actions/upload-artifact@v6
158+ with :
159+ name : ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log
160+ path : ./example/FVP_Audio/${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log
161+
162+ - name : Upload Audio file
163+ uses : actions/upload-artifact@v6
164+ with :
165+ name : ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.AudioOut.wav
166+ path : ./example/FVP_Audio/sample/AudioOut.wav
0 commit comments