Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions examples/arm/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand All @@ -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
Expand Down Expand Up @@ -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} \
Expand All @@ -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 \
Expand All @@ -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=${num_macs} \
-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
Expand Down
14 changes: 10 additions & 4 deletions examples/arm/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

########
Expand Down
Loading