blob: 00fe7479e45ed8fc9f8f6574869279451b99e3ac [file] [log] [blame]
Richard Burtonbcec6752023-11-03 16:21:58 +00001# SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +01002# 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
16FROM ubuntu:20.04
17ENV DEBIAN_FRONTEND noninteractive
18ENV EVAL_KIT_DIR "/home/ml-embedded-evaluation-kit"
19
20RUN apt-get update && \
21 apt-get install -y \
22 make \
23 git \
Richard Burton49482d52023-11-30 11:38:45 +000024 python3.10 \
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +010025 python3-pip \
Richard Burton49482d52023-11-30 11:38:45 +000026 python3.10-dev \
27 python3.10-venv \
28 g++-10 \
29 gcc-10 \
Kshitij Sisodia1ec169b2022-06-01 09:06:21 +010030 unzip \
31 curl \
32 wget \
33 gpg \
34 libsndfile1 \
35 sudo \
36 telnet
37
Richard Burton49482d52023-11-30 11:38:45 +000038# Set Python3.10 as default
Richard Burton4c431d72023-06-06 10:08:03 +010039RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 10 && \
Richard Burton49482d52023-11-30 11:38:45 +000040 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 20 && \
41 update-alternatives --set python3 /usr/bin/python3.10 && python3 --version
42
43# Update symlinks for gcc
44RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 && \
45 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20 && \
46 update-alternatives --set gcc /usr/bin/gcc-10 && gcc --version
47# Update symlinks for g++
48RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10 && \
49 update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 20 && \
50 update-alternatives --set g++ /usr/bin/g++-10 && g++ --version \
Richard Burton4c431d72023-06-06 10:08:03 +010051
Richard Burtonbcec6752023-11-03 16:21:58 +000052# Download and install gcc 13.2
53RUN 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
59# Download and install the Corstone_SSE-300 FVP
60RUN 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 && \
61 echo "e26139be756b5003a30d978c629de638aed1934d597dc24a17043d4708e934d7 FVP_Corstone_SSE-300_11.16_26.tgz" | sha256sum -c && \
62 mkdir -p /home/FVP_Corstone_SSE-300/ && \
63 tar -xf FVP_Corstone_SSE-300_11.16_26.tgz -C /home/FVP_Corstone_SSE-300/ && \
64 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 && \
65 rm FVP_Corstone_SSE-300_11.16_26.tgz
66
67# Clone the ml-embedded-evaluation-kit repository
68RUN git clone "https://review.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit" ${EVAL_KIT_DIR}
69
70# Change working directory
71WORKDIR ${EVAL_KIT_DIR}
72
73# Initialize submodules
74RUN git submodule update --init
75
76# Download and install resources required for ml-embedded-evaluation-kit
77RUN python3 ./set_up_default_resources.py
78
79# Update PATH to make the required version of CMake and GNU embedded toolchain is available:
80ENV PATH="${EVAL_KIT_DIR}/resources_downloaded/env/bin:/opt/gcc-arm-none-eabi/bin:${PATH}"
81
82# FVP binary paths:
83ENV FVP_ETHOS_U55="/home/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/FVP_Corstone_SSE-300_Ethos-U55"
84ENV FVP_ETHOS_U65="/home/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/FVP_Corstone_SSE-300_Ethos-U65"
85
86# Default FVP arguments for no GUI and telnet pop ups:
87ENV 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"