Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .devcontainer/fedora/Fedora.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Download base image Fedora 42
FROM fedora:42

# LABEL about the custom image
LABEL maintainer="stefan_dan.ciocirlan@upb.ro"
LABEL version="0.1"
LABEL description="This is a fedora Docker Image for the computer architecture course "

# timezone
ENV TZ=Europe/Bucharest

# Update Fedora Software repository and install necessary packages
RUN dnf update -y
RUN dnf install -y \
gawk \
git
RUN dnf install -y \
latexmk \
python3 \
python3-pip \
python3-sphinx \
graphviz \
pandoc \
python3-poetry \
java-21-openjdk \
make \
cmake
RUN pip3 install Pygments \
pydata_sphinx_theme \
sphinx-autodoc-typehints \
sphinx-autoapi \
sphinxcontrib-autoprogram \
twine \
matplotlib
RUN dnf install -y \
poetry
RUN dnf install -y \
texlive-scheme-full
RUN dnf install -y \
curl \
wget \
vim \
gcc \
openssl \
openssl-devel

# RUN poetry config virtualenvs.create false
# Setup the user sdcioc for the env
ARG USER_ID=1000
ARG GROUP_ID=1000
ARG USER_NAME=sdcioc
ARG GROUP_NAME=sdcioc

# Create a user and group with the specified IDs and names
# This is necessary to avoid permission issues when running the container
# as a non-root user, especially when using volumes
# that are mounted from the host system.
# The user will have a home directory at /home/container-user
RUN groupadd -g $GROUP_ID $GROUP_NAME && \
useradd -m -u $USER_ID -g $GROUP_NAME $USER_NAME && \
passwd -d $USER_NAME && \
chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME


# # # Ensure /home/container-user is owned by container-user
RUN mkdir -p /home/$USER_NAME/.vscode-server && \
chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME
# # # make the workspace folder in the home directory
# RUN mkdir -p /home/$USER_NAME/workspace && \
# chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME/workspace
# # Set the working directory to the user's home directory
# WORKDIR /home/$USER_NAME/workspace
# # Set the user to the one we created
RUN dnf install -y sudo && \
echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER $USER_NAME

# Install rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
echo 'source $HOME/.cargo/env' >> $HOME/.bashrc && \
source $HOME/.cargo/env && \
rustup install stable && \
rustup default stable && \
cargo install typst-cli
# RUN poetry config virtualenvs.create false
41 changes: 41 additions & 0 deletions .devcontainer/fedora/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "Container for Qexam",
"build": {
"dockerfile": "Fedora.Dockerfile"
},
// "workspaceFolder": "/home/sdcioc/workspace",
"remoteUser": "sdcioc",
"remoteEnv": {
"DISPLAY": "unix:0"
},
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"extensions": [
"GitHub.vscode-pull-request-github",
"GitHub.copilot",
"ms-azuretools.vscode-docker",
"GitHub.copilot-chat",
"ms-vscode.makefile-tools",
"ms-python.python",
"tomoki1207.pdf",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort",
"ms-python.flake8",
"james-yu.latex-workshop",
"Aizhe.3d-html-viewer",
"redhat.vscode-xml",
"bierner.github-markdown-preview",
"myriad-dreamin.tinymist"
]
}
},
"runArgs": [
"--rm",
"--privileged"
],
"postAttachCommand": "poetry install"
}
47 changes: 47 additions & 0 deletions .devcontainer/linux/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Container for computer architecture",
// "image": "gitlab.cs.pub.ro:5050/ac/ac-public/vivado-fit:1.0.0",
"image": "vivado-fresh:latest",
// "build": {
// "dockerfile": "Fedora.Dockerfile"
// },
// "workspaceFolder": "/home/sdcioc/workspace",
// "remoteUser": "sdcioc",
"remoteEnv": {
"DISPLAY": "unix:0"
// "DISPLAY" : ":0.0"
},
// "containerEnv": {
// "DISPLAY" : ":0.0"
// },
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"extensions": [
"GitHub.vscode-pull-request-github",
"GitHub.copilot",
"ms-azuretools.vscode-docker",
"GitHub.copilot-chat",
"ms-vscode.makefile-tools",
"ms-python.python",
"tomoki1207.pdf",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort",
"ms-python.flake8",
"james-yu.latex-workshop",
"Aizhe.3d-html-viewer",
"redhat.vscode-xml",
"bierner.github-markdown-preview",
"myriad-dreamin.tinymist",
"mshr-h.veriloghdl"
]
}
},
"runArgs": [
"--rm",
"--privileged"
]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ _site/
*.jou
*.log
build_project/
.Xil/
.Xil/
*.pb
3 changes: 3 additions & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.bin
vivado_installer
wi_authentication_key
154 changes: 154 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
FROM ubuntu:24.04 AS vivado-install-files

