From ff8a3912da7b9fc4a3a844361f1f1295dfdb4693 Mon Sep 17 00:00:00 2001 From: Rob Elliott Date: Tue, 1 Oct 2024 11:16:56 +0000 Subject: [PATCH 1/3] Add env var option for EULA acceptance Signed-off-by: Rob Elliott --- examples/arm/setup.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/arm/setup.sh b/examples/arm/setup.sh index 20224b9e9c3..7c980a81f60 100755 --- a/examples/arm/setup.sh +++ b/examples/arm/setup.sh @@ -9,7 +9,7 @@ set -eu -if [[ "${1:-'.'}" == "-h" || "${#}" -eq 0 || "${#}" -gt 2 ]]; then +if [[ "${1:-'.'}" == "-h" || "${#}" -gt 2 ]]; then echo "Usage: $(basename $0) <--i-agree-to-the-contained-eula> [path-to-a-scratch-dir]" echo "Supplied args: $*" exit 1 @@ -89,10 +89,16 @@ ethos_u_base_rev="24.08" ######## ### Mandatory user args ######## -eula_acceptance="${1:-'.'}"; shift +eula_acceptance="${1:-'.'}" if [[ "${eula_acceptance}" != "--i-agree-to-the-contained-eula" ]]; then - echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!" - exit 1 + if [[ ${ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA} != "True" ]]; then + echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!" + exit 1 + else + echo "Arm EULA for FVP agreed to with ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA=True environment variable" + fi +else + shift; # drop this arg fi ######## From 22e518a21825e1151dfb8c24d5485d6ba5e95290 Mon Sep 17 00:00:00 2001 From: Rob Elliott Date: Wed, 2 Oct 2024 13:59:28 +0000 Subject: [PATCH 2/3] Enable Ethos-U85 and Corstone-320 in Arm run.sh flow Signed-off-by: Rob Elliott --- examples/arm/run.sh | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/examples/arm/run.sh b/examples/arm/run.sh index 38f38a2929c..be3e8154e92 100755 --- a/examples/arm/run.sh +++ b/examples/arm/run.sh @@ -71,6 +71,12 @@ et_root_dir=$(cd ${script_dir}/../.. && pwd) et_build_dir=${et_root_dir}/cmake-out fvp_model=FVP_Corstone_SSE-300_Ethos-U55 +if [[ ${target} =~ "ethos-u85" ]] +then + echo "target is ethos-u85 variant so switching to CS320 FVP" + fvp_model=FVP_Corstone_SSE-320 +fi + toolchain_cmake=${script_dir}/ethos-u-setup/arm-none-eabi-gcc.cmake _setup_msg="please refer to ${script_dir}/ethos-u-setup/setup.sh to properly install necessary tools." @@ -82,8 +88,7 @@ function generate_pte_file() { local model_filename=${model}_arm_${target}.pte if [[ "${model_compiler_flags}" == *"--delegate"* ]]; then - # Name aligned with default aot_arm_compiler output - run.sh only supports - # running on Corstone-300 with Ethos-U55 FVP at the moment. + # Name aligned with default aot_arm_compiler output model_filename=${model}_arm_delegate_${target}.pte fi cd $et_root_dir @@ -174,13 +179,16 @@ function build_executorch_runner() { local pte=${1} if [[ ${target} == *"ethos-u55"* ]]; then local target_cpu=cortex-m55 + local target_board=corstone-300 else local target_cpu=cortex-m85 + local target_board=corstone-320 fi cd ${script_dir}/executor_runner - cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} \ + cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} \ -DTARGET_CPU=${target_cpu} \ - -DETHOSU_TARGET_NPU_CONFIG=${target} \ + -DTARGET_BOARD=${target_board} \ + -DETHOSU_TARGET_NPU_CONFIG=${target} \ -B ${executor_runner_path}/cmake-out \ -DETHOS_SDK_PATH:PATH=${ethos_u_root_dir} \ -DET_DIR_PATH:PATH=${et_root_dir} \ @@ -205,9 +213,10 @@ function run_fvp() { elf=$(find ${executor_runner_path} -name "${elf_name}") [[ ! -f $elf ]] && { echo "[${FUNCNAME[0]}]: Unable to find executor_runner elf: ${elf}"; exit 1; } num_macs=$(echo ${target} | cut -d - -f 3) + if [[ ${target} == *"ethos-u55"* ]]; then - echo "Running ${elf} for ${target} run with FVP_Corstone_SSE-300_Ethos-U55 num_macs:${num_macs}" - FVP_Corstone_SSE-300_Ethos-U55 \ + echo "Running ${elf} for ${target} run with FVP:${fvp_model} num_macs:${num_macs}" + ${fvp_model} \ -C cpu0.CFGITCMSZ=11 \ -C ethosu.num_macs=${num_macs} \ -C mps3_board.visualisation.disable-visualisation=1 \ @@ -217,6 +226,17 @@ function run_fvp() { -a "${elf}" \ --timelimit 120 || true # seconds echo "[${FUNCNAME[0]} Simulation complete, $?" + elif [[ ${target} == *"ethos-u85"* ]]; then + ${fvp_model} \ + -C mps4_board.subsystem.cpu0.CFGITCMSZ=11 \ + -C mps4_board.subsystem.ethosu.num_macs=128 \ + -C mps4_board.visualisation.disable-visualisation=1 \ + -C vis_hdlcd.disable_visualisation=1 \ + -C mps4_board.telnetterminal0.start_telnet=0 \ + -C mps4_board.uart0.out_file='-' \ + -C mps4_board.uart0.shutdown_on_eot=1 \ + -a "${elf}" \ + --timelimit 120 || true # seconds else echo "Running ${elf} for ${target} is not supported" exit 1 From 3ac1dc66df75c25f557991ee31263cf00faf7dd7 Mon Sep 17 00:00:00 2001 From: Rob Elliott Date: Wed, 2 Oct 2024 18:53:40 +0000 Subject: [PATCH 3/3] change num_macs to be derived from target Signed-off-by: Rob Elliott --- examples/arm/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arm/run.sh b/examples/arm/run.sh index be3e8154e92..d49ab80291d 100755 --- a/examples/arm/run.sh +++ b/examples/arm/run.sh @@ -229,7 +229,7 @@ function run_fvp() { elif [[ ${target} == *"ethos-u85"* ]]; then ${fvp_model} \ -C mps4_board.subsystem.cpu0.CFGITCMSZ=11 \ - -C mps4_board.subsystem.ethosu.num_macs=128 \ + -C mps4_board.subsystem.ethosu.num_macs=${num_macs} \ -C mps4_board.visualisation.disable-visualisation=1 \ -C vis_hdlcd.disable_visualisation=1 \ -C mps4_board.telnetterminal0.start_telnet=0 \