Skip to content

Commit dc957db

Browse files
gggekovZonglin Peng
authored and
Zonglin Peng
committed
Arm backend: Fix Timing Adapter settings depending on the memory mode… (#8941)
Fix Timing Adapter settings depending on the memory mode & placement in the linker script
1 parent 760272c commit dc957db

File tree

3 files changed

+246
-75
lines changed

3 files changed

+246
-75
lines changed

backends/arm/scripts/build_executorch_runner.sh

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmak
1414
pte_file=""
1515
target="ethos-u55-128"
1616
build_type="Release"
17-
system_config=""
1817
bundleio=false
18+
system_config=""
19+
memory_mode=""
1920
build_with_etdump=false
2021
extra_build_flags=""
2122
output_folder_set=false
@@ -32,9 +33,12 @@ help() {
3233
echo " --pte=<PTE_FILE> pte file (genrated by the aot_arm_compier from the model to include in the elf"
3334
echo " --target=<TARGET> Target to build and run for Default: ${target}"
3435
echo " --build_type=<TYPE> Build with Release, Debug or RelWithDebInfo, default is ${build_type}"
35-
echo " --system_config=<CONFIG> System configuration to select from the Vela configuration file (see vela.ini). Default: Ethos_U55_High_End_Embedded for EthosU55 targets, Ethos_U85_SYS_DRAM_Mid for EthosU85 targets."
36-
echo " NOTE: If given, this option must match the given target. This option also sets timing adapter values customized for specific hardware, see ./executor_runner/CMakeLists.txt."
3736
echo " --bundleio Support both pte and Bundle IO bpte using Devtools BundelIO with Input/RefOutput included"
37+
echo " --system_config=<CONFIG> System configuration to select from the Vela configuration file (see vela.ini). Default: Ethos_U55_High_End_Embedded for EthosU55 targets, Ethos_U85_SYS_DRAM_Mid for EthosU85 targets."
38+
echo " NOTE: If given, this option must match the given target. This option along with the memory_mode sets timing adapter values customized for specific hardware, see ./executor_runner/CMakeLists.txt."
39+
echo " --memory_mode=<CONFIG> Vela memory mode, used for setting the Timing Adapter parameters of the Corstone platforms."
40+
echo " Valid values are Shared_Sram(for Ethos-U55, Ethos-U65, Ethos-85), Sram_Only(for Ethos-U55, Ethos-U65, Ethos-U85) or Dedicated_Sram(for Ethos-U65, Ethos-U85)."
41+
echo " Default: Shared_Sram for the Ethos-U55 and Sram_Only for the Ethos-U85"
3842
echo " --etdump Adds Devtools etdump support to track timing, etdump area will be base64 encoded in the log"
3943
echo " --extra_build_flags=<FLAGS> Extra flags to pass to cmake like -DET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE=60000 Default: none "
4044
echo " --output=<FOLDER> Output folder Default: <MODEL>/<MODEL>_<TARGET INFO>.pte"
@@ -49,8 +53,9 @@ for arg in "$@"; do
4953
--pte=*) pte_file="${arg#*=}";;
5054
--target=*) target="${arg#*=}";;
5155
--build_type=*) build_type="${arg#*=}";;
52-
--system_config=*) system_config="${arg#*=}";;
5356
--bundleio) bundleio=true ;;
57+
--system_config=*) system_config="${arg#*=}";;
58+
--memory_mode=*) memory_mode="${arg#*=}";;
5459
--etdump) build_with_etdump=true ;;
5560
--extra_build_flags=*) extra_build_flags="${arg#*=}";;
5661
--output=*) output_folder="${arg#*=}" ; output_folder_set=true ;;
@@ -83,6 +88,15 @@ then
8388
fi
8489
fi
8590

91+
if [[ ${memory_mode} == "" ]]
92+
then
93+
memory_mode="Shared_Sram"
94+
if [[ ${target} =~ "ethos-u85" ]]
95+
then
96+
memory_mode="Sram_Only"
97+
fi
98+
fi
99+
86100
output_folder=$(realpath ${output_folder})
87101

88102
if [[ ${target} == *"ethos-u55"* ]]; then
@@ -91,7 +105,7 @@ else
91105
target_cpu=cortex-m85
92106
fi
93107
echo "--------------------------------------------------------------------------------"
94-
echo "Build Arm Baremetal executor_runner for ${target} with ${pte_file} using ${system_config} ${extra_build_flags} to '${output_folder}/cmake-out'"
108+
echo "Build Arm Baremetal executor_runner for ${target} with ${pte_file} using ${system_config} ${memory_mode} ${extra_build_flags} to '${output_folder}/cmake-out'"
95109
echo "--------------------------------------------------------------------------------"
96110

97111
cd ${et_root_dir}/examples/arm/executor_runner
@@ -120,6 +134,7 @@ cmake \
120134
${build_with_etdump_flags} \
121135
-DPYTHON_EXECUTABLE=$(which python3) \
122136
-DSYSTEM_CONFIG=${system_config} \
137+
-DMEMORY_MODE=${memory_mode} \
123138
${extra_build_flags} \
124139
-B ${output_folder}/cmake-out
125140

0 commit comments

Comments
 (0)