diff --git a/.github/actions/docker_build/action.yml b/.github/actions/docker_build/action.yml new file mode 100644 index 000000000..e9957859f --- /dev/null +++ b/.github/actions/docker_build/action.yml @@ -0,0 +1,59 @@ +name: Docker Build +description: Build an OpenLane Docker Container +inputs: + arch: + description: "The Docker architecture/platform to build for" + required: true + default: "amd64" + dockerhub_user: + description: The input dockerhub user + required: false + default: "" + dockerhub_password: + description: The input dockerhub password + required: false + default: "" +runs: + using: "composite" + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-buildx-action@v2 + - uses: ./.github/actions/set_env_variables + + - name: Check If Going To Push An Image To Docker + shell: bash + run: | + export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request" && "${{ inputs.dockerhub_user }}" != ""); print(1) else print(0) end') + echo "PUSHING=$PUSHING" >> $GITHUB_ENV + + - name: Login to DockerHub + if: ${{ env.PUSHING == '1' }} + uses: docker/login-action@v1 + with: + username: ${{ inputs.dockerhub_user }} + password: ${{ inputs.dockerhub_password }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Docker Build + shell: bash + run: | + export BUILD_IF_CANT_PULL=1 + export BUILD_COMMAND="docker build" + if [ "$PUSHING" = "1" ]; then + export BUILD_IF_CANT_PULL_THEN_PUSH=1 + export BUILD_COMMAND="docker buildx build --load --cache-from=type=gha --cache-to=type=gha,scope=${{ github.workflow }}}" + fi + export BUILD_ARCH=${{ inputs.arch }} + cd docker/ && make merge + + - name: Export Docker Image + shell: bash + run: docker save -o /tmp/image-${{ inputs.arch }}.tar ${{ env.OPENLANE_IMAGE_NAME }}-${{ inputs.arch }} + + - name: Upload Docker Image + uses: actions/upload-artifact@v2 + with: + name: docker-image-${{ inputs.arch }} + path: /tmp/image-${{ inputs.arch }}.tar diff --git a/.github/actions/set_env_variables/action.yml b/.github/actions/set_env_variables/action.yml new file mode 100644 index 000000000..71c457e86 --- /dev/null +++ b/.github/actions/set_env_variables/action.yml @@ -0,0 +1,20 @@ +name: Set up environment variables +description: Sets up various environment variables required by various OpenLane steps. +runs: + using: "composite" + steps: + - name: Export Repo URL + shell: bash + run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV + + - name: Export PDK ROOT + shell: bash + run: echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV + + - name: Export Branch Name + shell: bash + run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Export Temp Image Name + shell: bash + run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV diff --git a/.github/scripts/run_tests.py b/.github/scripts/run_tests.py index a726c21ac..767aa0f7c 100644 --- a/.github/scripts/run_tests.py +++ b/.github/scripts/run_tests.py @@ -22,7 +22,7 @@ import subprocess from gh import gh -threads_used = int(subprocess.check_output(["nproc"]).decode("utf-8")) - 1 +threads_used = os.cpu_count() - 1 test_name = "ci_test" design = sys.argv[1] print(f"Running on designs {test_name} using {threads_used} threads…") diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8ebc61866..a3bb167cb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,11 +1,10 @@ name: Lint on: - # Runs on pushes to all but CID-latest-branches - # CID-latest branches automatically create PRs, let's just let the tests run on those + # Runs on all pushes to branches push: - # Runs on Pull Requests + # Runs on all PRs pull_request: - # Runs manually + # Manual Dispatch workflow_dispatch: jobs: diff --git a/.github/workflows/openlane_ci.yml b/.github/workflows/openlane_ci.yml index c13537952..986c00890 100644 --- a/.github/workflows/openlane_ci.yml +++ b/.github/workflows/openlane_ci.yml @@ -1,11 +1,9 @@ name: CI -# To run on the GCP replace all 'ubuntu-latest' with 'self-hosted' on: - # Runs on pushes to all but CID-latest-branches - # CID-latest branches automatically create PRs, let's just let the tests run on those + # Runs on all pushes to branches push: - # Runs on Pull Requests + # Runs on all PRs pull_request: # Runs every day at midnight UTC schedule: @@ -14,50 +12,17 @@ on: workflow_dispatch: jobs: - docker_build: + pdk_build: + name: Fetch or Build PDK runs-on: ubuntu-20.04 outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + design_matrix: ${{ steps.set-matrix.outputs.design_matrix }} issue_regression_matrix: ${{ steps.set-matrix.outputs.issue_regression_matrix }} steps: - uses: actions/checkout@v2 - # EXPORT BLOCK - - name: Export Repo URL - run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV - - - name: Export PDK ROOT - run: echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV - - - name: Export Branch Name - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Export Temp Image Name - run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV - # END EXPORT BLOCK - - - name: Check If Going To Push An Image To Docker - # # Uncomment the next line if you want to only build & push a container if entire test set succeeds - # if: needs.test.result == 'success' - # Ruby snippet to print 0 if this is a PR or if there is no DOCKERHUB_USER secret set, otherwise, 1 - run: | - export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request" && "${{ secrets.DOCKERHUB_USER }}" != ""); print(1) else print(0) end') - echo "PUSHING=$PUSHING" >> $GITHUB_ENV - - - name: Login to DockerHub - if: ${{ env.PUSHING == '1' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Docker Build - run: | - export BUILD_IF_CANT_PULL=1 - if [ $PUSHING = '1' ]; then - export BUILD_IF_CANT_PULL_THEN_PUSH=1 - fi - cd docker/ && make merge + - name: Set up environment variables + uses: ./.github/actions/set_env_variables - name: Build (or Get) PDK run: | @@ -82,15 +47,6 @@ jobs: $OPDKS_VER fi - - name: Export Docker Image - run: docker save -o /tmp/image.tar ${{ env.OPENLANE_IMAGE_NAME }} - - - name: Upload Docker Image - uses: actions/upload-artifact@v2 - with: - name: docker-image - path: /tmp/image.tar - - name: Tarball PDK run: | tar -cf /tmp/sky130A.tar -C $PDK_ROOT/sky130A . @@ -106,47 +62,58 @@ jobs: export EVENT_NAME=${{ github.event_name }}; python3 ./.github/scripts/determine_test_set.py - - name: Prepare Test Matrix + - name: Prepare Test Matrices id: set-matrix run: | if [[ "$USE_ETS" = "1" ]]; then - echo "::set-output name=matrix::$(python3 ./.github/test_sets/get_test_matrix.py fastest_test_set extended_test_set)" + echo "::set-output name=design_matrix::$(python3 ./.github/test_sets/get_test_matrix.py fastest_test_set extended_test_set)" else - echo "::set-output name=matrix::$(python3 ./.github/test_sets/get_test_matrix.py fastest_test_set)" + echo "::set-output name=design_matrix::$(python3 ./.github/test_sets/get_test_matrix.py fastest_test_set)" fi echo "::set-output name=issue_regression_matrix::$(python3 ./run_issue_regressions.py get_matrix)" - + docker_build_amd64: + name: Docker Build (amd64) + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build + uses: ./.github/actions/docker_build + with: + arch: amd64 + dockerhub_user: ${{ secrets.DOCKERHUB_USER }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + docker_build_arm64v8: + name: Docker Build (arm64v8) + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build + uses: ./.github/actions/docker_build + with: + arch: arm64v8 + dockerhub_user: ${{ secrets.DOCKERHUB_USER }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} issue_regression_test: - needs: docker_build + name: Regression Test (Issue ${{ matrix.design }}) + needs: [docker_build_amd64, pdk_build] runs-on: ubuntu-20.04 strategy: fail-fast: false - matrix: ${{ fromJSON(needs.docker_build.outputs.issue_regression_matrix) }} - name: Test Issue Regression ${{ matrix.design }} + matrix: ${{ fromJSON(needs.pdk_build.outputs.issue_regression_matrix) }} steps: - uses: actions/checkout@v2 - # EXPORT BLOCK - - name: Export Repo URL - run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV - - name: Export PDK ROOT - run: echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV - - - name: Export Branch Name - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Export Temp Image Name - run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV - # END EXPORT BLOCK + - name: Set up environment variables + uses: ./.github/actions/set_env_variables - name: Download Docker Image uses: actions/download-artifact@v2 with: - name: docker-image + name: docker-image-amd64 path: /tmp - name: Import Docker Image - run: docker load --input /tmp/image.tar + run: docker load --input /tmp/image-amd64.tar - name: Download PDK Tarball uses: actions/download-artifact@v2 @@ -168,37 +135,26 @@ jobs: # Each test has two components: a fast test set and an extended test set. # The fast test set is run on all PRs, etc. The extended test set runs on schedule. test: - needs: docker_build + name: Test Design ${{ matrix.design }} + needs: [docker_build_amd64, pdk_build] runs-on: ubuntu-20.04 strategy: fail-fast: false - matrix: ${{ fromJSON(needs.docker_build.outputs.matrix) }} - name: Test Design ${{ matrix.design }} + matrix: ${{ fromJSON(needs.pdk_build.outputs.design_matrix) }} steps: - uses: actions/checkout@v2 - # EXPORT BLOCK - - name: Export Repo URL - run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV - - - name: Export PDK ROOT - run: echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV + - name: Set up environment variables + uses: ./.github/actions/set_env_variables - - name: Export Branch Name - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Export Temp Image Name - run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV - # END EXPORT BLOCK - - - name: Download Docker Image + - name: Download Docker Image (amd64) uses: actions/download-artifact@v2 with: - name: docker-image + name: docker-image-amd64 path: /tmp - name: Import Docker Image - run: docker load --input /tmp/image.tar + run: docker load --input /tmp/image-amd64.tar - name: Download PDK Tarball uses: actions/download-artifact@v2 @@ -216,7 +172,9 @@ jobs: run: python3 -m pip install pyyaml - name: Run Test - run: cd ${GITHUB_WORKSPACE}/ && python3 ${GITHUB_WORKSPACE}/.github/scripts/run_tests.py ${{ matrix.design }} + run: | + OPENLANE_IMAGE_NAME=$OPENLANE_IMAGE_NAME-amd64\ + python3 ${GITHUB_WORKSPACE}/.github/scripts/run_tests.py ${{ matrix.design }} - name: Upload Run Tarball if: ${{ always() }} @@ -227,7 +185,8 @@ jobs: cleanup_and_deploy: name: Cleanup (and Possibly Deployment) - needs: [test, issue_regression_test] + needs: + [docker_build_amd64, docker_build_arm64v8, test, issue_regression_test] if: always() runs-on: ubuntu-20.04 steps: @@ -240,47 +199,40 @@ jobs: echo "PUSHING=$PUSHING" >> $GITHUB_ENV - uses: actions/checkout@v2 - if: ${{ env.PUSHING == '1' }} with: fetch-depth: 0 - # EXPORT BLOCK - - name: Export Repo URL - run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV - - - name: Export PDK ROOT - run: echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV + - name: Set up environment variables + uses: ./.github/actions/set_env_variables - - name: Export Branch Name - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Export Temp Image Name - run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV - # END EXPORT BLOCK + - name: Download Docker Image (amd64) + uses: actions/download-artifact@v2 + with: + name: docker-image-amd64 + path: /tmp - - name: Download Docker Image - if: ${{ env.PUSHING == '1' }} + - name: Download Docker Image (arm64v8) uses: actions/download-artifact@v2 with: - name: docker-image + name: docker-image-arm64v8 path: /tmp - - name: Delete Docker Image + - name: Delete Docker Image (amd64) uses: geekyeggo/delete-artifact@v1 with: - name: docker-image + name: docker-image-amd64 + + - name: Delete Docker Image (arm64v8) + uses: geekyeggo/delete-artifact@v1 + with: + name: docker-image-arm64v8 - name: Delete PDK uses: geekyeggo/delete-artifact@v1 with: name: pdk-tarball - - name: Import Docker Image - if: ${{ env.PUSHING == '1' }} - run: docker load --input /tmp/image.tar - - name: Write Main Branch - if: ${{ env.PUSHING == '1' }} run: | echo "MAIN_BRANCH=${{ secrets.MAIN_BRANCH }}" >> $GITHUB_ENV @@ -288,6 +240,13 @@ jobs: run: | echo "GIT_COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Import Docker Images + if: ${{ env.PUSHING == '1' }} + run: | + for arch in amd64 arm64v8; do + docker load --input /tmp/image-$arch.tar + done + - name: Create Tag (If scheduled or dispatched) if: ${{ env.PUSHING == '1' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && env.BRANCH_NAME == env.MAIN_BRANCH }} run: cd ${GITHUB_WORKSPACE}/ && python3 ${GITHUB_WORKSPACE}/.github/scripts/generate_tag.py @@ -306,22 +265,36 @@ jobs: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Docker Push (Hash) + - name: Start Tag List + if: ${{ env.PUSHING == '1' }} + run: | + echo "TAG_LIST=" >> $GITHUB_ENV + + - name: Docker Tag (Main Branch Hashes) if: ${{ env.PUSHING == '1' && github.event_name == 'push' && env.BRANCH_NAME == env.MAIN_BRANCH }} run: | - docker image tag ${{ env.OPENLANE_IMAGE_NAME }} ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_COMMIT_HASH }} - docker push ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_COMMIT_HASH }} + echo "TAG_LIST=$TAG_LIST ${{ env.GIT_COMMIT_HASH }}" >> $GITHUB_ENV - - name: Docker Push (Branch) + - name: Docker Tag (Branches) if: ${{ env.PUSHING == '1' && github.event_name == 'push' }} run: | - docker image tag ${{ env.OPENLANE_IMAGE_NAME }} ${{ secrets.DOCKER_IMAGE }}:${{ env.BRANCH_NAME }} - docker push ${{ secrets.DOCKER_IMAGE }}:${{ env.BRANCH_NAME }} + echo "TAG_LIST=$TAG_LIST ${{ env.BRANCH_NAME }}" >> $GITHUB_ENV - - name: Docker Push (Tag) (If scheduled or dispatched) + - name: Docker Push (Version Tag/Latest) if: ${{ env.PUSHING == '1' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && env.NEW_TAG != 'NO_NEW_TAG' }} run: | - docker image tag ${{ env.OPENLANE_IMAGE_NAME }} ${{ secrets.DOCKER_IMAGE }}:${{ env.NEW_TAG }} - docker image tag ${{ env.OPENLANE_IMAGE_NAME }} ${{ secrets.DOCKER_IMAGE }}:latest - docker push ${{ secrets.DOCKER_IMAGE }}:${{ env.NEW_TAG }} - docker push ${{ secrets.DOCKER_IMAGE }}:latest + echo "TAG_LIST=$TAG_LIST ${{ env.NEW_TAG }} latest" >> $GITHUB_ENV + + - name: Docker Pushes + if: ${{ env.PUSHING == '1' }} + run: | + for tag in $TAG_LIST; do + for arch in amd64 arm64v8; do + docker image tag ${{ env.OPENLANE_IMAGE_NAME }}-$arch ${{ secrets.DOCKER_IMAGE }}:$tag-$arch + docker push ${{ secrets.DOCKER_IMAGE }}:$tag-$arch + done + docker manifest create ${{ secrets.DOCKER_IMAGE }}:$tag\ + --amend ${{ secrets.DOCKER_IMAGE }}:$tag-amd64\ + --amend ${{ secrets.DOCKER_IMAGE }}:$tag-arm64v8 + docker manifest push ${{ secrets.DOCKER_IMAGE }}:$tag + done diff --git a/.github/workflows/tool_updater.yml b/.github/workflows/tool_updater.yml index 629c2811b..fbe458e68 100644 --- a/.github/workflows/tool_updater.yml +++ b/.github/workflows/tool_updater.yml @@ -1,6 +1,5 @@ name: Tool Updater -# To run on the GCP replace all 'ubuntu-latest' with 'self-hosted' on: # Runs every day at midnight UTC schedule: @@ -15,21 +14,13 @@ jobs: matrix: tools: [magic, netgen, yosys, openroad_app] steps: - # EXPORT BLOCK - - name: Export Repo URL - run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV - - - name: Export Branch Name - run: echo "BRANCH_NAME=${{ secrets.MAIN_BRANCH }}" >> $GITHUB_ENV - - - name: Export PDK ROOT - run: echo "PDK_ROOT=${{ github.workspace }}/pdks" >> $GITHUB_ENV - # END EXPORT BLOCK - - uses: actions/checkout@v2 with: ref: ${{ secrets.MAIN_BRANCH }} + - name: Set up environment variables + uses: ./.github/actions/set_env_variables + - name: Export TOOL Name run: echo "TOOL=${{ matrix.tools }}" >> $GITHUB_ENV @@ -56,21 +47,13 @@ jobs: create-cid-pdk-branch: runs-on: ubuntu-20.04 steps: - # EXPORT BLOCK - - name: Export Repo URL - run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV - - - name: Export Branch Name - run: echo "BRANCH_NAME=${{ secrets.MAIN_BRANCH }}" >> $GITHUB_ENV - - - name: Export PDK ROOT - run: echo "PDK_ROOT=${{ github.workspace }}/pdks" >> $GITHUB_ENV - # END EXPORT BLOCK - - uses: actions/checkout@v2 with: ref: ${{ secrets.MAIN_BRANCH }} + - name: Set up environment variables + uses: ./.github/actions/set_env_variables + - name: Update PDK run: python3 ${GITHUB_WORKSPACE}/.github/scripts/update_tools.py sky130 open_pdks diff --git a/Makefile b/Makefile index 2e1090a8e..1172eceba 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ OPENLANE_DIR ?= $(shell pwd) DOCKER_OPTIONS = $(shell $(PYTHON_BIN) ./env.py docker-config) +DOCKER_ARCH ?= $(shell $(PYTHON_BIN) ./docker/utils.py current-docker-platform) + # Allow Configuring Memory Limits ifneq (,$(DOCKER_SWAP)) # Set to -1 for unlimited DOCKER_OPTIONS += --memory-swap=$(DOCKER_SWAP) @@ -41,12 +43,7 @@ ifneq (,$(ROUTING_CORES)) DOCKER_OPTIONS += -e ROUTING_CORES=$(ROUTING_CORES) endif -ifeq ($(OPENLANE_IMAGE_NAME),) -OPENLANE_DOCKER_TAG ?= $(shell $(PYTHON_BIN) ./dependencies/get_tag.py) -ifneq ($(OPENLANE_DOCKER_TAG),) -export OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_DOCKER_TAG) -endif -endif +include ./dependencies/image_name.mk TEST_DESIGN ?= spm DESIGN_LIST ?= spm @@ -80,7 +77,7 @@ ENV_START = docker run --rm\ $(STD_CELL_OPTS)\ $(DOCKER_OPTIONS) -ENV_COMMAND = $(ENV_START) $(OPENLANE_IMAGE_NAME) +ENV_COMMAND = $(ENV_START) $(OPENLANE_IMAGE_NAME)-$(DOCKER_ARCH) .DEFAULT_GOAL := all @@ -100,7 +97,7 @@ get-openlane: .PHONY: mount mount: cd $(OPENLANE_DIR) && \ - $(ENV_START) -ti $(OPENLANE_IMAGE_NAME) + $(ENV_START) -ti $(OPENLANE_IMAGE_NAME)-$(DOCKER_ARCH) .PHONY: pdk pdk: venv/created @@ -111,11 +108,18 @@ pdk: venv/created survey: $(PYTHON_BIN) ./env.py issue-survey -venv/created: ./requirements.txt ./dependencies/python/precompile_time.txt ./dependencies/python/run_time.txt + +.PHONY: lint +lint: venv/created + ./venv/bin/black --check . + ./venv/bin/flake8 . + +venv: venv/created +venv/created: ./requirements.txt ./requirements_dev.txt ./requirements_lint.txt ./dependencies/python/precompile_time.txt ./dependencies/python/run_time.txt rm -rf ./venv $(PYTHON_BIN) -m venv ./venv ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir pip - ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir -r ./requirements.txt + ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir -r ./requirements_dev.txt touch $@ DLTAG=custom_design_List diff --git a/configuration/README.md b/configuration/README.md index 5695d3927..01e7a757f 100644 --- a/configuration/README.md +++ b/configuration/README.md @@ -171,8 +171,8 @@ These variables worked initially, but they were too sky130 specific and will be | Variable | Description | |---------------|---------------------------------------------------------------| -| `GLOBAL_ROUTER` | Specifies which global router to use. Values: `fastroute` or `cugr`.
(Default: `fastroute`) | -| `DETAILED_ROUTER` | Specifies which detailed router to use. Values: `tritonroute`, `tritonroute_or` (identical to `tritonroute`, deprecated) or `drcu`.
(Default: `tritonroute`)| +| `GLOBAL_ROUTER` | Specifies which global router to use. Values: `fastroute`. (`cugr` is deprecated and fastroute will be used instead.)
(Default: `fastroute`) | +| `DETAILED_ROUTER` | Specifies which detailed router to use. Values: `tritonroute`. (`drcu`/`tritonroute_or` are both deprecated and tritonroute will be used instead.)
(Default: `tritonroute`)| | `ROUTING_CORES` | Specifies the number of threads to be used in TritonRoute. Can be overriden via environment variable.
(Default: `2`) | | `RT_CLOCK_MIN_LAYER` | The name of lowest layer to be used in routing the clock net.
(Default: `RT_MIN_LAYER`)| | `RT_CLOCK_MAX_LAYER` | The name of highest layer to be used in routing the clock net.
(Default: `RT_MAX_LAYER`)| diff --git a/dependencies/centos-7/compile_time.txt b/dependencies/centos-7/compile_time.txt index 595b44025..cdcf0d361 100644 --- a/dependencies/centos-7/compile_time.txt +++ b/dependencies/centos-7/compile_time.txt @@ -1,9 +1,6 @@ devtoolset-8 devtoolset-8-libatomic-devel -llvm-toolset-7.0-clang -llvm-toolset-7.0-libomp-devel - Xvfb autoconf automake diff --git a/dependencies/centos-7/run_time.txt b/dependencies/centos-7/run_time.txt index c99d3038f..5625973eb 100644 --- a/dependencies/centos-7/run_time.txt +++ b/dependencies/centos-7/run_time.txt @@ -13,7 +13,6 @@ libXft libXinerama libXrandr libyaml -llvm-toolset-7-libomp make mesa-libGLU patch diff --git a/dependencies/hash_for.py b/dependencies/hash_for.py new file mode 100644 index 000000000..2852483e4 --- /dev/null +++ b/dependencies/hash_for.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2022 Efabless Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Gets a hash of the current dependency set of a certain operating system. +""" + +import os +import sys +import glob +import hashlib + +__dir__ = os.path.dirname(os.path.abspath(__file__)) + + +def main(argv): + if len(argv) != 2: + print(f"Usage: {argv[0]} ", file=sys.stderr) + exit(64) + + os = argv[1] + if os not in ["macos", "centos-7", "ubuntu-20.04", "arch"]: + print(f"Unknown operating system pick '{os}'.") + exit(64) + + files = glob.glob(f"{__dir__}/python/*") + files += glob.glob(f"{__dir__}/{os}/*") + + files.sort() + + content = "" + for file in files: + content += open(file).read() + + hash = hashlib.sha256(content.encode("utf-8")).hexdigest() + + print(hash, end="") + + +if __name__ == "__main__": + main(sys.argv) diff --git a/dependencies/image_name.mk b/dependencies/image_name.mk new file mode 100644 index 000000000..91341f205 --- /dev/null +++ b/dependencies/image_name.mk @@ -0,0 +1,9 @@ +__DIRNAME__ := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + + +ifeq ($(OPENLANE_IMAGE_NAME),) +OPENLANE_DOCKER_TAG ?= $(shell $(PYTHON_BIN) $(__DIRNAME__)/get_tag.py) +ifneq ($(OPENLANE_DOCKER_TAG),) +export OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_DOCKER_TAG) +endif +endif diff --git a/dependencies/installer.py b/dependencies/installer.py index c8f64eec2..b474097cb 100644 --- a/dependencies/installer.py +++ b/dependencies/installer.py @@ -400,16 +400,18 @@ def install(): venv_builder = venv.EnvBuilder(clear=True, with_pip=True) venv_builder.create("./venv") + pip_install_cmd = "python3 -m pip install --upgrade --no-cache-dir" + subprocess.run( [ "bash", "-c", - """ + f""" source ./venv/bin/activate - python3 -m pip install --upgrade -r ../dependencies/python/precompile_time.txt - python3 -m pip install --upgrade -r ../dependencies/python/compile_time.txt - python3 -m pip install --upgrade -r ../dependencies/python/run_time.txt - """, + {pip_install_cmd} -r ../dependencies/python/precompile_time.txt + {pip_install_cmd} -r ../dependencies/python/compile_time.txt + {pip_install_cmd} -r ../dependencies/python/run_time.txt + """, ] ) diff --git a/dependencies/python/run_time.txt b/dependencies/python/run_time.txt index 1f25abb4c..4abf5139c 100644 --- a/dependencies/python/run_time.txt +++ b/dependencies/python/run_time.txt @@ -1,4 +1,4 @@ -click~=8.0.0 +click>=8.0.0,<9 pyyaml~=5.4.0 install~=1.3.5 XlsxWriter~=3.0.2 \ No newline at end of file diff --git a/dependencies/tool.py b/dependencies/tool.py index 04e35f6c3..0203b8533 100644 --- a/dependencies/tool.py +++ b/dependencies/tool.py @@ -14,7 +14,7 @@ # limitations under the License. import os import sys -from typing import Dict, List +from typing import Dict, List, Optional sys.path.append(os.path.dirname(__file__)) import includedyaml as yaml # noqa: E402 @@ -60,8 +60,11 @@ def repo_pretty(self): def version_string(self) -> str: return f"{self.repo or 'None'}:{self.commit or 'None'}" - def get_docker_tag(self, for_os: str) -> str: - return f"{self.name}-{self.commit}-{for_os}" + def get_docker_tag(self, for_os: str, arch: Optional[str] = None) -> str: + tag = f"{self.name}-{self.commit}-{for_os}" + if arch is not None: + tag += f"-{arch}" + return tag @property def docker_args(self) -> List[str]: @@ -109,6 +112,7 @@ def main(): parser.add_argument("--docker-args", action="store_true") parser.add_argument("--no-pdks", action="store_true") parser.add_argument("--docker-tag-for-os", default=None) + parser.add_argument("--docker-arch", default=None) parser.add_argument("--field", "-f") parser.add_argument("tool") args = parser.parse_args() @@ -135,7 +139,7 @@ def main(): exit(os.EX_DATAERR) if args.docker_tag_for_os: - print(tool.get_docker_tag(for_os=args.docker_tag_for_os)) + print(tool.get_docker_tag(for_os=args.docker_tag_for_os, arch=args.docker_arch)) elif args.docker_args: arg_list = tool.docker_args diff --git a/dependencies/tool_metadata.yml b/dependencies/tool_metadata.yml index 7b1f22c77..02b132873 100644 --- a/dependencies/tool_metadata.yml +++ b/dependencies/tool_metadata.yml @@ -1,17 +1,3 @@ -- name: cugr - repo: https://github.com/ax3ghazy/cu-gr - commit: 1632b4b450cbd3e5b6bdc9bf92c96cadde6a01b9 - build: | - xxd -i src/flute/POST9.dat > src/flute/POST9.c - xxd -i src/flute/POWV9.dat > src/flute/POWV9.c - rm -rf build/ - mkdir -p build/ - cd build - cmake ../src - make clean - make -j$(nproc) - cp iccad19gr $PREFIX/bin/cugr - in_install: false - name: cvc repo: https://github.com/d-m-bailey/cvc commit: d172016a791af3089b28070d80ad92bdfef9c585 @@ -21,24 +7,13 @@ make clean make -j$(nproc) $READLINE_CXXFLAGS make install -- name: drcu - repo: https://github.com/cuhk-eda/dr-cu - commit: 427b4a4f03bb98d8a78b1712fe9e52cfb83a8347 - build: | - rm -rf build/ - mkdir -p build/ - cd build - cmake ../src - make clean - make -j$(nproc) - cp ispd19dr $PREFIX/bin/drcu - in_install: false - name: magic repo: https://github.com/rtimothyedwards/magic commit: a205a0e9419f973346740171618956afe08b2d74 build: | ./configure --prefix=$PREFIX $MAGIC_CONFIG_OPTS make clean + make database/database.h make -j$(nproc) make install - name: netgen @@ -79,7 +54,7 @@ - name: klayout repo: https://github.com/KLayout/klayout commit: 428d0fe8c941faece4eceebc54170cc04d916c03 - build: '' + build: "" in_install: false - name: openroad_app repo: https://github.com/The-OpenROAD-Project/OpenROAD @@ -89,20 +64,20 @@ - name: git repo: https://github.com/git/git commit: e9d7761bb94f20acc98824275e317fa82436c25d - build: '' + build: "" in_install: false - name: open_pdks repo: https://github.com/efabless/open_pdks commit: 41c0908b47130d5675ff8484255b43f66463a7d6 - build: '' + build: "" in_install: false pdk: true dependencies: - - sky130 - - magic + - sky130 + - magic - name: sky130 repo: https://github.com/google/skywater-pdk commit: f70d8ca46961ff92719d8870a18a076370b85f6c - build: '' + build: "" in_install: false in_container: false diff --git a/docker/Makefile b/docker/Makefile index ef35167f4..17c08c8c8 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,34 +1,35 @@ -#DOCKER_BUILD_OPTS ?= --rm --no-cache -OPENLANE_IMAGE_NAME ?= efabless/openlane:current TOOL_REPOSITORY ?= efabless/openlane-tools -OS_NAME ?= centos-7 -OS_IMAGE ?= centos:centos7 +include ../dependencies/image_name.mk -DOCKER_BUILD_OPTS ?= --rm -DOCKER_BUILD_INVOCATION ?= docker build # docker buildx build --platform linux/amd64 --load -BUILD_COMMAND = $(DOCKER_BUILD_INVOCATION) $(DOCKER_BUILD_OPTS) - -NO_PDKS_ARGS = -NO_PDKS ?= 1 -ifeq ($(NO_PDKS), 1) -NO_PDKS_ARGS = --no-pdks -endif +BASE_HASH = $(shell $(PYTHON_BIN) ../dependencies/hash_for.py $(OS_NAME)) PYTHON_BIN ?= python3 -TOOLS = $(shell $(PYTHON_BIN) ../dependencies/tool.py --containerized $(NO_PDKS_ARGS) .) + +OS_NAME := centos-7 +OS_IMAGE := centos:centos7 +BASE_HASH := $(shell $(PYTHON_BIN) ../dependencies/hash_for.py $(OS_NAME)) +BUILD_ARCH ?= $(shell $(PYTHON_BIN) ./utils.py current-docker-platform) + +export BUILD_BASE_TAG := build-base-$(BASE_HASH)-$(OS_NAME)-$(BUILD_ARCH) +export RUN_BASE_TAG := run-base-$(BASE_HASH)-$(OS_NAME)-$(BUILD_ARCH) +BUILD_BASE_IMAGE := $(TOOL_REPOSITORY):$(BUILD_BASE_TAG) +RUN_BASE_IMAGE := $(TOOL_REPOSITORY):$(RUN_BASE_TAG) + +# To use buildx: docker buildx build --push +export BUILD_COMMAND ?= docker build --no-cache + +TOOLS = $(shell $(PYTHON_BIN) ../dependencies/tool.py --containerized --no-pdks .) OPENLANE_SKELETON=configuration dependencies designs regression_results scripts AUTHORS.md env.py flow.tcl LICENSE run_designs.py TOOL_BUILD_TARGETS = $(foreach tool,$(TOOLS),build-$(tool)) TOOL_EXPORT_TARGETS = $(foreach tool,$(TOOLS),pull-$(tool)) -# ============================================================================== -# Build Tools -# ============================================================================== all: openlane +# Build/Run Base Images build-all: $(TOOL_BUILD_TARGETS) -build_base_image: ./build_base/Dockerfile +build-build-base: ./build_base/Dockerfile cat ../dependencies/centos-7/precompile_time.txt > ./build_base/yum_precompile_dependencies.txt cat ../dependencies/centos-7/compile_time.txt > ./build_base/yum_compile_dependencies.txt cat ../dependencies/centos-7/run_time.txt > ./build_base/yum_dependencies.txt @@ -36,53 +37,71 @@ build_base_image: ./build_base/Dockerfile cat ../dependencies/python/compile_time.txt > ./build_base/pip_compile_dependencies.txt cat ../dependencies/python/run_time.txt > ./build_base/pip_dependencies.txt mkdir -p logs - $(BUILD_COMMAND) -t openlane-build-base --build-arg OS_IMAGE=$(OS_IMAGE) build_base | tee logs/base.build.txt + $(BUILD_COMMAND)\ + --build-arg OS_IMAGE=$(BUILD_ARCH)/$(OS_IMAGE)\ + -t $(BUILD_BASE_IMAGE)\ + build_base | tee logs/base.build.txt -run_base_image: ./run_base/Dockerfile +pull-build-base: + $(PYTHON_BIN) ./utils.py pull-if-doesnt-exist --repository $(TOOL_REPOSITORY) --os $(OS_NAME) --architecture $(BUILD_ARCH) build-base + @echo "-----------" + +build-run-base: ./run_base/Dockerfile cat ../dependencies/python/run_time.txt > ./run_base/pip_dependencies.txt cat ../dependencies/centos-7/precompile_time.txt > ./run_base/yum_repos.txt cat ../dependencies/centos-7/run_time.txt > ./run_base/yum_dependencies.txt mkdir -p logs - $(BUILD_COMMAND) -t openlane-run-base --build-arg OS_IMAGE=$(OS_IMAGE) run_base | tee logs/base.run.txt + $(BUILD_COMMAND)\ + --build-arg OS_IMAGE=$(BUILD_ARCH)/$(OS_IMAGE)\ + -t $(RUN_BASE_IMAGE)\ + run_base | tee logs/base.run.txt +pull-run-base: + $(PYTHON_BIN) ./utils.py pull-if-doesnt-exist --repository $(TOOL_REPOSITORY) --os $(OS_NAME) --architecture $(BUILD_ARCH) run-base + @echo "-----------" -$(TOOL_BUILD_TARGETS): build-% : ./%/Dockerfile build_base_image run_base_image +# Tool Images +$(TOOL_BUILD_TARGETS): build-% : ./%/Dockerfile pull-build-base mkdir -p logs cp ./utils.py $* $(BUILD_COMMAND)\ - $(shell $(PYTHON_BIN) ../dependencies/tool.py --docker-args $*)\ + `$(PYTHON_BIN) ../dependencies/tool.py --docker-args $*`\ + --build-arg RUN_BASE_IMAGE=$(RUN_BASE_IMAGE)\ + --build-arg BUILD_BASE_IMAGE=$(BUILD_BASE_IMAGE)\ --target runnable\ - -t $(TOOL_REPOSITORY):$(shell $(PYTHON_BIN) ../dependencies/tool.py --docker-tag-for-os=$(OS_NAME) $*)\ + -t $(TOOL_REPOSITORY):`$(PYTHON_BIN) ../dependencies/tool.py --docker-tag-for-os=$(OS_NAME) --docker-arch=$(BUILD_ARCH) $*`\ $* |\ tee logs/$*.build.txt -# ============================================================================== -# Export Tools -# ============================================================================== $(TOOL_EXPORT_TARGETS): pull-% : FORCE - $(PYTHON_BIN) ./utils.py pull-if-doesnt-exist --repository $(TOOL_REPOSITORY) --os $(OS_NAME) $* + $(PYTHON_BIN) ./utils.py pull-if-doesnt-exist --repository $(TOOL_REPOSITORY) --os $(OS_NAME) --architecture $(BUILD_ARCH) $* + @echo "-----------" +# OpenLane Image ./tar/openlane: FORCE rm -rf ./tar/openlane mkdir -p ./tar/openlane - for file in $(OPENLANE_SKELETON); do \ - cp -r ../$$file ./tar/openlane/$$file ; \ + for file in $(OPENLANE_SKELETON); do\ + cp -r ../$$file ./tar/openlane/$$file ;\ done .PHONY: merge openlane openlane: merge -merge: run_base_image $(TOOL_EXPORT_TARGETS) ./tar/openlane ../dependencies/tool_metadata.yml +merge: pull-run-base $(TOOL_EXPORT_TARGETS) ./tar/openlane ../dependencies/tool_metadata.yml cat ../dependencies/tool_metadata.yml > ./tar/tool_metadata.yml printf "$(shell git rev-parse HEAD)" > ./tar/git_version printf "$(shell git rev-parse --short=7 HEAD)" > ./tar/git_version_short $(PYTHON_BIN) ./utils.py process-dockerfile-tpl --repository $(TOOL_REPOSITORY) --os $(OS_NAME) $(TOOLS) > ./openlane/Dockerfile mkdir -p logs/tar $(BUILD_COMMAND)\ - -t $(OPENLANE_IMAGE_NAME)\ + --build-arg ARCH=$(BUILD_ARCH)\ + --build-arg RUN_BASE_IMAGE=$(RUN_BASE_IMAGE)\ + -t $(OPENLANE_IMAGE_NAME)-$(BUILD_ARCH)\ -f ./openlane/Dockerfile ./tar\ | tee logs/$<.build.txt rm -rf ./tar/openlane +# Cleanup .PHONY: clean clean: clean_export clean_merge diff --git a/docker/README.md b/docker/README.md index cd969f704..693d24827 100644 --- a/docker/README.md +++ b/docker/README.md @@ -11,14 +11,12 @@ The run family has a base image that contains all the running dependencies. Ther ``` openlane-build-base -L cugr **builder** L cvc **builder** L openroad_app **builder** L [...] openlane-run-base L openlane -L cugr **runnable** L cvc **runnable** L openroad_app **runnable** ``` diff --git a/docker/build_base/Dockerfile b/docker/build_base/Dockerfile index 6661a0284..709716034 100644 --- a/docker/build_base/Dockerfile +++ b/docker/build_base/Dockerfile @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -ARG OS_IMAGE="centos:centos7" +ARG OS_IMAGE= FROM ${OS_IMAGE} # Install Yum Dependencies diff --git a/docker/cugr/Dockerfile b/docker/cugr/Dockerfile deleted file mode 100644 index f0458198b..000000000 --- a/docker/cugr/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2020-2021 Efabless Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -FROM openlane-build-base AS builder - -# Installing boost for build dependency -RUN curl -L https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download | tar --strip-components=1 -xjC . && \ - ./bootstrap.sh && \ - ./b2 install --with-iostreams --with-test --with-serialization --with-system --with-filesystem --with-thread --with-program_options -j $(nproc) - -# needed to get the xxd binaries needed to package the *.dat files -# into C arrays to be linked directly into the executable -RUN yum -y install vim-common - -ARG CUGR_REPO -ARG CUGR_COMMIT - -WORKDIR /cugr -RUN curl -L ${CUGR_REPO}/tarball/${CUGR_COMMIT} | tar -xzC . --strip-components=1 - -RUN python scripts/build.py -o release -t iccad19gr - -RUN mkdir -p /build/bin/ && \ - cp run/iccad19gr /build/bin/cugr - -RUN mkdir -p /build/version -RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/cugr.version -RUN echo ${CUGR_COMMIT} >> /build/version/cugr.version -RUN tar -czf /build.tar.gz /build - -# --- -FROM openlane-run-base AS runnable - -ENV PATH /build/bin:$PATH - -COPY --from=builder /build /build -COPY --from=builder /build.tar.gz /build.tar.gz diff --git a/docker/cvc/Dockerfile b/docker/cvc/Dockerfile index 4dcdcf548..0bb781a4b 100644 --- a/docker/cvc/Dockerfile +++ b/docker/cvc/Dockerfile @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder ARG CVC_REPO ARG CVC_COMMIT @@ -31,8 +33,7 @@ RUN echo ${CVC_COMMIT} >> /build/version/cvc.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/drcu/Dockerfile b/docker/drcu/Dockerfile deleted file mode 100644 index 9ff2d47d1..000000000 --- a/docker/drcu/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2020-2021 Efabless Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -FROM openlane-build-base AS builder - -# Installing boost for build dependency -RUN curl -L https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download | tar --strip-components=1 -xjC . && \ - ./bootstrap.sh && \ - ./b2 install --with-iostreams --with-test --with-serialization --with-system --with-filesystem --with-thread --with-program_options link=static -j $(nproc) - -# needed to get the xxd binaries needed to package the *.dat files -# into C arrays to be linked directly into the executable -RUN yum -y install vim-common - -ARG DRCU_REPO -ARG DRCU_COMMIT - -WORKDIR /drcu -RUN curl -L ${DRCU_REPO}/tarball/${DRCU_COMMIT} | tar -xzC . --strip-components=1 - -RUN python scripts/build.py -o release -t ispd19dr - -RUN mkdir -p /build/bin/ && \ - cp run/ispd19dr /build/bin/drcu - -RUN mkdir -p /build/version -RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/drcu.version -RUN echo ${DRCU_COMMIT} >> /build/version/drcu.version -RUN tar -czf /build.tar.gz /build - -# --- -FROM openlane-run-base AS runnable - -ENV PATH /build/bin:$PATH - -COPY --from=builder /build /build -COPY --from=builder /build.tar.gz /build.tar.gz diff --git a/docker/git/Dockerfile b/docker/git/Dockerfile index 25c7278bf..59cab5882 100644 --- a/docker/git/Dockerfile +++ b/docker/git/Dockerfile @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder ARG GIT_REPO ARG GIT_COMMIT @@ -30,8 +32,7 @@ RUN echo ${GIT_COMMIT} >> /build/version/git.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/klayout/Dockerfile b/docker/klayout/Dockerfile index b3e4aca69..8eb629439 100644 --- a/docker/klayout/Dockerfile +++ b/docker/klayout/Dockerfile @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder # git clone yosys ARG KLAYOUT_REPO @@ -36,8 +38,7 @@ RUN echo ${KLAYOUT_COMMIT} >> /build/version/klayout.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/magic/Dockerfile b/docker/magic/Dockerfile index a791fd23a..293ab4051 100644 --- a/docker/magic/Dockerfile +++ b/docker/magic/Dockerfile @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder # Upstream is git://opencircuitdesign.com/magic, but servers are not stable enough for CI. ARG MAGIC_REPO @@ -29,8 +31,7 @@ RUN echo ${MAGIC_COMMIT} >> /build/version/magic.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/netgen/Dockerfile b/docker/netgen/Dockerfile index a8fa2399a..51014a245 100644 --- a/docker/netgen/Dockerfile +++ b/docker/netgen/Dockerfile @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder # Upstream is git://opencircuitdesign.com/netgen, but servers are not stable enough for CI. ARG NETGEN_REPO @@ -29,8 +31,7 @@ RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/netgen.version RUN echo ${NETGEN_COMMIT} >> /build/version/netgen.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/open_pdks/Dockerfile b/docker/open_pdks/Dockerfile index c4b65f62f..ab9187d9a 100644 --- a/docker/open_pdks/Dockerfile +++ b/docker/open_pdks/Dockerfile @@ -14,7 +14,9 @@ # WIP, probably will never make it to the image because it's taking forever to build -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder ARG SKY130_REPO ARG SKY130_COMMIT @@ -95,7 +97,7 @@ RUN tar -c /build | gzip -1 > /build.tar.gz # --- # pdk can't really be runnable, might as well shed a few layers -FROM centos:centos7 as runnable +FROM centos:centos7 AS runnable COPY --from=builder /build.tar.gz /build.tar.gz diff --git a/docker/openlane/Dockerfile.tpl b/docker/openlane/Dockerfile.tpl index e41573000..2d26efc80 100644 --- a/docker/openlane/Dockerfile.tpl +++ b/docker/openlane/Dockerfile.tpl @@ -12,8 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +ARG ARCH= +ARG RUN_BASE_IMAGE= # -FROM openlane-run-base +FROM ${RUN_BASE_IMAGE} # Environment Configuration ENV OPENLANE_ROOT=/openlane @@ -23,13 +25,16 @@ ENV OPENROAD=/build/ ENV PATH=$OPENLANE_ROOT:$OPENLANE_ROOT/scripts:$OPENROAD/bin:$OPENROAD/bin/Linux-x86_64:$OPENROAD/pdn/scripts:$PATH ENV LD_LIBRARY_PATH=$OPENROAD/lib:$OPENROAD/lib/Linux-x86_64:$LD_LIBRARY_PATH ENV MANPATH=$OPENROAD/share/man:$MANPATH +ENV PDK_ROOT /build/pdk + +# Locale +RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 ENV LC_CTYPE en_US.UTF-8 -ENV PDK_ROOT /build/pdk # Tools -## Qt Thing +## Graphical Applications RUN dbus-uuidgen --ensure ## Copy manifest @@ -39,7 +44,7 @@ ADD ./tool_metadata.yml /tool_metadata.yml ADD ./git_version /git_version ADD ./git_version_short /git_version_short -## Artifacts +## Scripts and Binaries COPY ./openlane /openlane # diff --git a/docker/openroad_app/Dockerfile b/docker/openroad_app/Dockerfile index 59d738aa1..552267542 100644 --- a/docker/openroad_app/Dockerfile +++ b/docker/openroad_app/Dockerfile @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder # Build Boost WORKDIR /boost @@ -52,13 +54,15 @@ RUN curl -L https://github.com/swig/swig/archive/refs/tags/v4.0.1.tar.gz | tar - make -j $(nproc) && \ make install -ARG OPENROAD_APP_REPO -ARG OPENROAD_APP_COMMIT - +# Set up OpenROAD Build Files +RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 ENV LC_CTYPE en_US.UTF-8 +ARG OPENROAD_APP_REPO +ARG OPENROAD_APP_COMMIT + WORKDIR /openroad RUN curl -L ${OPENROAD_APP_REPO}/tarball/${OPENROAD_APP_COMMIT} | tar -xzC . --strip-components=1 COPY ./utils.py . @@ -66,6 +70,7 @@ RUN python3 ./utils.py fetch-submodules-from-tarballs ${OPENROAD_APP_REPO} ${OPE # Build OpenROAD RUN sed -i "s/GITDIR-NOTFOUND/${OPENROAD_APP_COMMIT}/" cmake/GetGitRevisionDescription.cmake +RUN sed -i "s/static char Cases/static signed char Cases/" third-party/abc/src/misc/extra/extraUtilMisc.c RUN mkdir build && mkdir -p /build/version && mkdir install RUN cd build && cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install .. RUN cd build && make -j$(nproc) @@ -77,8 +82,7 @@ RUN echo ${OPENROAD_APP_COMMIT} >> /build/version/openroad.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/padring/Dockerfile b/docker/padring/Dockerfile index fdbd0d91b..6758dcd9a 100644 --- a/docker/padring/Dockerfile +++ b/docker/padring/Dockerfile @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder ARG PADRING_REPO ARG PADRING_COMMIT @@ -30,8 +32,8 @@ RUN echo ${PADRING_COMMIT} >> /build/version/padring.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +ARG RUN_BASE_IMAGE= +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/run_base/Dockerfile b/docker/run_base/Dockerfile index 1accf5e47..458772403 100644 --- a/docker/run_base/Dockerfile +++ b/docker/run_base/Dockerfile @@ -11,9 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - -ARG OS_IMAGE="centos:centos7" +ARG OS_IMAGE= FROM ${OS_IMAGE} # Install Yum Dependencies diff --git a/docker/utils.py b/docker/utils.py index 31ec5da61..33d2208ec 100644 --- a/docker/utils.py +++ b/docker/utils.py @@ -20,7 +20,44 @@ import pathlib import tempfile import subprocess +import urllib.error import urllib.parse +import urllib.request + +SUPPORTED_ARCHITECTURES = {"amd64", "arm64v8", "ppc64le"} +CI_ARCHITECTURES = {"amd64", "arm64v8"} +SUPPORTED_OPERATING_SYSTEMS = {"centos-7"} + + +def current_docker_platform() -> str: + import platform + + arch = platform.machine() + + if arch in ["x86_64", "amd64"]: + return "amd64" + elif arch in ["aarch64", "arm64"]: + return "arm64v8" + elif arch in ["ppc64le"]: + return "ppc64le" + else: + print( + f"Unsupported architecture '{platform.machine()}' Falling back to x86-64 for Docker.", + file=sys.stderr, + ) + return "amd64" + + +def test_manifest_exists(repository, tag) -> str: + url = f"https://index.docker.io/v1/repositories/{repository}/tags/{tag}" + req = urllib.request.Request(url, headers={"Accept": "application/json"}) + status = None + try: + with urllib.request.urlopen(req) as res: + status = int(res.status) + except urllib.error.HTTPError as e: + status = int(e.code) + return status is not None and status >= 200 and status < 300 @click.group() @@ -29,24 +66,54 @@ def cli(): @click.command() -@click.option("-r", "--repository", required=True) +@click.option("-R", "--registry", default="docker.io") +@click.option("-r", "--repository", default="efabless/openlane-tools") @click.option( - "-o", "--os", "operating_system", required=True, type=click.Choice(["centos-7"]) + "-o", + "--os", + "operating_system", + required=True, + type=click.Choice(SUPPORTED_OPERATING_SYSTEMS), +) +@click.option( + "-m", + "--architecture", + required=True, + type=click.Choice(SUPPORTED_ARCHITECTURES), ) @click.argument("tool") -def pull_if_doesnt_exist(repository, operating_system, tool): - image_tag = ( - subprocess.check_output( - [ - "python3", - "../dependencies/tool.py", - f"--docker-tag-for-os={operating_system}", - tool, - ] +def pull_if_doesnt_exist(registry, repository, operating_system, architecture, tool): + """ + Requires *actual* Docker. Podman won't cut it. + """ + + def get_tag_for(os, arch=None): + return ( + subprocess.check_output( + [ + "python3", + "../dependencies/tool.py", + tool, + f"--docker-tag-for-os={os}", + ] + + ([f"--docker-arch={arch}"] if arch is not None else []) + ) + .decode("utf8") + .rstrip() ) - .decode("utf8") - .rstrip() - ) + + image_tag = None + skip_manifest = None + if tool == "build-base": + image_tag = os.getenv("BUILD_BASE_TAG") + skip_manifest = True + elif tool == "run-base": + image_tag = os.getenv("RUN_BASE_TAG") + skip_manifest = True + else: + image_tag = get_tag_for(operating_system, architecture) + skip_manifest = False + image = f"{repository}:{image_tag}" images = ( subprocess.check_output(["docker", "images", image]) @@ -54,22 +121,65 @@ def pull_if_doesnt_exist(repository, operating_system, tool): .rstrip() .split("\n")[1:] ) - if len(images) < 1: - print(f"{image} not found, pulling...") - try: - subprocess.check_call(["docker", "pull", image]) - print(f"Pulled {image}.") - except Exception as e: - if os.getenv("BUILD_IF_CANT_PULL") == "1": - print(f"{image} not found in the repository, building...") - subprocess.check_call(["make", f"build-{tool}"]) - print(f"Built {image}.") - if os.getenv("BUILD_IF_CANT_PULL_THEN_PUSH") == "1": - print(f"Pushing {image} to the container repository...") - subprocess.check_call(["docker", "push", image]) - print(f"Pushed {image}.") - else: - raise e + if len(images) >= 1: + print(f"[*] Found {image}.") + return + + print(f"[*] {image} not found, pulling...") + + if test_manifest_exists(repository, image_tag): + subprocess.call(["docker", "pull", image]) + print(f"[*] Pulled {image}.") + else: + if os.getenv("BUILD_IF_CANT_PULL") != "1": + print(f"[*] {image} not found in the repository.") + exit(os.EX_UNAVAILABLE) + else: + print(f"[*] {image} not found in the repository, building...") + env = os.environ.copy() + env["BUILD_ARCH"] = architecture + subprocess.check_call(["make", f"build-{tool}"], env=env) + print(f"Built {image}.") + + if os.getenv("BUILD_IF_CANT_PULL_THEN_PUSH") != "1": + return + + # Not needed for buildx, but won't hurt + print(f"[*] Pushing {image} to the container repository...") + subprocess.check_call(["docker", "push", image]) + print(f"[*] Pushed {image}.") + + if skip_manifest: + return + + manifest_tag = get_tag_for(operating_system) + manifest_name = f"{repository}:{manifest_tag}" + + print(f"[*] Trying to create multi-arch manifest {manifest_name}...") + arch_images = [] + for arch in CI_ARCHITECTURES: + print(f"[*] Verifying if the image for {arch} has been pushed...") + arch_image_tag = get_tag_for(operating_system, arch) + arch_image = f"{repository}:{arch_image_tag}" + if not test_manifest_exists(repository, arch_image_tag): + print(f"[*] {arch_image} not yet pushed. Aborting multi-arch manifest.") + exit(os.EX_OK) + arch_images.append(arch_image) + + print("[*] All images verified, creating and pushing manifest...") + + subprocess.call(["docker", "manifest", "rm", manifest_name]) + subprocess.check_call(["docker", "manifest", "create", manifest_name, *arch_images]) + subprocess.check_call( + [ + "docker", + "manifest", + "push", + manifest_name, + ] + ) + + print("[*] Done.") cli.add_command(pull_if_doesnt_exist) @@ -78,7 +188,11 @@ def pull_if_doesnt_exist(repository, operating_system, tool): @click.command() @click.option("-r", "--repository", required=True) @click.option( - "-o", "--os", "operating_system", required=True, type=click.Choice(["centos-7"]) + "-o", + "--os", + "operating_system", + required=True, + type=click.Choice(SUPPORTED_OPERATING_SYSTEMS), ) @click.argument("tools", nargs=-1) def process_dockerfile_tpl(repository, operating_system, tools): @@ -100,7 +214,9 @@ def process_dockerfile_tpl(repository, operating_system, tools): image_names = [f"{repository}:{tag}" for tag in image_tags] - from_lines = [f"FROM {name} as container{i}" for i, name in enumerate(image_names)] + from_lines = [ + f"FROM {name}-${{ARCH}} as container{i}" for i, name in enumerate(image_names) + ] copy_lines = [ f"COPY --from=container{i} /build /build" for i, _ in enumerate(image_names) @@ -243,5 +359,13 @@ def fetch_submodules_from_tarballs(filter, repository, commit): cli.add_command(fetch_submodules_from_tarballs) + +@click.command("current-docker-platform") +def current_docker_platform_cmd(): + print(current_docker_platform(), end="") + + +cli.add_command(current_docker_platform_cmd) + if __name__ == "__main__": cli() diff --git a/docker/vlogtoverilog/Dockerfile b/docker/vlogtoverilog/Dockerfile index 01feb0417..eca1e4ff3 100644 --- a/docker/vlogtoverilog/Dockerfile +++ b/docker/vlogtoverilog/Dockerfile @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder ARG VLOGTOVERILOG_REPO ARG VLOGTOVERILOG_COMMIT @@ -30,8 +32,7 @@ RUN echo ${VLOGTOVERILOG_COMMIT} >> /build/version/vlog2Verilog.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docker/yosys/Dockerfile b/docker/yosys/Dockerfile index 5f5c9dce5..c5f76c62a 100644 --- a/docker/yosys/Dockerfile +++ b/docker/yosys/Dockerfile @@ -13,7 +13,9 @@ # limitations under the License. # syntax = docker/dockerfile:1.0-experimental -FROM openlane-build-base AS builder +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +FROM ${BUILD_BASE_IMAGE} AS builder # git clone yosys ARG YOSYS_REPO @@ -32,8 +34,7 @@ RUN echo ${YOSYS_COMMIT} >> /build/version/yosys.version RUN tar -czf /build.tar.gz /build # --- -FROM openlane-run-base AS runnable - +FROM ${RUN_BASE_IMAGE} AS runnable ENV PATH /build/bin:$PATH COPY --from=builder /build /build diff --git a/docs/source/openlane_commands.md b/docs/source/openlane_commands.md index 7a49df617..57fbb8662 100644 --- a/docs/source/openlane_commands.md +++ b/docs/source/openlane_commands.md @@ -240,15 +240,15 @@ Most of the following commands' implementation exists in this [file][8] | Command | Flags | Description | |---------------|------------------------|-----------------------------------------| -| `global_routing` | | Runs global routing on the processed design using either the openroad app's fastroute or cugr based on the value of `GLOBAL_ROUTER`. The resulting file is under `//tmp/routing/` . | +| `global_routing` | | Runs global routing on the processed design The resulting file is under `//tmp/routing/` . | | `global_routing_fastroute` | | Runs global routing on the processed design using the openroad app's fastroute. The resulting file is under `//tmp/routing/` . | -| `global_routing_cugr` | | Runs global routing on the processed design using cugr. The resulting file is under `//tmp/routing/` . | | `detailed_routing` | | Runs detailed routing on the processed design using OpenROAD TritonRoute, or DRCU based onthe value of `DETAILED_ROUTER`. The resulting file is under `//results/routing/` . | | `detailed_routing_tritonroute` | | Runs detailed routing on the processed design using OpenROAD TritonRoute based on the value of `DETAILED_ROUTER`. The resulting file is under `//results/routing/` . | -| `detailed_routing_drcu` | | Runs detailed routing on the processed design using DRCU. The resulting file is under `//results/routing/` . | | `apply_route_obs`| | Uses `GLB_RT_OBS` to insert obstruction for each macro in order to prevent routing for each specified layer on each macro. Check `GLB_RT_OBS` in the configurations documentation for more details.| | `add_route_obs`| | Uses `GLB_RT_OBS` to call `apply_route_obs`, then calls `apply_route_obs` again to apply obstructions over the whole die area based on the value of `GLB_RT_MAXLAYER` up to the highest available metal layer.| | `run_routing` | | Runs diode insertion based on the strategy, then adds the routing obstructions, followed by `global_routing`, then `ins_fill_cells`, `detailed_routing`, and finally SPEF extraction on the processed design. The resulting file is under `//results/routing/`. It also generates a pre_route netlist using yosys and stores the results under `//results/synthesis`, and it runs yosys logic verification if enabled. | +| `global_routing_cugr` | | **Removed: Aliases global_routing_fastroute**: Runs global routing on the processed design using cugr. The resulting file is under `//tmp/routing/` . | +| `detailed_routing_drcu` | | **Removed: Aliases detailed_routing_tritonroute** Runs detailed routing on the processed design using DRCU. The resulting file is under `//results/routing/` . | ## Magic Commands diff --git a/requirements_dev.txt b/requirements_dev.txt index 13504bc8d..74c42bdd7 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,3 @@ --r ./dependencies/requirements_lint.txt --r ./dependencies/python/precompile_time.txt -r ./dependencies/python/compile_time.txt -r ./requirements.txt +-r ./requirements_lint.txt \ No newline at end of file diff --git a/run_designs.py b/run_designs.py index 43cb869eb..1dc47b1b5 100755 --- a/run_designs.py +++ b/run_designs.py @@ -155,26 +155,19 @@ def cli( store_dir = "" report_file_name = "" if enable_timestamp: - store_dir = "./regression_results/{tag}_{date}/".format( - tag=tag, date=datetime.datetime.now().strftime("%d_%m_%Y_%H_%M") - ) - report_file_name = "{store_dir}/{tag}_{date}".format( - store_dir=store_dir, - tag=tag, - date=datetime.datetime.now().strftime("%d_%m_%Y_%H_%M"), - ) + timestamp = datetime.datetime.now().strftime("%d_%m_%Y_%H_%M") + store_dir = f"./regression_results/{tag}_{timestamp}" + report_file_name = f"{store_dir}/{tag}_{timestamp}" else: - store_dir = "./regression_results/{tag}/".format(tag=tag) - report_file_name = "{store_dir}/{tag}".format(store_dir=store_dir, tag=tag) + store_dir = f"./regression_results/{tag}" + report_file_name = f"{store_dir}/{tag}" if not os.path.exists(store_dir): os.makedirs(store_dir, exist_ok=True) log = logging.getLogger("log") log_formatter = logging.Formatter("[%(asctime)s - %(levelname)5s] %(message)s") - handler1 = logging.FileHandler( - "{report_file_name}.log".format(report_file_name=report_file_name), "w" - ) + handler1 = logging.FileHandler(f"{report_file_name}.log", "w") handler1.setFormatter(log_formatter) log.addHandler(handler1) handler2 = logging.StreamHandler() @@ -184,9 +177,7 @@ def cli( report_log = logging.getLogger("report_log") report_formatter = logging.Formatter("%(message)s") - report_handler = logging.FileHandler( - "{report_file_name}.csv".format(report_file_name=report_file_name), "w" - ) + report_handler = logging.FileHandler(f"{report_file_name}.csv", "w") report_handler.setFormatter(report_formatter) report_log.addHandler(report_handler) report_log.setLevel(logging.INFO) @@ -373,7 +364,7 @@ def run_design(designs_queue): if design in rem_designs.keys(): rem_designs.pop(design) continue - default_config_tag = "config_{tag}".format(tag=tag) + default_config_tag = f"config_{tag}" err, design_name = utils.get_design_name(design, config) if err is not None: update("ERROR", design, f"Cannot run: {err}") diff --git a/scripts/tcl_commands/routing.tcl b/scripts/tcl_commands/routing.tcl index 59aa271ad..0fd4bc7b1 100755 --- a/scripts/tcl_commands/routing.tcl +++ b/scripts/tcl_commands/routing.tcl @@ -47,21 +47,6 @@ proc translate_min_max_layer_variables {args} { } } -proc global_routing_cugr {args} { - if { $::env(DIODE_INSERTION_STRATEGY) == 3 } { - puts_err "DIODE_INSERTION_STRATEGY 3 is only valid when OpenROAD is used for global routing." - puts_err "Please try a different strategy." - return -code error - } - try_catch cugr \ - -lef $::env(MERGED_LEF_UNPADDED) \ - -def $::env(CURRENT_DEF) \ - -output $::env(SAVE_GUIDE) \ - -threads $::env(ROUTING_CORES) \ - |& tee $::env(TERMINAL_OUTPUT) [index_file $::env(routing_logs)/global.log] - file copy -force $::env(CURRENT_DEF) $::env(SAVE_DEF) -} - proc groute_antenna_extract {args} { set options { {-from_log required} @@ -127,6 +112,10 @@ proc global_routing_fastroute {args} { } } +proc global_routing_cugr {args} { + handle_deprecated_command global_routing_fastroute +} + proc global_routing {args} { increment_index TIMER::timer_start @@ -136,12 +125,12 @@ proc global_routing {args} { set tool "openroad" if { $::env(GLOBAL_ROUTER) == "cugr" } { - set tool "cugr" - global_routing_cugr - } else { - global_routing_fastroute + puts_warn "CU-GR is no longer supported. OpenROAD fastroute will be used instead." + set ::env(GLOBAL_ROUTER) "fastroute" } + global_routing_fastroute + set_def $::env(SAVE_DEF) set_guide $::env(SAVE_GUIDE) @@ -166,14 +155,7 @@ proc detailed_routing_tritonroute {args} { } proc detailed_routing_drcu {args} { - try_catch drcu \ - -lef $::env(MERGED_LEF_UNPADDED) \ - -def $::env(CURRENT_DEF) \ - -guide $::env(CURRENT_GUIDE) \ - -threads $::env(ROUTING_CORES) \ - -tat 99999999 \ - -output $::env(routing_results)/$::env(DESIGN_NAME).def \ - |& tee $::env(TERMINAL_OUTPUT) [index_file $::env(routing_logs)/detailed.log] + handle_deprecated_command detailed_routing_tritonroute } proc detailed_routing {args} { @@ -189,11 +171,11 @@ proc detailed_routing {args} { set tool "openroad" if {$::env(RUN_ROUTING_DETAILED)} { if { $::env(DETAILED_ROUTER) == "drcu" } { - set tool "drcu" - detailed_routing_drcu - } else { - detailed_routing_tritonroute + puts_warn "DR-CU is no longer supported. OpenROAD tritonroute will be used instead." + set ::env(DETAILED_ROUTER) "tritonroute" } + detailed_routing_tritonroute + } else { exec echo "SKIPPED!" >> [index_file $::env(routing_logs)/detailed.log] } diff --git a/tests/912/config.tcl b/tests/912/config.tcl deleted file mode 120000 index bdeb9e033..000000000 --- a/tests/912/config.tcl +++ /dev/null @@ -1 +0,0 @@ -../892/config.tcl \ No newline at end of file diff --git a/tests/912/config.tcl b/tests/912/config.tcl new file mode 100755 index 000000000..97da78251 --- /dev/null +++ b/tests/912/config.tcl @@ -0,0 +1,22 @@ +# User config +set ::env(DESIGN_NAME) def_test + +# Change if needed +set ::env(VERILOG_FILES) [glob $::env(DESIGN_DIR)/src/*.v] + +# turn off clock +set ::env(CLOCK_TREE_SYNTH) 0 +set ::env(CLOCK_PORT) "" + +set ::env(PL_RANDOM_GLB_PLACEMENT) 1 + +set ::env(FP_DEF_TEMPLATE) $::env(DESIGN_DIR)/def_test.def + +set ::env(FP_SIZING) absolute +set ::env(DIE_AREA) "0 0 300 300" +set ::env(PL_TARGET_DENSITY) 0.75 + +set ::env(FP_PDN_HORIZONTAL_HALO) 6 +set ::env(FP_PDN_VERTICAL_HALO) $::env(FP_PDN_HORIZONTAL_HALO) + +set ::env(DIODE_INSERTION_STRATEGY) 3 \ No newline at end of file