Skip to content

Commit a89c085

Browse files
committed
Added output verification for zephyr tests and templatized the model selection to make more extensible for future tests
1 parent 112a09f commit a89c085

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.github/workflows/trunk.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
mkdir -p zephyr_scratch/
7979
cd zephyr_scratch
8080
export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
81+
export ARM_FVP_TUTORIALS_ROOT=$ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm-fvp-tutorials
8182
8283
download_arm_zephyr_sdk
8384
./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi
@@ -90,11 +91,36 @@ jobs:
9091
.ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
9192
source examples/arm/ethos-u-scratch/setup_path.sh
9293
source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
93-
cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world
94+
95+
# Get the model as PTE
96+
python -m examples.arm.aot_arm_compiler --model_name="${MODEL_NAME}" --output="${MODEL_NAME}.pte"
97+
98+
# Generate the C-style header
99+
cd $ARM_FVP_TUTORIALS_ROOT
100+
python build_model.py --pte-file ~/modules/lib/executorch/${MODEL_NAME}.pte --output-path models/${MODEL_NAME}/src/
101+
cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm-fvp-tutorials/models/${MODEL_NAME}/
102+
103+
# Build the zephyr elf
94104
west build -p always -b mps3/corstone300/fvp
95-
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 120
96105
97-
grep -qF "Output[0][0]: (float) 2.000000" sim.out
106+
# Run the simulation
107+
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf \
108+
-C mps3_board.visualisation.disable-visualisation=1 \
109+
-C mps3_board.telnetterminal0.start_telnet=0 \
110+
-C mps3_board.uart0.out_file='sim.out' \
111+
-C cpu0.CFGITCMSZ=15 \
112+
-C cpu0.CFGDTCMSZ=15 \
113+
--simlimit 120
114+
115+
# Report failure if any of the ouptut verification checks fail
116+
grep -qF "ERROR" sim.out
117+
exit_status=$? #store 0 if found (failure), 1 if not (success)
118+
if [[ "$exit_status" -eq "0" ]]; then
119+
exit 1
120+
fi
121+
122+
# Report fail if simulation does not complete successfully
123+
grep -qF "SUCCESS: Program complete, exiting." sim.out
98124
exit_status=$? #store 0 if found (success), 1 if not (failure)
99125
exit $exit_status
100126

0 commit comments

Comments
 (0)