|
7 | 7 |
|
8 | 8 | set -eu
|
9 | 9 |
|
10 |
| -if [[ "${1:-'.'}" == "-h" ]]; then |
11 |
| - echo "Usage: $(basename $0) [path-to-a-scratch-dir]" |
12 |
| - exit 0 |
| 10 | +if [[ "${1:-'.'}" == "-h" || "${#}" -eq 0 || "${#}" -gt 2 ]]; then |
| 11 | + echo "Usage: $(basename $0) <--i-agree-to-the-contained-eula> [path-to-a-scratch-dir]" |
| 12 | + echo "Supplied args: $*" |
| 13 | + exit 1 |
13 | 14 | fi
|
14 | 15 |
|
15 | 16 | ########
|
@@ -44,33 +45,42 @@ function verify_md5() {
|
44 | 45 | script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
|
45 | 46 |
|
46 | 47 | if [[ $(get_cpu_arch) == "x86_64" ]]; then
|
47 |
| - # FVP |
48 |
| - fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz?rev=018659bd574f4e7b95fa647e7836ccf4&hash=22A79103C6FA5FFA7AFF3BE0447F3FF9" |
49 |
| - fvp_model_dir="Linux64_GCC-9.3" |
50 |
| - fvp_md5_checksum="98e93b949d0fbac977292d8668d34523" |
51 |
| - |
52 |
| - # toochain |
53 |
| - toolchain_url="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz" |
54 |
| - toolchain_dir="arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi" |
55 |
| - toolchain_md5_checksum="00ebb1b70b1f88906c61206457eacb61" |
| 48 | + # FVP |
| 49 | + fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz?rev=018659bd574f4e7b95fa647e7836ccf4&hash=22A79103C6FA5FFA7AFF3BE0447F3FF9" |
| 50 | + fvp_model_dir="Linux64_GCC-9.3" |
| 51 | + fvp_md5_checksum="98e93b949d0fbac977292d8668d34523" |
| 52 | + |
| 53 | + # toochain |
| 54 | + toolchain_url="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz" |
| 55 | + toolchain_dir="arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi" |
| 56 | + toolchain_md5_checksum="00ebb1b70b1f88906c61206457eacb61" |
56 | 57 | elif [[ $(get_cpu_arch) == "aarch64" ]]; then
|
57 | 58 | # FVP
|
58 |
| - fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64_armv8l.tgz?rev=9cc6e9a32bb947ca9b21fa162144cb01&hash=7657A4CF27D42E892E3F08D452AAB073" |
| 59 | + fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64_armv8l.tgz?rev=9cc6e9a32bb947ca9b21fa162144cb01&hash=7657A4CF27D42E892E3F08D452AAB073" |
59 | 60 | fvp_model_dir="Linux64_armv8l_GCC-9.3"
|
60 |
| - fvp_md5_checksum="cbbabbe39b07939cff7a3738e1492ef1" |
| 61 | + fvp_md5_checksum="cbbabbe39b07939cff7a3738e1492ef1" |
61 | 62 |
|
62 | 63 | # toochain
|
63 | 64 | toolchain_url="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi.tar.xz"
|
64 | 65 | toolchain_dir="arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi"
|
65 |
| - toolchain_md5_checksum="02c9b0d3bb1110575877d8eee1f223f2" |
| 66 | + toolchain_md5_checksum="02c9b0d3bb1110575877d8eee1f223f2" |
66 | 67 | else
|
67 |
| - echo "[main] Error: only x86-64 & aarch64 architecture is supported for now!"; exit 1; |
| 68 | + echo "[main] Error: only x86-64 & aarch64 architecture is supported for now!"; exit 1; |
68 | 69 | fi
|
69 | 70 |
|
70 | 71 | # ethos-u
|
71 | 72 | ethos_u_repo_url="https://review.mlplatform.org/ml/ethos-u/ethos-u"
|
72 | 73 | ethos_u_base_rev="0995223100e3da8011700f58e491f1bf59511e3c"
|
73 | 74 |
|
| 75 | +######## |
| 76 | +### Mandatory user args |
| 77 | +######## |
| 78 | +eula_acceptance="${1:-'.'}"; shift |
| 79 | +if [[ "${eula_acceptance}" != "--i-agree-to-the-contained-eula" ]]; then |
| 80 | + echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!" |
| 81 | + exit 1 |
| 82 | +fi |
| 83 | + |
74 | 84 | ########
|
75 | 85 | ### Optional user args
|
76 | 86 | ########
|
@@ -152,38 +162,40 @@ function patch_repo() {
|
152 | 162 | }
|
153 | 163 |
|
154 | 164 | function setup_tosa_reference_model() {
|
155 |
| - # The debug flow on the host includes running on a reference implementation of TOSA |
156 |
| - # This is useful primarily for debug of quantization accuracy, but also for internal |
157 |
| - # errors for the early codebase |
158 |
| - cd "${root_dir}" |
159 |
| - if [[ ! -e reference_model ]]; then |
160 |
| - git clone https://git.mlplatform.org/tosa/reference_model.git -b v0.80.0 |
161 |
| - cd reference_model |
162 |
| - git submodule update --init --recursive |
163 |
| - cd .. |
164 |
| - fi |
165 |
| - cd reference_model |
166 |
| - mkdir -p build |
167 |
| - cd build |
168 |
| - cmake .. |
169 |
| - make |
170 |
| - cd reference_model |
171 |
| - tosa_bin_path=`pwd` |
172 |
| - echo "export PATH=\${PATH}:${tosa_bin_path}" >> "${setup_path_script}" |
| 165 | + # The debug flow on the host includes running on a reference implementation of TOSA |
| 166 | + # This is useful primarily for debug of quantization accuracy, but also for internal |
| 167 | + # errors for the early codebase |
| 168 | + cd "${root_dir}" |
| 169 | + if [[ ! -e reference_model ]]; then |
| 170 | + git clone https://git.mlplatform.org/tosa/reference_model.git -b v0.80.0 |
| 171 | + cd reference_model |
| 172 | + git submodule update --init --recursive |
| 173 | + cd .. |
| 174 | + fi |
| 175 | + cd reference_model |
| 176 | + mkdir -p build |
| 177 | + cd build |
| 178 | + cmake .. |
| 179 | + n=$(nproc) |
| 180 | + make -j"$((n - 5))" |
| 181 | + cd reference_model |
| 182 | + tosa_bin_path=`pwd` |
| 183 | + echo "export PATH=\${PATH}:${tosa_bin_path}" >> "${setup_path_script}" |
173 | 184 | }
|
174 | 185 |
|
175 | 186 | function setup_vela() {
|
176 |
| - # |
177 |
| - # Prepare the Vela compiler for AoT to Ethos-U compilation |
178 |
| - # |
179 |
| - cd "${root_dir}/ethos-u/" |
180 |
| - if [[ ! -e ethos-u-vela ]]; then |
181 |
| - git clone https://git.mlplatform.org/ml/ethos-u/ethos-u-vela.git |
182 |
| - name="ethos-u-vela" |
183 |
| - base_rev=00a15db3e1a188b25065d095152d701f4394cdc5 |
184 |
| - patch_repo |
185 |
| - fi |
186 |
| - pip install . |
| 187 | + # |
| 188 | + # Prepare the Vela compiler for AoT to Ethos-U compilation |
| 189 | + # |
| 190 | + cd "${root_dir}/ethos-u/" |
| 191 | + if [[ ! -e ethos-u-vela ]]; then |
| 192 | + git clone https://git.mlplatform.org/ml/ethos-u/ethos-u-vela.git |
| 193 | + name="ethos-u-vela" |
| 194 | + base_rev=00a15db3e1a188b25065d095152d701f4394cdc5 |
| 195 | + patch_repo |
| 196 | + fi |
| 197 | + cd "${root_dir}/ethos-u/ethos-u-vela" |
| 198 | + pip install . |
187 | 199 | }
|
188 | 200 |
|
189 | 201 | ########
|
|
0 commit comments