Skip to content

Commit 6a25889

Browse files
committed
Address review feedback on cortex-m run.sh wiring
Drops `--quantize` from .ci/scripts/test_cortex_m_e2e.sh — run.sh has no such flag (only --no_quantize), so it was being silently swallowed; the default behavior is to quantize, so the wrapper just needs to omit it. Moves the dummy-input file creation back into run_fvp.sh so the script is self-contained when given --bundle=. Previously run.sh created fvp_dummy_input.bin next to the .bpte and run_fvp.sh asserted its existence — a cross-script contract enforced only by ordering. With this change run_fvp.sh creates the placeholder itself; future callers of run_fvp.sh --bundle= no longer need to know about the requirement. Adds a cortex-m branch to run.sh's check_setup() so a missing arm-none-eabi-gcc toolchain surfaces immediately rather than deeper in the build_test_runner.sh chain. Adds a comment to run_fvp.sh's FVP-model selection noting that cortex-m55 specifically maps to the SSE-300 FVP because it's the only Cortex-M CPU on Corstone-300 today; cortex-m85 falls through to SSE-320. Removes the now-redundant `backends/cortex_m/test/build_test_runner.sh` step from the reusable cortex-m e2e workflow — run.sh invokes it internally as part of the cortex-m target branch. This change was authored with Claude (claude-opus-4-7[1m]).
1 parent 087e6c7 commit 6a25889

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

.ci/scripts/test_cortex_m_e2e.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ MODEL=$1
1717
script_dir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
1818
et_root_dir=$(realpath "${script_dir}/../..")
1919

20+
# Quantization is the default for the cortex-m55+int8 target; run.sh's
21+
# arg parser only recognizes --no_quantize, so we omit any explicit flag.
2022
bash "${et_root_dir}/examples/arm/run.sh" \
2123
--model_name="${MODEL}" \
2224
--target=cortex-m55+int8 \
23-
--quantize \
2425
--bundleio

.github/workflows/_test_cortex_m_e2e.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,5 @@ jobs:
4343
.ci/scripts/setup-arm-baremetal-tools.sh
4444
source examples/arm/arm-scratch/setup_path.sh
4545
46-
# Build cortex-m test runner with bundled IO support
47-
backends/cortex_m/test/build_test_runner.sh
48-
49-
# Export model and run on FVP
46+
# Export and run model on FVP (run.sh internally builds the test runner).
5047
bash .ci/scripts/test_cortex_m_e2e.sh ${{ matrix.model }}

backends/arm/scripts/run_fvp.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ done
5555

5656
elf_file=$(realpath ${elf_file})
5757

58+
# cortex-m55 is the only Cortex-M CPU on the Corstone-300 board today;
59+
# cortex-m85 lives on Corstone-320, so it falls through to the SSE-320 FVP.
5860
if [[ ${target} == *"ethos-u55"* || ${target} == cortex-m55* ]]; then
5961
fvp_model=FVP_Corstone_SSE-300_Ethos-U55
6062
else
@@ -111,11 +113,9 @@ if [[ ${target} == cortex-m* ]]; then
111113
bundle_file=$(realpath "${bundle_file}")
112114
bundle_dir=$(dirname "${bundle_file}")
113115
bundle_name=$(basename "${bundle_file}")
114-
# The bundled-IO runner requires its -i argument to refer to a real file
115-
# even though inputs come from the embedded bundle; the caller is expected
116-
# to have created fvp_dummy_input.bin next to the bundle.
117-
[[ ! -f "${bundle_dir}/fvp_dummy_input.bin" ]] \
118-
&& { echo "[${BASH_SOURCE[0]}] ${bundle_dir}/fvp_dummy_input.bin is missing; the caller must create a placeholder input file next to the bundle"; exit 1; }
116+
# Bundled-IO runner needs -i to point at a real file even though
117+
# inputs come from the bundle.
118+
dd if=/dev/zero of="${bundle_dir}/fvp_dummy_input.bin" bs=4 count=1 2>/dev/null
119119
${nobuf} ${fvp_model} \
120120
-C ethosu.num_macs=${num_macs} \
121121
-C mps3_board.visualisation.disable-visualisation=1 \

examples/arm/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ function check_setup () {
223223
|| { echo "Executorch repo doesn't contain CMakeLists.txt file at root level"; return 1; }
224224

225225
backends/arm/scripts/build_executorch.sh --et_build_root="${et_build_root}" --build_type=$build_type $devtools_flag $et_dump_flag --toolchain="${toolchain}"
226+
elif [[ ${target} == cortex-m* ]]; then
227+
# build_test_runner.sh handles toolchain setup; just validate it's on PATH.
228+
hash arm-none-eabi-gcc \
229+
|| { echo "Could not find arm-none-eabi-gcc on PATH, ${_setup_msg}"; return 1; }
226230
elif [[ ${target} =~ "vgf" ]]; then
227231
model_converter=$(which model-converter)
228232
echo "${model_converter}"
@@ -364,10 +368,6 @@ for i in "${!test_model[@]}"; do
364368
set -x
365369
backends/cortex_m/test/build_test_runner.sh
366370
cortex_m_elf="${et_root_dir}/arm_test/arm_semihosting_executor_runner_corstone-300/arm_executor_runner"
367-
# The bundled-IO runner requires its -i argument to point at a real file
368-
# even though inputs come from the bundle; write a placeholder next to
369-
# the .bpte for run_fvp.sh to pass along.
370-
dd if=/dev/zero of="$(dirname "${pte_file}")/fvp_dummy_input.bin" bs=4 count=1 2>/dev/null
371371
if [ "$build_only" = false ] ; then
372372
backends/arm/scripts/run_fvp.sh --elf="${cortex_m_elf}" --target="${target}" --bundle="${pte_file}"
373373
fi

0 commit comments

Comments
 (0)