Skip to content

Commit 05e6bef

Browse files
Github action for CMSIS-DSP testing (ARM-software#183)
Add github action for running CMSIS-DSP tests on each commit or PR to the main branch
1 parent 3ebc686 commit 05e6bef

15 files changed

+194
-245
lines changed

.github/workflows/runtest.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Compile and Run
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
actions: read
11+
security-events: write
12+
13+
jobs:
14+
CI_test_run:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Python 3.10
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Install system packages
27+
run: |
28+
sudo add-apt-repository ppa:deadsnakes/ppa
29+
sudo apt-get install libpython3.9 libtinfo5
30+
31+
- name: Activate vcpkg
32+
uses: ARM-software/cmsis-actions/vcpkg@v1
33+
34+
- name: Activate Arm tool license
35+
uses: ARM-software/cmsis-actions/armlm@v1
36+
37+
- name: Prepare framework
38+
run: |
39+
cd Testing
40+
echo "Create missing folders"
41+
mkdir FullBenchmark
42+
mkdir Output
43+
mkdir GeneratedInclude
44+
mkdir GeneratedSource
45+
mkdir GeneratedIncludeBench
46+
mkdir GeneratedSourceBench
47+
48+
echo "Install missing python packages"
49+
pip install -r requirements.txt
50+
51+
echo "Preprocess test description"
52+
python preprocess.py -f desc.txt -o Output.pickle
53+
python preprocess.py -f desc_f16.txt -o Output_f16.pickle
54+
55+
echo "Generate missing CPP headers"
56+
python processTests.py -gen . -p Patterns -d Parameters -f Output.pickle -e
57+
python processTests.py -gen . -p Patterns -d Parameters -f Output_f16.pickle -e
58+
59+
cd cmsis_build
60+
61+
echo "Load missing pack"
62+
csolution list packs -s test_ac6.csolution.yml -m > required_packs.txt
63+
64+
cat required_packs.txt
65+
cpackget add -f required_packs.txt
66+
67+
- name: Execute
68+
run: |
69+
cd Testing/cmsis_build
70+
echo "Running tests"
71+
72+
python runall.py -avh $AVH_FVP_PLUGINS/../bin
73+
74+
- name: Upload test report
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: test-report
78+
path: Testing/cmsis_build/summary.html
79+
80+
81+
- name: Check error
82+
run: |
83+
cd Testing/cmsis_build
84+
85+
echo "Checking output..."
86+
test "$(grep "Error" summary.html | wc -l)" -eq 0

Testing/cmsis_build/runall.py

Lines changed: 54 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
parser.add_argument('-n', action='store_true', help="No force rebuild")
1313
parser.add_argument('-r', action='store_true', help="Raw results only")
1414
parser.add_argument('-c', action='store_true', help="Display cycles (so passing test are displayed)")
15+
parser.add_argument('-l', action='store_true', help="Local run (not github action)")
1516

1617
args = parser.parse_args()
1718

19+
1820
DEBUG=False
1921
if args.d:
2022
DEBUG=True
@@ -112,9 +114,19 @@ def run(*args,mustPrint=False,dumpStdErr=True):
112114
}
113115

