From 4aa21070759aa1ff6e75e722bedc494b3c4d6b3b Mon Sep 17 00:00:00 2001 From: Yannick Reiss Date: Tue, 24 Jun 2025 07:19:48 +0200 Subject: [PATCH] init --- Dockerfile | 26 ++++++++++++++++++++++++++ Makefile | 17 +++++++++++++++++ src/openroad.sh | 14 ++++++++++++++ src/orfs.sh | 22 ++++++++++++++++++++++ src/yosys.sh | 25 +++++++++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100755 src/openroad.sh create mode 100755 src/orfs.sh create mode 100755 src/yosys.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8858ef1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use Alpine Linux as the base image +FROM ubuntu:latest + +# Install dependencies +RUN apt update && apt upgrade -y +RUN apt install -y git wget bash sudo + +# Setup user +RUN useradd -m -p "" openroad +RUN usermod -aG sudo openroad + +# Install scripts +COPY ./src /home/openroad +RUN chmod 777 /home/openroad/* + +# Install tools +RUN /home/openroad/yosys.sh +RUN /home/openroad/openroad.sh + +USER openroad +WORKDIR /home/openroad + +# Setup orfs +RUN /home/openroad/orfs.sh + +CMD ["bash"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..01c8bc1 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +PROVIDER = docker +UNAME = ninachloe +IMAGE = orfs_compact +LABEL = latest + +.PHONY: build +build: + $(PROVIDER) build -t $(UNAME)/$(IMAGE):$(LABEL) . + +.PHONY: run +run: + $(PROVIDER) run --rm -it --hostname $(IMAGE) --name $(UNAME)_testrun $(UNAME)/$(IMAGE):$(LABEL) "/bin/bash" + +.PHONY: publish +publish: build + $(PROVIDER) push $(UNAME)/$(IMAGE):$(LABEL) + $(PROVIDER) rmi $(IMAGE) diff --git a/src/openroad.sh b/src/openroad.sh new file mode 100755 index 0000000..3eb15da --- /dev/null +++ b/src/openroad.sh @@ -0,0 +1,14 @@ +apt install -y git bash tree + +git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD.git +cd OpenROAD +./etc/DependencyInstaller.sh -all +./etc/Build.sh +cd build +make install +cd ../.. +rm -rf OpenROAD + +echo "Searching openroad" +openroad -version +echo "Leaving openroad" diff --git a/src/orfs.sh b/src/orfs.sh new file mode 100755 index 0000000..58e0d16 --- /dev/null +++ b/src/orfs.sh @@ -0,0 +1,22 @@ +DIRECTORY_OF_ORIGIN=$(pwd) + +cd /home/openroad +git clone https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts +cd OpenROAD-flow-scripts + +FILES=$(find .) + +echo "[INFO] Setting permissions for OpenROAD" +sudo ./setup.sh + +# Remove the unused tools +rm -rf tools/yosys +rm -rf tools/OpenROAD + +echo "export OPENROAD_EXE=$(command -v openroad)" > /tmp/bashrc +echo "export YOSYS_EXE=$(command -v yosys)" >> /tmp/bashrc +#echo "export PDK_ROOT=/usr/local/share/IHP-Open-PDK/ihp-sg13g2" >> /tmp/bashrc + +cat /tmp/bashrc >> ~/.bashrc + +cd $DIRECTORY_OF_ORIGIN diff --git a/src/yosys.sh b/src/yosys.sh new file mode 100755 index 0000000..ca8d939 --- /dev/null +++ b/src/yosys.sh @@ -0,0 +1,25 @@ +# yosys 0.38 + 113 +apt install -y build-essential clang lld bison flex \ + libreadline-dev gawk tcl-dev libffi-dev git \ + graphviz xdot pkg-config python3 libboost-system-dev \ + libboost-python-dev libboost-filesystem-dev zlib1g-dev make cmake + +git clone https://github.com/YosysHQ/yosys.git +cd yosys +git submodule update --init --recursive + +make config-gcc +make +make install + +# Adding the system verilog plugin +git clone --recursive https://github.com/povik/yosys-slang +cd yosys-slang +make -j$(nproc) install +cd .. + + +cd .. +rm -rf yosys + +yosys --version