blob: 841b6881d3ba0cf62310d87c1cba6a87c2b8e11f [file] [log] [blame]
Kshitij Sisodiae0829d32024-05-15 17:43:11 +01001# SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its
2# affiliates <open-source-office@arm.com>
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +01003# 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 Kennedyc56eeda2023-12-04 14:43:32 +000017FROM ubuntu:22.04
Kshitij Sisodiae0829d32024-05-15 17:43:11 +010018
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +010019ENV DEBIAN_FRONTEND noninteractive
Kshitij Sisodiae0829d32024-05-15 17:43:11 +010020
21ENV 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 Sisodia1ec169b2022-06-01 09:06:21 +010032
33RUN apt-get update && \
34 apt-get install -y \
35 make \
36 git \
Richard Burton49482d52023-11-30 11:38:45 +000037 python3.10 \
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +010038 python3-pip \
Richard Burton49482d52023-11-30 11:38:45 +000039 python3.10-dev \
40 python3.10-venv \
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +010041 unzip \
42 curl \
43 wget \
44 gpg \
45 libsndfile1 \
46 sudo \
47 telnet
Kshitij Sisodiae0829d32024-05-15 17:43:11 +010048
Conor Kennedyc56eeda2023-12-04 14:43:32 +000049# Check versions
50RUN gcc --version && g++ --version && python3 --version
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +010051
Conor Kennedyc56eeda2023-12-04 14:43:32 +000052# Download and install GNU GCC 13.2 embedded toolchain
Richard Burtonbcec6752023-11-03 16:21:58 +000053RUN 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 Sisodia1ec169b2022-06-01 09:06:21 +010055 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 Sisodiae0829d32024-05-15 17:43:11 +010059# Download and install Arm Corstone-300 FVP
60RUN 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
68RUN 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
76RUN 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 Sisodia1ec169b2022-06-01 09:06:21 +010082
83# Clone the ml-embedded-evaluation-kit repository
84RUN git clone "https://review.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit" ${EVAL_KIT_DIR}
85
86# Change working directory
87WORKDIR ${EVAL_KIT_DIR}
88
89# Initialize submodules
90RUN git submodule update --init
91
92# Download and install resources required for ml-embedded-evaluation-kit
93RUN python3 ./set_up_default_resources.py
94
Kshitij Sisodiae0829d32024-05-15 17:43:11 +010095# 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.
97ENV 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"