blob: 099f447197979bdf7726d139d89e7c69ea1eed13 [file] [log] [blame]
agorararmard99dbc242020-11-23 19:56:38 +02001#!/bin/bash
2# Copyright 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.
15export TARGET_PATH=$(pwd)
agorararmarda30068c2020-12-03 22:11:01 +000016cd ..
agorararmarde5bdef02020-12-03 21:50:21 +000017export PDK_ROOT=$(pwd)/pdks
agorararmarda30068c2020-12-03 22:11:01 +000018cd $TARGET_PATH/open_mpw_precheck/
19
agorararmard8e2f6702020-12-05 00:42:11 +020020docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) open_mpw_prechecker:latest bash -c "python3 open_mpw_prechecker.py -p $PDK_ROOT -t $TARGET_PATH"
agorararmard99dbc242020-11-23 19:56:38 +020021output=$TARGET_PATH/checks/full_log.log
22
agorararmardfc4cabe2020-12-01 18:03:25 +020023gzipped_file=$TARGET_PATH/checks/full_log.log.gz
24
25if [[ -f $gzipped_file ]]; then
26 gzip -d $gzipped_file
27fi
28
agorararmard8e2f6702020-12-05 00:42:11 +020029cnt=$(grep -c -i "DRC violations" $output)
agorararmard99dbc242020-11-23 19:56:38 +020030if ! [[ $cnt ]]; then cnt=0; fi
agorararmard8e2f6702020-12-05 00:42:11 +020031if [[ $cnt -eq 2 ]]; then exit 0; fi
32exit 2