114116
# Windows executable
115-
# (At some point this script will also support
116-
# unix)
117-
avhExe={
117+
avhUnixExe={
118+
"CS310":"FVP_Corstone_SSE-310_Ethos-U65",
119+
"CS300":"FVP_Corstone_SSE-300_Ethos-U55",
120+
"M55":"FVP_MPS2_Cortex-M55",
121+
"M33_DSP_FP":"FVP_MPS2_Cortex-M33",
122+
"M7DP":"FVP_MPS2_Cortex-M7",
123+
"M4FP":"FVP_MPS2_Cortex-M4",
124+
"M3":"FVP_MPS2_Cortex-M3",
125+
"M23":"FVP_MPS2_Cortex-M23",
126+
"M0plus":"FVP_MPS2_Cortex-M0plus",
127+
}
128+
129+
avhWindowsExe={
118130
"CS310":"VHT_Corstone_SSE-310.exe",
119131
"CS300":"VHT_Corstone_SSE-300_Ethos-U55.exe",
120132
"M55":"VHT_MPS2_Cortex-M55.exe",
@@ -138,7 +150,20 @@ def runAVH(build,core):
138150
if os.path.exists(elf):
139151
app = elf
140152
config = os.path.join("configs",configFiles[core])
141-
avh = os.path.join(AVHROOT,avhExe[core])
153+
154+
if AVHROOT:
155+
avhAttempt = os.path.join(AVHROOT,avhWindowsExe[core])
156+
if os.path.exists(avhAttempt):
157+
avh = avhAttempt
158+
159+
avhAttempt = os.path.join(AVHROOT,avhUnixExe[core])
160+
if os.path.exists(avhAttempt):
161+
avh = avhAttempt
162+
else:
163+
avh = avhUnixExe[core]
164+
165+
166+
142167
res=run(avh,"-f",config,app)
143168
return(res)
144169

@@ -160,50 +185,14 @@ def runAVH(build,core):
160185
# Test suite and output pickle needed to decode the result
161186
#print(allSuites)
162187

163-
#allSuites=[
164-
#("MFCCQ15","../Output.pickle"),
165-
#("MFCCQ31","../Output.pickle"),
166-
#("SupportTestsF16","../Output_f16.pickle"),
167-
#]
168188

169-
#allSuites=[("ComplexTestsF32","../Output.pickle"),
170-
#("DistanceTestsF32","../Output.pickle"),
171-
#("UnaryTestsF32","../Output.pickle"),
172-
#("QuaternionTestsF32","../Output.pickle"),
173-
#("StatsTestsF32","../Output.pickle")
174-
#]
175189

176190
#allSuites=[
177-
#("TransformCF64","../Output.pickle"),
178-
#("TransformCF32","../Output.pickle"),
179-
#("TransformCQ31","../Output.pickle"),
180-
#("TransformCQ15","../Output.pickle"),
181-
#
182-
#("TransformRF64","../Output.pickle"),
183-
#("TransformRF32","../Output.pickle"),
184-
#("TransformRQ31","../Output.pickle"),
185-
#("TransformRQ15","../Output.pickle"),
186-
#
187-
#("MFCCF32","../Output.pickle"),
188-
#("MFCCQ31","../Output.pickle"),
189-
#("MFCCQ15","../Output.pickle"),
190-
#
191-
#("MFCCF16","../Output_f16.pickle"),
192-
#("TransformCF16","../Output_f16.pickle"),
193-
#("TransformRF16","../Output_f16.pickle")
191+
#("DECIMF64","../Output.pickle"),
192+
#("UnaryTestsF32","../Output.pickle"),
193+
#("UnaryTestsF16","../Output_f16.pickle"),
194194
#]
195195

196-
#allSuites=[("StatsTestsQ7","../Output.pickle")]
197-
198-
allSuites=[
199-
("UnaryTestsF64","../Output.pickle"),
200-
("UnaryTestsF32","../Output.pickle"),
201-
("UnaryTestsF16","../Output_f16.pickle"),
202-
#("MISCQ15","../Output.pickle"),
203-
#("MISCQ7","../Output.pickle"),
204-
#("FIRF16","../Output_f16.pickle")
205-
]
206-
207196
# Solution and build file for all
208197
# the tests
209198
# It is a pair : csolution target type and AVH identification
@@ -213,7 +202,7 @@ def runAVH(build,core):
213202
'test_ac6.csolution.yml':[
214203
# ("VHT-Corstone-310","CS310"),
215204
("VHT-Corstone-300","CS300"),
216-
# ("VHT-Corstone-300-NOMVE","CS300"),
205+
("VHT-Corstone-300-NOMVE","CS300"),
217206
("VHT_M33","M33_DSP_FP"),
218207
("VHT_M7","M7DP"),
219208
("VHT_M7_UNROLLED","M7DP"),
@@ -222,24 +211,31 @@ def runAVH(build,core):
222211
# #("VHT_M23","M23"),
223212
("VHT_M0P","M0plus")
224213
],
225-
'test_gcc.csolution.yml':[
226-
#("VHT-Corstone-310","CS310"),
214+
#'test_gcc.csolution.yml':[
215+
# ("VHT-Corstone-300","CS300"),
227216
#("VHT_M55","M55"),
228217
##("VHT_M33","M33_DSP_FP"),
229-
("VHT_M7","M7DP"),
230-
("VHT_M7_UNROLLED","M7DP"),
231-
("VHT_M4","M4FP"),
218+
# ("VHT_M7","M7DP"),
219+
# ("VHT_M7_UNROLLED","M7DP"),
220+
# ("VHT_M4","M4FP"),
232221
##("VHT_M3","M3"),
233222
##("VHT_M23","M23"),
234-
("VHT_M0P","M0plus")
235-
]
223+
# ("VHT_M0P","M0plus")
224+
#]
236225
}
237226

238227
# Override previous solutions for more restricted testing.
239228
#solutions={
240229
# 'test_ac6.csolution.yml':[
241-
# #("VHT-Corstone-300","CS300"),
242-
# ("VHT_M7_UNROLLED","M7DP"),
230+
# ("VHT-Corstone-300","CS300"),
231+
# #("VHT_M7_UNROLLED","M7DP"),
232+
# ]
233+
#}
234+
#
235+
#solutions={
236+
# 'test_gcc.csolution.yml':[
237+
# ("VHT-Corstone-300","CS300"),
238+
# #("VHT_M7_UNROLLED","M7DP"),
243239
# ]
244240
#}
245241

@@ -336,7 +332,8 @@ def runAVH(build,core):
336332
print(res.msg,file=f)
337333
print(HTMLFOOTER,file=f)
338334

339-
if ERROR_OCCURED:
340-
sys.exit("Error occurred")
341-
else:
342-
sys.exit(0)
335+
if args.l:
336+
if ERROR_OCCURED:
337+
sys.exit("Error occurred")
338+
else:
339+
sys.exit(0)

0 commit comments

Comments
 (0)