ENV DEBIAN_FRONTEND noninteractive

ARG VIVADO_VERSION=2025.1
ARG VIVADO_BIN=FPGAs_AdaptiveSoCs_Unified_SDI_2025.1_0530_0145_Lin64.bin


COPY $VIVADO_BIN /root/$VIVADO_BIN
RUN chmod +x /root/$VIVADO_BIN && \
/root/$VIVADO_BIN --noexec --target /root/vivado_installer && \
rm -f /root/$VIVADO_BIN

# /root/vivado_installer/xsetup -b ConfigGen
# modify this file to customize your installation
COPY install_config.txt /root/install_config.txt

# You need to get this file from Xilinx website after login
# /root/vivado_installer/xsetup -b AuthTokenGen
COPY wi_authentication_key /root/wi_authentication_key

FROM ubuntu:24.04 AS vivado-fresh-install

ENV DEBIAN_FRONTEND noninteractive

COPY --from=vivado-install-files /root/vivado_installer /root/vivado_installer
RUN mkdir -p /root/.Xilinx
COPY --from=vivado-install-files /root/wi_authentication_key /root/.Xilinx/wi_authentication_key
COPY --from=vivado-install-files /root/install_config.txt /root/.Xilinx/install_config.txt

RUN chmod +x /root/vivado_installer/installLibs.sh && \
/root/vivado_installer/installLibs.sh

RUN chmod +x /root/vivado_installer/xsetup && \
/root/vivado_installer/xsetup --agree XilinxEULA,3rdPartyEULA --batch Install --config /root/.Xilinx/install_config.txt

FROM vivado-fresh-install AS vivado-cleaning-process

ENV DEBIAN_FRONTEND=noninteractive
ARG VIVADO_VERSION=2025.1

