Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Restore changes for BAG2 integration #38

Open
wants to merge 8 commits into
base: next_release
Choose a base branch
from
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ More options for selecting digital standard cell libraries are available; please
Below is a list of the current tools already installed and ready to use (note there are some adaptions in our container vs. efabless.com):

* [amaranth](https://github.com/amaranth-lang/amaranth) a Python-based HDL toolchain
* [bag2](https://gitlab.com/mosaic_group/mosaic_BAG/opensource_db_template) Python-based analog layout generation and schematic transformation
* [cace](https://github.com/efabless/cace) a Python-based circuit automatic characterization engine
* [cocotb](https://github.com/cocotb/cocotb) simulation library for writing VHDL and Verilog test benches in Python
* [covered](https://github.com/hpretl/verilog-covered) Verilog code coverage
Expand Down
11 changes: 11 additions & 0 deletions _build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ ARG RFTK_FASTERCAP_REPO_COMMIT="b42179a8fdd25ab42fe45527282b4a738d7e7f87"
RUN --mount=type=bind,source=images/rftoolkit,target=/images/rftoolkit \
bash /images/rftoolkit/scripts/install.sh

#######################################################################
# Compile BAG2
#######################################################################
FROM base as bag2
ARG BAG2_REPO_URL="https://gitlab.com/mosaic_group/mosaic_BAG/opensource_db_template.git"
ARG BAG2_REPO_COMMIT="v1.2.1-iic-osic"
ARG BAG2_NAME="bag2"
COPY images/bag2/scripts/install.sh install.sh
RUN bash install.sh

#######################################################################
# Final output container
#######################################################################
Expand Down Expand Up @@ -414,6 +424,7 @@ COPY --from=xyce-xdm ${TOOLS}/ ${TOOLS}/
COPY --from=yosys ${TOOLS}/ ${TOOLS}/
COPY --from=ghdl-yosys-plugin ${TOOLS}_add/ ${TOOLS}/
COPY --from=synlig-yosys-plugin ${TOOLS}_add/ ${TOOLS}/
COPY --from=bag2 ${TOOLS}/ ${TOOLS}/

# Copy skeleton and tool version file
COPY images/iic-osic-tools/skel /
Expand Down
25 changes: 25 additions & 0 deletions _build/images/bag2/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /bin/bash

set -e

# shorten real git commit hashes, but don't mess with tag or branch names
REPO_COMMIT_SHORT=$(git rev-parse --quiet --short "$BAG2_REPO_COMMIT" || echo "$BAG2_REPO_COMMIT")

BAG2_INSTALL_DIR="$TOOLS/$BAG2_NAME/$REPO_COMMIT_SHORT"

mkdir -p "$TOOLS"
git clone --filter=blob:none "$BAG2_REPO_URL" "$BAG2_INSTALL_DIR"
cd "$BAG2_INSTALL_DIR" || exit 1
git checkout "$BAG2_REPO_COMMIT"

./init_submodules.sh
./pip3userinstall.sh

# create a file to be sourced in the final .bashrc
cat <<EOF > "$TOOLS/$BAG2_NAME/sourceme.sh"
export BAG_SRC_DIR="$BAG2_INSTALL_DIR"
export BAG_GENERATOR_ROOT=/foss/designs/bag2
export BAG_RUN_DIR=/foss/designs/bag2/BAG2_run_dir

source \$BAG_SRC_DIR/sourceme.sh
EOF
14 changes: 14 additions & 0 deletions _build/images/base/scripts/99_basepkg_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ pip3 install --upgrade --no-cache-dir \
jupyter-collaboration \
jupyterlab-night

# additional requirements for BAG2
pip3 install --upgrade --no-cache-dir \
forallpeople \
GitPython \
h5py \
IPython \
jinja2 \
klayout \
openmdao \
rtree \
python-gitlab \
sphinx_rtd_theme \
zmq

#FIXME Locally build OpenLane2 due to klayout incompatibility
#FIXME Need to add OL2 first, otherwise dependency issue on antlr4-python3-runtime
#cd /tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export PDK=sky130A
export PDKPATH=$PDK_ROOT/$PDK
export STD_CELL_LIBRARY=sky130_fd_sc_hd

# setup BAG2 environment
source $TOOLS/bag2/sourceme.sh

# FIXME: this gets rid of a few libGL errors
# https://unix.stackexchange.com/questions/589236/libgl-error-no-matching-fbconfigs-or-visuals-found-glxgears-error-docker-cu
Expand Down
3 changes: 3 additions & 0 deletions _build/tool_metadata.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- name: bag2
repo: https://gitlab.com/mosaic_group/mosaic_BAG/opensource_db_template.git
commit: v1.2.1-iic-osic
- name: covered
repo: https://github.com/iic-jku/verilog-covered
commit: 19d30fc942642b14dc24e95331cd4777c8dcbad9
Expand Down