Kshitij Sisodia | e0829d3 | 2024-05-15 17:43:11 +0100 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its |
| 2 | # affiliates <open-source-office@arm.com> |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
Conor Kennedy | c56eeda | 2023-12-04 14:43:32 +0000 | [diff] [blame] | 17 | FROM ubuntu:22.04 |
Kshitij Sisodia | e0829d3 | 2024-05-15 17:43:11 +0100 | [diff] [blame^] | 18 | |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 19 | ENV DEBIAN_FRONTEND noninteractive |
Kshitij Sisodia | e0829d3 | 2024-05-15 17:43:11 +0100 | [diff] [blame^] | 20 | |
| 21 | ENV EVAL_KIT_DIR="/home/ml-embedded-evaluation-kit" \ |
| 22 | FVP_BASE_URL="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/" \ |
| 23 | FVP_300="FVP_Corstone_SSE-300" \ |
| 24 | FVP_VER_300="11.24_13" \ |
| 25 | FVP_300_SHA="6ea4096ecf8a8c06d6e76e21cae494f0c7139374cb33f6bc3964d189b84539a9" \ |
| 26 | FVP_310="FVP_Corstone_SSE-310" \ |
| 27 | FVP_VER_310="11.24_13" \ |
| 28 | FVP_310_SHA="616ecc0e82067fe0684790cf99638b3496f9ead11051a58d766e8258e766c556" \ |
| 29 | FVP_315="FVP_Corstone_SSE-315" \ |
| 30 | FVP_VER_315="11.24_22" \ |
| 31 | FVP_315_SHA="e105569b159e42a5557baf15cc980a62427b2de3bf17aaaa72de6d218bb3a2eb" |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 32 | |
| 33 | RUN apt-get update && \ |
| 34 | apt-get install -y \ |
| 35 | make \ |
| 36 | git \ |
Richard Burton | 49482d5 | 2023-11-30 11:38:45 +0000 | [diff] [blame] | 37 | python3.10 \ |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 38 | python3-pip \ |
Richard Burton | 49482d5 | 2023-11-30 11:38:45 +0000 | [diff] [blame] | 39 | python3.10-dev \ |
| 40 | python3.10-venv \ |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 41 | unzip \ |
| 42 | curl \ |
| 43 | wget \ |
| 44 | gpg \ |
| 45 | libsndfile1 \ |
| 46 | sudo \ |
| 47 | telnet |
Kshitij Sisodia | e0829d3 | 2024-05-15 17:43:11 +0100 | [diff] [blame^] | 48 | |
Conor Kennedy | c56eeda | 2023-12-04 14:43:32 +0000 | [diff] [blame] | 49 | # Check versions |
| 50 | RUN gcc --version && g++ --version && python3 --version |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 51 | |
Conor Kennedy | c56eeda | 2023-12-04 14:43:32 +0000 | [diff] [blame] | 52 | # Download and install GNU GCC 13.2 embedded toolchain |
Richard Burton | bcec675 | 2023-11-03 16:21:58 +0000 | [diff] [blame] | 53 | RUN curl -L https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz -o gcc-arm-none-eabi.tar.xz && \ |
| 54 | echo "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb gcc-arm-none-eabi.tar.xz" | sha256sum -c && \ |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 55 | mkdir /opt/gcc-arm-none-eabi && \ |
| 56 | tar -xf gcc-arm-none-eabi.tar.xz -C /opt/gcc-arm-none-eabi --strip-components 1 && \ |
| 57 | rm gcc-arm-none-eabi.tar.xz |
| 58 | |
Kshitij Sisodia | e0829d3 | 2024-05-15 17:43:11 +0100 | [diff] [blame^] | 59 | # Download and install Arm Corstone-300 FVP |
| 60 | RUN wget "${FVP_BASE_URL}/FVP/Corstone-300/${FVP_300}_${FVP_VER_300}_Linux64.tgz" 2>/dev/null && \ |
| 61 | echo "${FVP_300_SHA} ${FVP_300}_${FVP_VER_300}_Linux64.tgz" | sha256sum -c && \ |
| 62 | mkdir -p /home/${FVP_300}/ && \ |
| 63 | tar -xf ${FVP_300}_${FVP_VER_300}_Linux64.tgz -C /home/${FVP_300}/ && \ |
| 64 | bash /home/${FVP_300}/${FVP_300}.sh --no-interactive --i-agree-to-the-contained-eula -d /home/${FVP_300} && \ |
| 65 | rm "${FVP_300}_${FVP_VER_300}_Linux64.tgz" |
| 66 | |
| 67 | # Download and install Arm Corstone-310 FVP |
| 68 | RUN wget ${FVP_BASE_URL}/FVP/Corstone-310/${FVP_310}_${FVP_VER_310}_Linux64.tgz 2>/dev/null && \ |
| 69 | echo "${FVP_310_SHA} ${FVP_310}_${FVP_VER_310}_Linux64.tgz" | sha256sum -c && \ |
| 70 | mkdir -p /home/${FVP_310}/ && \ |
| 71 | tar -xf ${FVP_310}_${FVP_VER_310}_Linux64.tgz -C /home/${FVP_310}/ && \ |
| 72 | bash /home/${FVP_310}/${FVP_310}.sh --no-interactive --i-agree-to-the-contained-eula -d /home/${FVP_310} && \ |
| 73 | rm "${FVP_310}_${FVP_VER_310}_Linux64.tgz" |
| 74 | |
| 75 | # Download and install Arm Corstone-315 FVP |
| 76 | RUN wget "${FVP_BASE_URL}/FVP/Corstone-315/${FVP_315}_${FVP_VER_315}_Linux64.tgz" 2>/dev/null && \ |
| 77 | echo "${FVP_315_SHA} ${FVP_315}_${FVP_VER_315}_Linux64.tgz" | sha256sum -c && \ |
| 78 | mkdir -p /home/${FVP_315}/ && \ |
| 79 | tar -xf ${FVP_315}_${FVP_VER_315}_Linux64.tgz -C /home/${FVP_315}/ && \ |
| 80 | bash /home/${FVP_315}/${FVP_315}.sh --no-interactive --i-agree-to-the-contained-eula -d /home/${FVP_315} && \ |
| 81 | rm "${FVP_315}_${FVP_VER_315}_Linux64.tgz" |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 82 | |
| 83 | # Clone the ml-embedded-evaluation-kit repository |
| 84 | RUN git clone "https://review.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit" ${EVAL_KIT_DIR} |
| 85 | |
| 86 | # Change working directory |
| 87 | WORKDIR ${EVAL_KIT_DIR} |
| 88 | |
| 89 | # Initialize submodules |
| 90 | RUN git submodule update --init |
| 91 | |
| 92 | # Download and install resources required for ml-embedded-evaluation-kit |
| 93 | RUN python3 ./set_up_default_resources.py |
| 94 | |
Kshitij Sisodia | e0829d3 | 2024-05-15 17:43:11 +0100 | [diff] [blame^] | 95 | # Update PATH to make the required version of CMake and GNU embedded toolchain is available. |
| 96 | # And add env variables to make access to the different FVPs easier. |
| 97 | ENV PATH="${EVAL_KIT_DIR}/resources_downloaded/env/bin:/opt/gcc-arm-none-eabi/bin:${PATH}" \ |
| 98 | FVP_300_U55="/home/${FVP_300}/models/Linux64_GCC-9.3/${FVP_300}_Ethos-U55" \ |
| 99 | FVP_300_U65="/home/${FVP_300}/models/Linux64_GCC-9.3/${FVP_300}_Ethos-U65" \ |
| 100 | FVP_310_U55="/home/${FVP_310}/models/Linux64_GCC-9.3/${FVP_310}" \ |
| 101 | FVP_310_U65="/home/${FVP_310}/models/Linux64_GCC-9.3/${FVP_310}_Ethos-U65" \ |
| 102 | FVP_315_U65="/home/${FVP_315}/models/Linux64_GCC-9.3/${FVP_315}" \ |
| 103 | FVP_300_ARGS="-C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='-' -C mps3_board.uart0.shutdown_on_eot=1 -C mps3_board.visualisation.disable-visualisation=1" \ |
| 104 | FVP_310_ARGS="-C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='-' -C mps3_board.uart0.shutdown_on_eot=1 -C mps3_board.visualisation.disable-visualisation=1" \ |
| 105 | FVP_315_ARGS="-C mps4_board.telnetterminal0.start_telnet=0 -C mps4_board.uart0.out_file='-' -C mps4_board.uart0.shutdown_on_eot=1 -C mps4_board.visualisation.disable-visualisation=1 -C vis_hdlcd.disable_visualisation=1" |