blob: 489b314cbd4018a974d5d00c81772f7ffc827367 [file] [log] [blame]
manarabdelaty71c0e0a2021-04-08 17:03:47 +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 TARGET_PATH=$(pwd)
manarabdelatye542bdf2021-04-20 11:15:40 +020017export CARAVEL_ROOT=$(pwd)/caravel
manarabdelaty71c0e0a2021-04-08 17:03:47 +020018cd ..
19export PDK_ROOT=$(pwd)/precheck_pdks
20cd $TARGET_PATH/open_mpw_precheck/
21
manarabdelatyf09a4cd2021-04-19 20:05:54 +020022docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $CARAVEL_ROOT:$CARAVEL_ROOT -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/open_mpw_precheck:latest bash -c "python3 open_mpw_prechecker.py --drc_only -p $PDK_ROOT -t $TARGET_PATH -c $CARAVEL_ROOT"
manarabdelaty71c0e0a2021-04-08 17:03:47 +020023output=$TARGET_PATH/checks/full_log.log
24
25gzipped_file=$TARGET_PATH/checks/full_log.log.gz
26
27if [[ -f $gzipped_file ]]; then
28 gzip -d $gzipped_file
29fi
30
31grep "Violation Message" $output
32
33cnt=$(grep -c "All Checks PASSED!" $output)
34if ! [[ $cnt ]]; then cnt=0; fi
35if [[ $cnt -eq 1 ]]; then exit 0; fi
36exit 2