Skip to content

Commit 92d1d1e

Browse files
robellfacebook-github-bot
authored andcommitted
Enable Ethos-U85 and Corstone-320 in Arm run.sh flow (#5818)
Summary: Add parameters for Corstone-320 to run.sh and so ability to run on Ethos-U85 target. Pull Request resolved: #5818 Reviewed By: digantdesai Differential Revision: D63811224 Pulled By: mergennachin fbshipit-source-id: 0d9acbc561d61f715e9f99f6f0ec46cc9312170d
1 parent ee5d099 commit 92d1d1e

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

examples/arm/run.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ et_root_dir=$(cd ${script_dir}/../.. && pwd)
7171
et_build_dir=${et_root_dir}/cmake-out
7272

7373
fvp_model=FVP_Corstone_SSE-300_Ethos-U55
74+
if [[ ${target} =~ "ethos-u85" ]]
75+
then
76+
echo "target is ethos-u85 variant so switching to CS320 FVP"
77+
fvp_model=FVP_Corstone_SSE-320
78+
fi
79+
7480
toolchain_cmake=${script_dir}/ethos-u-setup/arm-none-eabi-gcc.cmake
7581
_setup_msg="please refer to ${script_dir}/ethos-u-setup/setup.sh to properly install necessary tools."
7682

@@ -82,8 +88,7 @@ function generate_pte_file() {
8288

8389
local model_filename=${model}_arm_${target}.pte
8490
if [[ "${model_compiler_flags}" == *"--delegate"* ]]; then
85-
# Name aligned with default aot_arm_compiler output - run.sh only supports
86-
# running on Corstone-300 with Ethos-U55 FVP at the moment.
91+
# Name aligned with default aot_arm_compiler output
8792
model_filename=${model}_arm_delegate_${target}.pte
8893
fi
8994
cd $et_root_dir
@@ -173,13 +178,16 @@ function build_executorch_runner() {
173178
local pte=${1}
174179
if [[ ${target} == *"ethos-u55"* ]]; then
175180
local target_cpu=cortex-m55
181+
local target_board=corstone-300
176182
else
177183
local target_cpu=cortex-m85
184+
local target_board=corstone-320
178185
fi
179186
cd ${script_dir}/executor_runner
180-
cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} \
187+
cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} \
181188
-DTARGET_CPU=${target_cpu} \
182-
-DETHOSU_TARGET_NPU_CONFIG=${target} \
189+
-DTARGET_BOARD=${target_board} \
190+
-DETHOSU_TARGET_NPU_CONFIG=${target} \
183191
-B ${executor_runner_path}/cmake-out \
184192
-DETHOS_SDK_PATH:PATH=${ethos_u_root_dir} \
185193
-DET_DIR_PATH:PATH=${et_root_dir} \
@@ -203,9 +211,10 @@ function run_fvp() {
203211
elf=$(find ${executor_runner_path} -name "${elf_name}")
204212
[[ ! -f $elf ]] && { echo "[${FUNCNAME[0]}]: Unable to find executor_runner elf: ${elf}"; exit 1; }
205213
num_macs=$(echo ${target} | cut -d - -f 3)
214+
206215
if [[ ${target} == *"ethos-u55"* ]]; then
207-
echo "Running ${elf} for ${target} run with FVP_Corstone_SSE-300_Ethos-U55 num_macs:${num_macs}"
208-
FVP_Corstone_SSE-300_Ethos-U55 \
216+
echo "Running ${elf} for ${target} run with FVP:${fvp_model} num_macs:${num_macs}"
217+
${fvp_model} \
209218
-C cpu0.CFGITCMSZ=11 \
210219
-C ethosu.num_macs=${num_macs} \
211220
-C mps3_board.visualisation.disable-visualisation=1 \
@@ -215,6 +224,17 @@ function run_fvp() {
215224
-a "${elf}" \
216225
--timelimit 120 || true # seconds
217226
echo "[${FUNCNAME[0]} Simulation complete, $?"
227+
elif [[ ${target} == *"ethos-u85"* ]]; then
228+
${fvp_model} \
229+
-C mps4_board.subsystem.cpu0.CFGITCMSZ=11 \
230+
-C mps4_board.subsystem.ethosu.num_macs=${num_macs} \
231+
-C mps4_board.visualisation.disable-visualisation=1 \
232+
-C vis_hdlcd.disable_visualisation=1 \
233+
-C mps4_board.telnetterminal0.start_telnet=0 \
234+
-C mps4_board.uart0.out_file='-' \
235+
-C mps4_board.uart0.shutdown_on_eot=1 \
236+
-a "${elf}" \
237+
--timelimit 120 || true # seconds
218238
else
219239
echo "Running ${elf} for ${target} is not supported"
220240
exit 1

examples/arm/setup.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
set -eu
1111

12-
if [[ "${1:-'.'}" == "-h" || "${#}" -eq 0 || "${#}" -gt 2 ]]; then
12+
if [[ "${1:-'.'}" == "-h" || "${#}" -gt 2 ]]; then
1313
echo "Usage: $(basename $0) <--i-agree-to-the-contained-eula> [path-to-a-scratch-dir]"
1414
echo "Supplied args: $*"
1515
exit 1
@@ -89,10 +89,16 @@ ethos_u_base_rev="24.08"
8989
########
9090
### Mandatory user args
9191
########
92-
eula_acceptance="${1:-'.'}"; shift
92+
eula_acceptance="${1:-'.'}"
9393
if [[ "${eula_acceptance}" != "--i-agree-to-the-contained-eula" ]]; then
94-
echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!"
95-
exit 1
94+
if [[ ${ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA} != "True" ]]; then
95+
echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!"
96+
exit 1
97+
else
98+
echo "Arm EULA for FVP agreed to with ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA=True environment variable"
99+
fi
100+
else
101+
shift; # drop this arg
96102
fi
97103

98104
########

0 commit comments

Comments
 (0)