agorararmard | b5367e2 | 2021-04-05 19:12:07 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # SPDX-FileCopyrightText: 2020 Efabless Corporation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # SPDX-License-Identifier: Apache-2.0 |
| 16 | export RUN_ROOT=$(pwd) |
| 17 | |
| 18 | |
| 19 | # By default skip timing since we don't need the libs in any of the CI tests |
| 20 | export SKIP_TIMING=${1:-1} |
| 21 | export OPENLANE_TAG=rc7 |
| 22 | export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG |
| 23 | docker pull $IMAGE_NAME |
| 24 | |
| 25 | cd $RUN_ROOT/.. |
| 26 | export PDK_ROOT=$(pwd)/pdks |
| 27 | mkdir $PDK_ROOT |
| 28 | echo $PDK_ROOT |
| 29 | echo $RUN_ROOT |
| 30 | cd $RUN_ROOT |
| 31 | make skywater-pdk |
| 32 | make skywater-library |
| 33 | # The following section is for running on the CI. |
| 34 | # If you're running locally you should replace them with: `make skywater-library` |
| 35 | # This is because sometimes while setting up the conda env (skywater's make timing) it fails to fetch something |
| 36 | # Then it exits without retrying. So, here we're retrying, and if something goes wrong it will exit after 5 retries. |
| 37 | # Section Begin |
| 38 | if [ $SKIP_TIMING -eq 0 ]; then |
| 39 | cnt=0 |
| 40 | until make skywater-timing; do |
| 41 | cnt=$((cnt+1)) |
| 42 | if [ $cnt -eq 5 ]; then |
| 43 | exit 2 |
| 44 | fi |
| 45 | rm -rf $PDK_ROOT/skywater-pdk |
| 46 | make skywater-pdk |
| 47 | make skywater-library |
| 48 | done |
| 49 | fi |
| 50 | # Section End |
| 51 | |
| 52 | make open_pdks |
| 53 | docker run -v $RUN_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "make build-pdk" |
| 54 | echo "done installing" |
| 55 | echo "Delete docker image:" |
| 56 | docker rmi $IMAGE_NAME |
| 57 | echo "Cleaning up PDK installation directory" |
| 58 | rm -rf $PDK_ROOT/skywater-pdk/ |
| 59 | rm -rf $PDK_ROOT/open_pdks/ |
| 60 | cd $RUN_ROOT |
| 61 | exit 0 |