RUN rm -rf /root/vivado_installer && \
rm -rf /tmp/* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN rm -rf /tools/Xilinx/.xinstall && \
echo "FINISHED removing .xinstall" && \
rm -rf /tools/Xilinx/xic && \
echo "FINISHED removing xic (information and update)"

# remove from here /tools/Xilinx/VERSION
RUN rm -rf /tools/Xilinx/${VIVADO_VERSION}/Vitis && \
echo "FINISHED removing vitis" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/gnu && \
echo "FINISHED removing gnu (microblaze and riscv)"
# remove from here /tools/Xilinx/Vivado/VERSION/data
RUN rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/embeddedsw && \
echo "FINISHED removing embeddedsw" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/ip && \
echo "FINISHED removing ip" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/secureip && \
echo "FINISHED removing secureip" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/deca && \
echo "FINISHED removing deca"

# remove data/parts
RUN rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/virtex4 && \
echo "FINISHED removing virtex4" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/virtex5 && \
echo "FINISHED removing virtex5" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/virtex6 && \
echo "FINISHED removing virtex6" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/virtex7 && \
echo "FINISHED removing virtex7" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/kirtex7 && \
echo "FINISHED removing kirtex7" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/spartan3 && \
echo "FINISHED removing spartan3" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/spartan3e && \
echo "FINISHED removing spartan3e" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/spartan6 && \
echo "FINISHED removing spartan6" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/spartan7 && \
echo "FINISHED removing spartan7" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/spartan3a && \
echo "FINISHED removing spartan3a" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/parts/spartan3adsp && \
echo "FINISHED removing spartan3adsp"

# remove xsim/ip
RUN rm -rf /tools/Xilinx/${VIVADO_VERSION}/data/xsim/ip && \
echo "FINISHED removing xsim ip"

# remove lnx64 tools that are not needed
RUN rm -rf /tools/Xilinx/${VIVADO_VERSION}/lnx64/tools/clang-16 && \
echo "FINISHED removing clang-16" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/lnx64/tools/clang && \
echo "FINISHED removing clang" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/lnx64/tools/clang-3.1 && \
echo "FINISHED removing clang-3.1" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/lnx64/tools/clang-3.9-csynth && \
echo "FINISHED removing clang-3.9-csynth"

# remove tps/lnx64 tools that are not needed
RUN rm -rf /tools/Xilinx/${VIVADO_VERSION}/tps/lnx64/git-2.45.0 && \
echo "FINISHED removing git-2.45.0" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/tps/lnx64/git-2.46.0 && \
echo "FINISHED removing git-2.46.0" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/tps/lnx64/gcc-8.3.0 && \
echo "FINISHED removing gcc-8.3.0" && \
# rm -rf /tools/Xilinx/${VIVADO_VERSION}/tps/lnx64/gcc-9.3.0 && \
# echo "FINISHED removing gcc-9.3.0" && \
rm -rf /tools/Xilinx/${VIVADO_VERSION}/tps/lnx64/clangd-8.0.0 && \
echo "FINISHED removing clangd-8.0.0"


RUN echo "source /tools/Xilinx/${VIVADO_VERSION}/Vivado/.settings64-Vivado.sh" >> /root/.bashrc

# the real working shit ....
FROM ubuntu:24.04 as vivado-final

ENV DEBIAN_FRONTEND=noninteractive
ARG VIVADO_VERSION=2025.1

RUN apt-get update && \
apt-get install -y locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
locale-gen en_US.UTF-8

# install de dependencies
COPY --from=vivado-install-files /root/vivado_installer/installLibs.sh /root/vivado_installer/installLibs.sh
RUN apt-get update && \
chmod +x /root/vivado_installer/installLibs.sh && \
/root/vivado_installer/installLibs.sh && \
rm -rf /root/vivado_installer && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Copy the final tools
COPY --from=vivado-cleaning-process /tools/Xilinx /tools/Xilinx


# install the cable drivers
RUN mkdir -p /etc/udev/rules.d
RUN /tools/Xilinx/${VIVADO_VERSION}/data/xicom/cable_drivers/lin64/install_script/install_drivers/install_drivers

COPY board_files/arty /tools/Xilinx/${VIVADO_VERSION}/data/boards/board_files/arty
COPY board_files/arty-a7-100 /tools/Xilinx/${VIVADO_VERSION}/data/boards/board_files/arty-a7-100
COPY board_files/nexys-a7-100t /tools/Xilinx/${VIVADO_VERSION}/data/boards/board_files/nexys-a7-100t

# add the source /tools/Xilinx/VERSION/Vivado/.settings64-Vivado.sh in bashrc
RUN echo "source /tools/Xilinx/${VIVADO_VERSION}/Vivado/.settings64-Vivado.sh" >> /root/.bashrc
25 changes: 25 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version=1.0.0
registry=gitlab.cs.pub.ro:5050/ac/ac-public
img_name=vivado-fit
tag_name=${registry}/${img_name}:${version}
internal_step_img_name=vivado-final

build:
docker image build -t ${tag_name} --target ${internal_step_img_name} .

test: build
docker run --rm --name ${img_name} ${tag_name}

run: build
docker run --rm -it --name ${img_name} -e QT_DEBUG_PLUGINS=1 ${tag_name} /bin/bash

bash:
docker exec -it ${img_name} /bin/bash

push:
docker push ${tag_name}

clean:
docker rm -f ${img_name}
docker image rm ${tag_name}

Loading