blob: b8f938da52b097731078bb53d848593075cc4a51 [file] [log] [blame]
agorararmardb5367e22021-04-05 19:12:07 +02001#!/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
16export RUN_ROOT=$(pwd)
17
18
19# By default skip timing since we don't need the libs in any of the CI tests
20export SKIP_TIMING=${1:-1}
21export OPENLANE_TAG=rc7
22export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG
23docker pull $IMAGE_NAME
24
25cd $RUN_ROOT/..
26export PDK_ROOT=$(pwd)/pdks
27mkdir $PDK_ROOT
28echo $PDK_ROOT
29echo $RUN_ROOT
30cd $RUN_ROOT
31make skywater-pdk
32make 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
38if [ $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
49fi
50# Section End
51
52make open_pdks
53docker 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"
54echo "done installing"
55echo "Delete docker image:"
56docker rmi $IMAGE_NAME
57echo "Cleaning up PDK installation directory"
58rm -rf $PDK_ROOT/skywater-pdk/
59rm -rf $PDK_ROOT/open_pdks/
60cd $RUN_ROOT
61exit 0