2022-09-18 15:28:51 -04:00
|
|
|
# syntax = docker/dockerfile:1.0-experimental
|
|
|
|
|
2023-12-14 12:04:44 -05:00
|
|
|
# Stage #1: build all executables
|
2024-06-05 10:23:38 -04:00
|
|
|
FROM ubuntu:jammy
|
2023-07-10 12:12:47 -04:00
|
|
|
SHELL ["/bin/bash", "-c"]
|
2022-09-18 07:48:56 -04:00
|
|
|
|
|
|
|
RUN apt-get update
|
|
|
|
|
|
|
|
RUN mkdir toolsrc
|
|
|
|
RUN mkdir /opt/cad
|
|
|
|
|
2022-10-02 11:14:58 -04:00
|
|
|
WORKDIR /toolsrc
|
|
|
|
RUN apt-get -y install wget make gcc g++
|
|
|
|
RUN wget https://download.open-mpi.org/release/hwloc/v2.8/hwloc-2.8.0.tar.gz
|
|
|
|
RUN tar -xzvf hwloc-2.8.0.tar.gz
|
|
|
|
WORKDIR hwloc-2.8.0
|
|
|
|
RUN ./configure
|
|
|
|
RUN make
|
|
|
|
RUN make install
|
|
|
|
|
2022-09-18 07:48:56 -04:00
|
|
|
# Xyce and Trilinos takes the longest to execute, in the interest of caching, this should go first.
|
|
|
|
# install Trilinos
|
|
|
|
WORKDIR /toolsrc
|
|
|
|
# basic dependencies
|
2024-04-09 08:10:48 -04:00
|
|
|
RUN apt-get install -y gcc g++ gfortran make flex libfl-dev libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool
|
2022-09-18 07:48:56 -04:00
|
|
|
# building from git repo dependencies
|
|
|
|
RUN apt-get install -y autoconf automake git
|
|
|
|
# parallel dependencies
|
2022-10-02 11:14:58 -04:00
|
|
|
RUN apt-get install -y libhwloc15 libopenmpi-dev openmpi-bin openmpi-common
|
2023-05-25 23:58:16 -04:00
|
|
|
# install python
|
|
|
|
RUN apt-get update --fix-missing; DEBIAN_FRONTEND=noninteractive apt-get install -y python3 pip
|
2024-06-05 10:23:38 -04:00
|
|
|
RUN apt-get remove -y cmake; pip install cmake --upgrade
|
2022-09-18 07:48:56 -04:00
|
|
|
|
2024-06-05 10:23:38 -04:00
|
|
|
RUN apt-get install -y bison # cmake
|
2024-04-09 08:10:48 -04:00
|
|
|
RUN git clone --depth=1 https://github.com/trilinos/Trilinos.git --branch trilinos-release-15-1-1
|
|
|
|
RUN git clone --depth=1 https://github.com/Xyce/Xyce.git --branch Release-7.8.0
|
2022-11-25 11:05:35 -05:00
|
|
|
|
2022-09-18 07:48:56 -04:00
|
|
|
WORKDIR Trilinos
|
|
|
|
RUN mkdir build
|
|
|
|
RUN mkdir /opt/trilinos
|
|
|
|
WORKDIR build
|
2022-11-25 11:05:35 -05:00
|
|
|
RUN cmake \
|
2024-04-09 08:10:48 -04:00
|
|
|
-D PYTHON_EXECUTABLE=/usr/bin/python3 \
|
2022-11-25 11:05:35 -05:00
|
|
|
-D CMAKE_C_COMPILER=mpicc \
|
|
|
|
-D CMAKE_CXX_COMPILER=mpic++ \
|
|
|
|
-D CMAKE_Fortran_COMPILER=mpif77 \
|
|
|
|
-D CMAKE_INSTALL_PREFIX="/opt/trilinos" \
|
|
|
|
-D TPL_AMD_INCLUDE_DIRS="/usr/include/suitesparse" \
|
|
|
|
-D AMD_LIBRARY_DIRS="/usr/lib" \
|
2023-05-17 13:15:51 -04:00
|
|
|
-D MPI_BASE_DIR="/usr" \
|
2024-04-09 08:10:48 -04:00
|
|
|
-C /toolsrc/Xyce/cmake/trilinos/trilinos-MPI-base.cmake \
|
2023-05-17 13:15:51 -04:00
|
|
|
/toolsrc/Trilinos
|
2023-06-02 16:45:18 -04:00
|
|
|
RUN cmake --build . -j 40 -t install
|
2022-09-18 07:48:56 -04:00
|
|
|
|
|
|
|
# install Xyce
|
|
|
|
WORKDIR /toolsrc
|
|
|
|
WORKDIR Xyce
|
|
|
|
RUN mkdir build
|
|
|
|
WORKDIR build
|
2022-11-25 11:05:35 -05:00
|
|
|
RUN cmake \
|
|
|
|
-D CMAKE_INSTALL_PREFIX=/opt/cad \
|
|
|
|
-D Trilinos_ROOT=/opt/trilinos \
|
|
|
|
/toolsrc/Xyce
|
|
|
|
RUN cmake --build . -j 16 -t install
|
|
|
|
RUN make xycecinterface
|
2022-09-18 07:48:56 -04:00
|
|
|
RUN make install
|
|
|
|
|
2023-12-14 12:04:44 -05:00
|
|
|
# install OpenRoad
|
2023-04-24 15:06:00 -04:00
|
|
|
WORKDIR /toolsrc
|
2023-12-14 12:04:44 -05:00
|
|
|
RUN git clone --recursive https://www.github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git
|
|
|
|
WORKDIR OpenROAD-flow-scripts
|
2024-06-05 10:23:38 -04:00
|
|
|
RUN apt-get install -y sudo libpython3.11
|
2023-12-14 12:04:44 -05:00
|
|
|
RUN SUDO_USER="root" ./setup.sh
|
|
|
|
RUN ./build_openroad.sh --local --install-path /opt/openroad --nice
|
|
|
|
RUN mv dependencies /opt/or-tools
|
2023-04-24 15:06:00 -04:00
|
|
|
|
2022-09-18 07:48:56 -04:00
|
|
|
# install ACT
|
|
|
|
WORKDIR /toolsrc
|
2023-12-14 08:20:30 -05:00
|
|
|
RUN apt-get install -y libedit-dev zlib1g-dev m4 git gcc g++ make libboost-all-dev
|
|
|
|
RUN git clone https://www.github.com/asyncvlsi/actflow.git
|
|
|
|
WORKDIR actflow
|
|
|
|
RUN git submodule update --init --recursive
|
2022-09-18 07:48:56 -04:00
|
|
|
ENV ACT_HOME=/opt/cad
|
2023-12-14 08:20:30 -05:00
|
|
|
ENV VLSI_TOOLS_SRC=/toolsrc/actflow
|
2022-11-25 11:05:35 -05:00
|
|
|
WORKDIR actsim
|
|
|
|
RUN ./grab_xyce.sh /toolsrc/Xyce/build
|
2024-04-09 08:10:48 -04:00
|
|
|
RUN sed -i 's/make/make CXX=mpic++ CC=mpicc CC_COMPILER=mpicc CXX_COMPILER=mpic++ C_COMPILER_NAME=mpicc CXX_COMPILER_NAME=mpic++/g' build.sh
|
|
|
|
WORKDIR /toolsrc/actflow
|
|
|
|
RUN echo "g++" > CXX_COMPILER
|
|
|
|
RUN CXX="g++" CC="gcc" CXX_COMPILER="g++" CC_COMPILER="gcc" ./build
|
2024-06-05 10:23:38 -04:00
|
|
|
# RUN ./build
|
2024-04-09 08:10:48 -04:00
|
|
|
|
|
|
|
# install actsim
|
|
|
|
#WORKDIR /toolsrc
|
|
|
|
#RUN git clone https://github.com/asyncvlsi/actsim.git
|
|
|
|
#WORKDIR actsim
|
|
|
|
#RUN ./configure
|
|
|
|
#RUN ./grab_xyce.sh /toolsrc/Xyce/build
|
2023-05-17 13:15:51 -04:00
|
|
|
#WORKDIR ext
|
2024-04-09 08:10:48 -04:00
|
|
|
#RUN ./build.sh
|
2023-05-17 13:15:51 -04:00
|
|
|
#WORKDIR ..
|
2024-04-09 08:10:48 -04:00
|
|
|
#RUN make CXX=mpic++ CC=mpicc install
|
2022-11-25 11:05:35 -05:00
|
|
|
|
|
|
|
# install ACT-06
|
|
|
|
RUN apt-get install -y libedit-dev zlib1g-dev m4 git gcc g++ make
|
|
|
|
WORKDIR /toolsrc
|
2023-07-24 12:07:43 -04:00
|
|
|
RUN --mount=type=secret,id=user --mount=type=secret,id=token git clone https://$(cat /run/secrets/user):$(cat /run/secrets/token)@git.broccolimicro.io/Broccoli/act-06.git --branch v1.0.1
|
2022-11-25 11:05:35 -05:00
|
|
|
WORKDIR act-06/prsim
|
|
|
|
RUN ./grab_xyce.sh /toolsrc/Xyce/build
|
|
|
|
WORKDIR ..
|
|
|
|
RUN XYCE_INSTALL="/opt/cad" ENABLE_MPI=1 make
|
|
|
|
RUN cp prsim/prsim chan.py measure.py sim2vcd.py tlint/tlint spi2act/spi2act.py v2act/v2act /opt/cad/bin
|
|
|
|
|
2023-08-10 14:46:57 -04:00
|
|
|
# install graphviz DOT
|
|
|
|
RUN apt-get install -y graphviz
|
|
|
|
|
2022-09-18 07:48:56 -04:00
|
|
|
# install Haystack
|
2024-06-21 13:11:22 -04:00
|
|
|
RUN echo "Haystack"
|
2022-09-18 07:48:56 -04:00
|
|
|
WORKDIR /toolsrc
|
2024-06-21 13:11:22 -04:00
|
|
|
RUN git clone https://github.com/broccolimicro/haystack.git --branch v0.2.2
|
2022-09-18 07:48:56 -04:00
|
|
|
WORKDIR haystack
|
|
|
|
RUN git submodule update --init --recursive
|
|
|
|
WORKDIR lib
|
|
|
|
RUN make
|
|
|
|
WORKDIR ../bin
|
|
|
|
RUN make
|
|
|
|
RUN cp hsesim/hsesim /opt/cad/bin
|
|
|
|
RUN cp hseenc/hseenc /opt/cad/bin
|
2023-07-10 12:12:47 -04:00
|
|
|
RUN cp hseplot/plot /opt/cad/bin
|
|
|
|
RUN cp bubble/bubble /opt/cad/bin
|
|
|
|
RUN cp prsim/prsim /opt/cad/bin/prsimh # don't overwrite act's prsim
|
|
|
|
RUN cp gated/gated /opt/cad/bin
|
2024-06-21 13:11:22 -04:00
|
|
|
RUN cp prsize/prsize /opt/cad/bin
|
2022-09-18 07:48:56 -04:00
|
|
|
|
2023-12-14 12:04:44 -05:00
|
|
|
# install go
|
|
|
|
WORKDIR /toolsrc
|
|
|
|
RUN apt-get -y install wget
|
|
|
|
RUN /usr/bin/wget https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
|
|
|
|
RUN tar -C /opt -xzf go1.19.1.linux-amd64.tar.gz
|
2023-12-14 18:33:02 -05:00
|
|
|
RUN GOPATH=/opt/go /opt/go/bin/go install golang.org/x/tools/gopls@latest
|
|
|
|
RUN GOPATH=/opt/go /opt/go/bin/go install golang.org/x/lint/golint@latest
|
2023-12-14 12:04:44 -05:00
|
|
|
|
|
|
|
# install gaw
|
|
|
|
RUN apt-get update --fix-missing; DEBIAN_FRONTEND=noninteractive apt-get install -y libgtk-3-dev libcanberra-gtk3-module
|
|
|
|
WORKDIR /toolsrc
|
2024-06-21 13:11:22 -04:00
|
|
|
RUN git clone https://git.broccolimicro.io/Broccoli/waveview.git --branch v1.0.0
|
2023-12-14 12:04:44 -05:00
|
|
|
WORKDIR waveview
|
2023-12-14 18:33:02 -05:00
|
|
|
RUN ./configure --prefix=/opt/cad
|
2023-12-14 12:04:44 -05:00
|
|
|
RUN make
|
|
|
|
RUN make install
|
|
|
|
|
|
|
|
# install gtkwave
|
|
|
|
RUN apt-get update --fix-missing; DEBIAN_FRONTEND=noninteractive apt-get install -y gtkwave
|
|
|
|
|
2022-09-26 10:33:59 -04:00
|
|
|
# install prspice
|
|
|
|
WORKDIR /toolsrc
|
2024-06-05 10:23:38 -04:00
|
|
|
RUN git clone https://github.com/nbingham1/prspice.git --branch v0.0.2
|
2022-09-26 10:33:59 -04:00
|
|
|
WORKDIR prspice
|
|
|
|
RUN make
|
|
|
|
RUN cp prdbase prspice /opt/cad/bin
|
|
|
|
|
|
|
|
# install pr
|
|
|
|
WORKDIR /toolsrc
|
2024-06-21 13:11:22 -04:00
|
|
|
RUN git clone https://github.com/broccolimicro/pr.git --branch v0.0.5
|
2023-08-18 22:57:28 -04:00
|
|
|
RUN cp pr/pr pr/scripts/* /opt/cad/bin
|
2022-09-26 10:33:59 -04:00
|
|
|
|
2023-12-14 12:04:44 -05:00
|
|
|
# install magic layout tool
|
2023-12-14 08:20:30 -05:00
|
|
|
WORKDIR /toolsrc
|
2023-12-14 12:04:44 -05:00
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tcsh m4 csh libx11-dev tcl-dev tk-dev libcairo2-dev mesa-common-dev libglu1-mesa-dev libncurses-dev
|
|
|
|
RUN git clone https://www.github.com/RTimothyEdwards/magic.git
|
|
|
|
WORKDIR magic
|
|
|
|
RUN ./configure --prefix=/opt/magic
|
|
|
|
RUN make
|
|
|
|
RUN make install
|
2023-12-14 08:20:30 -05:00
|
|
|
|
2023-12-30 22:18:50 -05:00
|
|
|
ADD share/* /opt/cad/share
|
|
|
|
|
2024-04-09 08:10:48 -04:00
|
|
|
# setup python venv
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3.10-venv
|
|
|
|
RUN python3 -m venv /opt/python
|
|
|
|
RUN source /opt/python/bin/activate
|
|
|
|
ENV PATH="/opt/python/bin:$PATH"
|
|
|
|
|
|
|
|
# install floret
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libqhull-dev zlib1g-dev python3.10-dev tup
|
|
|
|
WORKDIR /toolsrc
|
|
|
|
RUN git clone https://github.com/broccolimicro/floret.git
|
|
|
|
WORKDIR floret
|
|
|
|
RUN git submodule update --init --recursive
|
|
|
|
RUN make
|
|
|
|
RUN cp floret-linux /opt/cad/bin/floret
|
|
|
|
|
2023-12-14 12:04:44 -05:00
|
|
|
# Stage 2: Copy everything over to final image
|
2024-06-05 10:23:38 -04:00
|
|
|
FROM ubuntu:jammy
|
2023-12-14 12:04:44 -05:00
|
|
|
SHELL ["/bin/bash", "-c"]
|
|
|
|
|
|
|
|
RUN mkdir toolsrc
|
|
|
|
RUN apt-get update --fix-missing; DEBIAN_FRONTEND=noninteractive apt-get -y install wget make gcc g++ gfortran make cmake autoconf automake git libhwloc15 libopenmpi-dev openmpi-bin openmpi-common python3 pip bison libgtk-3-dev libcanberra-gtk3-module gtkwave tcsh m4 csh libx11-dev tcl-dev tk-dev libcairo2-dev mesa-common-dev libglu1-mesa-dev libncurses-dev libedit-dev zlib1g-dev m4 git gcc g++ make libboost-all-dev graphviz sudo vim flex libfl-dev libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool; apt-get update --fix-missing
|
2023-12-14 18:33:02 -05:00
|
|
|
|
|
|
|
WORKDIR /toolsrc
|
2023-12-14 18:41:23 -05:00
|
|
|
COPY --from=0 /toolsrc/OpenROAD-flow-scripts/etc/DependencyInstaller.sh /toolsrc/etc/DependencyInstaller.sh
|
|
|
|
COPY --from=0 /toolsrc/OpenROAD-flow-scripts/tools/OpenROAD/etc/DependencyInstaller.sh /toolsrc/tools/OpenROAD/etc/DependencyInstaller.sh
|
2023-12-14 18:33:02 -05:00
|
|
|
RUN ./etc/DependencyInstaller.sh -base
|
|
|
|
RUN ./tools/OpenROAD/etc/DependencyInstaller.sh -base
|
|
|
|
|
2023-12-14 12:04:44 -05:00
|
|
|
COPY --from=0 /opt/* /opt
|
|
|
|
|
|
|
|
WORKDIR /toolsrc
|
2023-12-30 22:18:50 -05:00
|
|
|
COPY --from=0 /toolsrc/hwloc-2.8.0 /toolsrc/hwloc-2.8.0
|
|
|
|
WORKDIR /toolsrc/hwloc-2.8.0
|
2023-12-14 12:04:44 -05:00
|
|
|
RUN make install
|
2023-12-14 08:20:30 -05:00
|
|
|
|
2023-12-14 18:33:02 -05:00
|
|
|
# Clean up source code folder
|
|
|
|
RUN rm -rf /toolsrc
|
|
|
|
|
2023-06-03 11:44:43 -04:00
|
|
|
# install editors
|
|
|
|
WORKDIR "/"
|
2023-12-14 08:20:30 -05:00
|
|
|
ADD home template
|
2023-06-03 11:44:43 -04:00
|
|
|
|
2022-09-24 18:31:12 -04:00
|
|
|
# Connect user home directory of host machine
|
|
|
|
RUN mkdir "/host"
|
|
|
|
WORKDIR "/host"
|
2022-10-02 11:14:58 -04:00
|
|
|
RUN rm -rf /opt/cad/conf
|
2023-05-26 07:13:39 -04:00
|
|
|
RUN mkdir /opt/cad/conf
|
2022-09-24 18:31:12 -04:00
|
|
|
|
|
|
|
ENV USER "bcli"
|
|
|
|
ENV USER_ID "1000"
|
|
|
|
ENV GROUP_ID "1000"
|
2023-06-02 16:45:18 -04:00
|
|
|
ENV MEMBERS ""
|
2022-09-24 18:31:12 -04:00
|
|
|
|
2023-06-03 19:31:48 -04:00
|
|
|
RUN echo "version: 17"
|
|
|
|
CMD exec /bin/bash -c "echo \"127.0.0.1 bcli-$USER\" >> /etc/hosts; \
|
|
|
|
echo \"$MEMBERS\" | sed 's/[0-9]* \\(adm\|cdrom\|sudo\|dip\|plugdev\|lxd\|docker\|dialout\|sambashare\|lpadmin\\) \?//g' | sed 's/ /\n/g' | xargs -n 2 /usr/sbin/groupadd -g; \
|
2022-09-24 18:31:12 -04:00
|
|
|
/usr/sbin/useradd -u $USER_ID -g $USER $USER; \
|
2023-06-03 14:07:28 -04:00
|
|
|
echo \"$MEMBERS\" | sed 's/[0-9]* \\(adm\|cdrom\|sudo\|dip\|plugdev\|lxd\|docker\|dialout\|sambashare\\) \?//g' | sed 's/ [0-9]\+ /,/g' | sed 's/[0-9]\+ //g' | xargs -I{} /usr/sbin/usermod -aG {} $USER; \
|
2022-09-24 18:31:12 -04:00
|
|
|
cp -r /template /home/$USER; \
|
|
|
|
chown -R $USER:$USER /home/$USER; \
|
2023-06-03 12:48:57 -04:00
|
|
|
echo \"$USER ALL=NOPASSWD: /usr/bin/apt-get install *\" > /etc/sudoers.d/apt-get; \
|
|
|
|
echo \"$USER ALL=NOPASSWD: /usr/bin/apt install *\" > /etc/sudoers.d/apt; \
|
2023-12-30 22:18:50 -05:00
|
|
|
ln -s /host/.ssh /home/$USER/.ssh; \
|
|
|
|
awk '/\[user\]/,/\[[^u]/' /host/.gitconfig | head -n -1 > /home/$USER/gitconfig; \
|
|
|
|
cat /home/$USER/.gitconfig >> /home/$USER/gitconfig; \
|
|
|
|
mv /home/$USER/gitconfig /home/$USER/.gitconfig; \
|
2022-09-24 18:31:12 -04:00
|
|
|
trap : TERM INT; sleep infinity & wait"
|
2023-06-03 12:48:57 -04:00
|
|
|
|
2023-06-03 14:07:28 -04:00
|
|
|
|
2023-06-03 12:48:57 -04:00
|
|
|
# In case we need to add a password for sudo.
|
|
|
|
# However, its possible for someone to break out of the docker container and
|
|
|
|
# have root access on the host if they are given sudo access in the container.
|
|
|
|
# So, we really shouldn't give them sudo access
|
|
|
|
# /usr/sbin/usermod -p \$(openssl passwd -1 'bcli') $USER; \
|