Richard Burton | bcec675 | 2023-11-03 16:21:58 +0000 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | FROM ubuntu:20.04 |
| 17 | ENV DEBIAN_FRONTEND noninteractive |
| 18 | ENV EVAL_KIT_DIR "/home/ml-embedded-evaluation-kit" |
| 19 | |
| 20 | RUN apt-get update && \ |
| 21 | apt-get install -y \ |
| 22 | make \ |
| 23 | git \ |
Richard Burton | 4c431d7 | 2023-06-06 10:08:03 +0100 | [diff] [blame] | 24 | python3.9 \ |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 25 | python3-pip \ |
Richard Burton | 4c431d7 | 2023-06-06 10:08:03 +0100 | [diff] [blame] | 26 | python3.9-dev \ |
| 27 | python3.9-venv \ |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 28 | unzip \ |
| 29 | curl \ |
| 30 | wget \ |
| 31 | gpg \ |
| 32 | libsndfile1 \ |
| 33 | sudo \ |
| 34 | telnet |
| 35 | |
Richard Burton | 4c431d7 | 2023-06-06 10:08:03 +0100 | [diff] [blame] | 36 | # Set Python3.9 as default |
| 37 | RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 10 && \ |
| 38 | update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 20 && \ |
| 39 | update-alternatives --set python3 /usr/bin/python3.9 && python3 --version |
| 40 | |
Richard Burton | bcec675 | 2023-11-03 16:21:58 +0000 | [diff] [blame] | 41 | # Download and install gcc 13.2 |
| 42 | 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 && \ |
| 43 | echo "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb gcc-arm-none-eabi.tar.xz" | sha256sum -c && \ |
Kshitij Sisodia | 1ec169b | 2022-06-01 09:06:21 +0100 | [diff] [blame] | 44 | mkdir /opt/gcc-arm-none-eabi && \ |
| 45 | tar -xf gcc-arm-none-eabi.tar.xz -C /opt/gcc-arm-none-eabi --strip-components 1 && \ |
| 46 | rm gcc-arm-none-eabi.tar.xz |
| 47 | |
| 48 | # Download and install the Corstone_SSE-300 FVP |
| 49 | RUN wget https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.16_26.tgz 2>/dev/null && \ |
| 50 | echo "e26139be756b5003a30d978c629de638aed1934d597dc24a17043d4708e934d7 FVP_Corstone_SSE-300_11.16_26.tgz" | sha256sum -c && \ |
| 51 | mkdir -p /home/FVP_Corstone_SSE-300/ && \ |
| 52 | tar -xf FVP_Corstone_SSE-300_11.16_26.tgz -C /home/FVP_Corstone_SSE-300/ && \ |
| 53 | bash /home/FVP_Corstone_SSE-300/FVP_Corstone_SSE-300.sh --no-interactive --i-agree-to-the-contained-eula -d /home/FVP_Corstone_SSE-300 && \ |
| 54 | rm FVP_Corstone_SSE-300_11.16_26.tgz |
| 55 | |
| 56 | # Clone the ml-embedded-evaluation-kit repository |
| 57 | RUN git clone "https://review.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit" ${EVAL_KIT_DIR} |
| 58 | |
| 59 | # Change working directory |
| 60 | WORKDIR ${EVAL_KIT_DIR} |
| 61 | |
| 62 | # Initialize submodules |
| 63 | RUN git submodule update --init |
| 64 | |
| 65 | # Download and install resources required for ml-embedded-evaluation-kit |
| 66 | RUN python3 ./set_up_default_resources.py |
| 67 | |
| 68 | # Update PATH to make the required version of CMake and GNU embedded toolchain is available: |
| 69 | ENV PATH="${EVAL_KIT_DIR}/resources_downloaded/env/bin:/opt/gcc-arm-none-eabi/bin:${PATH}" |
| 70 | |
| 71 | # FVP binary paths: |
| 72 | ENV FVP_ETHOS_U55="/home/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/FVP_Corstone_SSE-300_Ethos-U55" |
| 73 | ENV FVP_ETHOS_U65="/home/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/FVP_Corstone_SSE-300_Ethos-U65" |
| 74 | |
| 75 | # Default FVP arguments for no GUI and telnet pop ups: |
| 76 | ENV FVP_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" |