new-sonar/Dockerfile
2023-06-16 16:28:55 -06:00

43 lines
1.4 KiB
Docker

FROM ubuntu:22.04
WORKDIR /litex
# Install dependencies
RUN apt-get update && apt-get install -y wget curl python3 python3-pip python3-venv git gcc-riscv64-linux-gnu ninja-build
# TODO consolidate curl and wget
RUN pip3 install numpy matplotlib
# Get and run the LiteX setup script to install LiteX
RUN wget https://raw.githubusercontent.com/enjoy-digital/litex/2023.04/litex_setup.py && chmod +x litex_setup.py
RUN python3 litex_setup.py --init --install --tag=2023.04
# Install python dependencies/tools
RUN pip3 install meson
# Get rust and install the RV32I toolchain
# TODO specify rust version, and can we make this one command?
# TODO make paths more properly generic?
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="${HOME}/.cargo/bin:${PATH}"
RUN /root/.cargo/bin/rustup target add riscv32i-unknown-none-elf
# install oss-cad-suite
WORKDIR /
RUN echo "Fetching oss-cad-suite" && wget -q https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2023-06-03/oss-cad-suite-linux-x64-20230603.tgz
RUN tar -xzf oss-cad-suite-linux-x64-20230603.tgz
RUN rm oss-cad-suite-linux-x64-20230603.tgz
ENV PATH="/oss-cad-suite/bin:${PATH}"
# Apply patch to fix migen
COPY migen.patch /litex/migen/migen.patch
RUN cd /litex/migen && git apply /litex/migen/migen.patch
RUN pip install --editable /litex/migen
# TODO remove unnecessary tools
# Delete package cache to keep size small
RUN apt-get clean
# Set working directory to repository
WORKDIR /code