Skip to content

Commit e904e56

Browse files
zingofacebook-github-bot
authored andcommitted
Arm backend: Fix pte path in run.sh when using a model python file (#5979)
Summary: This fix a problem when you use a file path as used model e.g. --model_name=<FILE_PATH.py> Then the script didn't look for the generate pte in the same folers as the aot_arm_compiler.py put it. Pull Request resolved: #5979 Reviewed By: mergennachin Differential Revision: D64047899 Pulled By: digantdesai fbshipit-source-id: 770920a8fc83f613fdeeae6dad36ac2a3faaf00e
1 parent c35386f commit e904e56

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

examples/arm/run.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ fi
9494
function generate_pte_file() {
9595
[[ $# -ne 2 ]] && { echo "[${FUNCNAME[0]}]" "Expecting model and model_compiler_flags flag, got, $*"; exit 1; }
9696
local model=${1}
97+
local model_short_name=$(basename -- "${model}" ".py")
9798
local model_compiler_flags=${2}
9899
99-
local model_filename=${model}_arm_${target}.pte
100+
local model_filename=${model_short_name}_arm_${target}.pte
100101
if [[ "${model_compiler_flags}" == *"--delegate"* ]]; then
101-
# Name aligned with default aot_arm_compiler output
102-
model_filename=${model}_arm_delegate_${target}.pte
102+
# Name aligned with default aot_arm_compiler output
103+
model_filename=${model_short_name}_arm_delegate_${target}.pte
103104
fi
104105
cd $et_root_dir
105106
@@ -233,18 +234,20 @@ function run_fvp() {
233234
-C mps3_board.uart0.shutdown_on_eot=1 \
234235
-a "${elf}" \
235236
--timelimit 120 || true # seconds
236-
echo "[${FUNCNAME[0]} Simulation complete, $?"
237+
echo "[${FUNCNAME[0]}] Simulation complete, $?"
237238
elif [[ ${target} == *"ethos-u85"* ]]; then
238-
${fvp_model} \
239-
-C mps4_board.subsystem.cpu0.CFGITCMSZ=11 \
240-
-C mps4_board.subsystem.ethosu.num_macs=${num_macs} \
241-
-C mps4_board.visualisation.disable-visualisation=1 \
242-
-C vis_hdlcd.disable_visualisation=1 \
243-
-C mps4_board.telnetterminal0.start_telnet=0 \
244-
-C mps4_board.uart0.out_file='-' \
245-
-C mps4_board.uart0.shutdown_on_eot=1 \
239+
echo "Running ${elf} for ${target} run with FVP:${fvp_model} num_macs:${num_macs}"
240+
${fvp_model} \
241+
-C mps4_board.subsystem.cpu0.CFGITCMSZ=11 \
242+
-C mps4_board.subsystem.ethosu.num_macs=${num_macs} \
243+
-C mps4_board.visualisation.disable-visualisation=1 \
244+
-C vis_hdlcd.disable_visualisation=1 \
245+
-C mps4_board.telnetterminal0.start_telnet=0 \
246+
-C mps4_board.uart0.out_file='-' \
247+
-C mps4_board.uart0.shutdown_on_eot=1 \
246248
-a "${elf}" \
247249
--timelimit 120 || true # seconds
250+
echo "[${FUNCNAME[0]}] Simulation complete, $?"
248251
else
249252
echo "Running ${elf} for ${target} is not supported"
250253
exit 1

0 commit comments

Comments
 (0)