agorararmard | 99dbc24 | 2020-11-23 19:56:38 +0200 | [diff] [blame] | 1 | #!/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. |
| 15 | export TARGET_PATH=$(pwd) |
agorararmard | a30068c | 2020-12-03 22:11:01 +0000 | [diff] [blame] | 16 | cd .. |
agorararmard | e5bdef0 | 2020-12-03 21:50:21 +0000 | [diff] [blame] | 17 | export PDK_ROOT=$(pwd)/pdks |
agorararmard | a30068c | 2020-12-03 22:11:01 +0000 | [diff] [blame] | 18 | cd $TARGET_PATH/open_mpw_precheck/ |
| 19 | |
agorararmard | 8e2f670 | 2020-12-05 00:42:11 +0200 | [diff] [blame] | 20 | docker 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" |
agorararmard | 99dbc24 | 2020-11-23 19:56:38 +0200 | [diff] [blame] | 21 | output=$TARGET_PATH/checks/full_log.log |
| 22 | |
agorararmard | fc4cabe | 2020-12-01 18:03:25 +0200 | [diff] [blame] | 23 | gzipped_file=$TARGET_PATH/checks/full_log.log.gz |
| 24 | |
| 25 | if [[ -f $gzipped_file ]]; then |
| 26 | gzip -d $gzipped_file |
| 27 | fi |
| 28 | |
agorararmard | 8e2f670 | 2020-12-05 00:42:11 +0200 | [diff] [blame] | 29 | cnt=$(grep -c -i "DRC violations" $output) |
agorararmard | 99dbc24 | 2020-11-23 19:56:38 +0200 | [diff] [blame] | 30 | if ! [[ $cnt ]]; then cnt=0; fi |
agorararmard | 8e2f670 | 2020-12-05 00:42:11 +0200 | [diff] [blame] | 31 | if [[ $cnt -eq 2 ]]; then exit 0; fi |
| 32 | exit 2 |