From 4f827004e8068de55e99f6cdc7ad8f625ff07326 Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Wed, 28 Sep 2022 00:00:30 +0900 Subject: [PATCH 1/2] misc: add openlane --- .github/workflows/Build.yml | 14 +++++++ misc/openlane/build.sh | 32 ++++++++++++++++ misc/openlane/disable-missing-tools.tcl | 6 +++ misc/openlane/env.tcl | 10 +++++ misc/openlane/meta.yaml | 50 +++++++++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 misc/openlane/build.sh create mode 100644 misc/openlane/disable-missing-tools.tcl create mode 100644 misc/openlane/env.tcl create mode 100644 misc/openlane/meta.yaml diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index d3a722bd..bf3d3083 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -717,3 +717,17 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./ci + + #64 + openlane-linux: + runs-on: "ubuntu-20.04" + env: + PACKAGE: "misc/openlane" + OS_NAME: "linux" + steps: + - uses: actions/checkout@v3 + - name: 'Install tcllib' + run: | + sudo apt update + sudo apt install -y tcllib + - uses: ./ci diff --git a/misc/openlane/build.sh b/misc/openlane/build.sh new file mode 100644 index 00000000..57125d03 --- /dev/null +++ b/misc/openlane/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e +set -x + +# Identify OS +UNAME_OUT="$(uname -s)" +case "${UNAME_OUT}" in + Linux*) OS=Linux;; + *) OS="${UNAME_OUT}" + echo "Unknown OS: ${OS}" + exit;; +esac + +mkdir -p $PREFIX/share/openlane +git archive HEAD | tar -xv -C $PREFIX/share/openlane +# define system and pdk variables +mkdir -p $PREFIX/share/openlane/install +cp -a $RECIPE_DIR/env.tcl $PREFIX/share/openlane/install +mkdir -p $PREFIX/share/openlane/install/build/versions +touch $PREFIX/share/openlane/install/build/versions/keep-directory +# override default configuration to disable missing tools +cp -a $RECIPE_DIR/disable-missing-tools.tcl $PREFIX/share/openlane/configuration/disable-missing-tools.tcl +echo -n ' disable-missing-tools.tcl' >> $PREFIX/share/openlane/configuration/load_order.txt +# add flow.tcl shortcut +mkdir -p $PREFIX/bin +cat > $PREFIX/bin/flow.tcl < Date: Wed, 28 Sep 2022 00:23:49 +0900 Subject: [PATCH 2/2] installer: add constructor for openlane.sky130a --- .github/workflows/Construct.yml | 49 ++++++++++++++++++++++ .github/workflows/Upload.yml | 6 +++ installer/openlane.sky130a/construct.yaml | 15 +++++++ installer/openlane.sky130a/post_install.sh | 9 ++++ 4 files changed, 79 insertions(+) create mode 100644 .github/workflows/Construct.yml create mode 100644 installer/openlane.sky130a/construct.yaml create mode 100755 installer/openlane.sky130a/post_install.sh diff --git a/.github/workflows/Construct.yml b/.github/workflows/Construct.yml new file mode 100644 index 00000000..a9ba6746 --- /dev/null +++ b/.github/workflows/Construct.yml @@ -0,0 +1,49 @@ +name: Build installers + +on: + workflow_call: + +permissions: + contents: write + +defaults: + run: + shell: bash + +jobs: + openlane-sky130a-installer: + runs-on: "ubuntu-20.04" + steps: + - name: checkout conda-eda + uses: actions/checkout@v3 + with: + fetch-depth: 0 # fetch all tags + + - name: construct installer + run: | + export CI_SCRIPTS_PATH="$(pwd)/ci" + ./ci/install.sh + conda install constructor + constructor installer/openlane.sky130a/ + + - name: archive openlane.sky130a installer + uses: actions/upload-artifact@v3 + with: + name: "openlane-sky130a-installer" + path: | + /home/runner/work/conda-eda/conda-eda/openlane-sky130a-0-Linux-x86_64.sh + + - run: | + git config --local user.name conda-eda@bot + git config --local user.email conda-eda@bot + TAG=$(git describe --tags) + git tag $TAG + git push origin "HEAD:refs/tags/$TAG" + echo "TAG=$TAG" >> $GITHUB_ENV + + - uses: softprops/action-gh-release@v1 + with: + name: ${{ env.TAG }} + tag_name: ${{ env.TAG }} + files: | + openlane-sky130a-installer/*.sh diff --git a/.github/workflows/Upload.yml b/.github/workflows/Upload.yml index a48ad9a4..d8b96b95 100644 --- a/.github/workflows/Upload.yml +++ b/.github/workflows/Upload.yml @@ -47,6 +47,12 @@ jobs: ANACONDA_USER: ${{ secrets.ANACONDA_USER }} + Construct: + needs: Upload + if: always() && (github.event_name != 'pull_request') && (github.ref == 'refs/heads/master') + uses: ./.github/workflows/Construct.yml + + Cleanup: runs-on: ubuntu-20.04 steps: diff --git a/installer/openlane.sky130a/construct.yaml b/installer/openlane.sky130a/construct.yaml new file mode 100644 index 00000000..9ec4f3b4 --- /dev/null +++ b/installer/openlane.sky130a/construct.yaml @@ -0,0 +1,15 @@ +name: openlane-sky130a +version: 0 + +channels: + - https://conda.anaconda.org/litex-hub + - http://repo.anaconda.com/pkgs/main/ + +specs: + - python 3.7* + - conda + - openlane + - open_pdks.sky130a + - xls + +post_install: post_install.sh diff --git a/installer/openlane.sky130a/post_install.sh b/installer/openlane.sky130a/post_install.sh new file mode 100755 index 00000000..25198fb4 --- /dev/null +++ b/installer/openlane.sky130a/post_install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +cat >> $PREFIX/share/openlane/install/env.tcl <