manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +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 TARGET_PATH=$(pwd) |
manarabdelaty | e542bdf | 2021-04-20 11:15:40 +0200 | [diff] [blame] | 17 | export CARAVEL_ROOT=$(pwd)/caravel |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 18 | cd .. |
| 19 | export PDK_ROOT=$(pwd)/precheck_pdks |
manarabdelaty | b60291c | 2021-09-17 20:33:08 +0200 | [diff] [blame] | 20 | export PRECHECK_ROOT=$TARGET_PATH/mpw_precheck/ |
manarabdelaty | 82c974b | 2021-09-17 21:24:45 +0200 | [diff] [blame] | 21 | export OUTPUT_DIRECTORY=$TARGET_PATH/checks |
manarabdelaty | 2632315 | 2021-09-16 23:11:34 +0200 | [diff] [blame] | 22 | cd $TARGET_PATH/mpw_precheck/ |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 23 | |
manarabdelaty | 82c974b | 2021-09-17 21:24:45 +0200 | [diff] [blame] | 24 | docker run -v $PRECHECK_ROOT:$PRECHECK_ROOT -v $TARGET_PATH:$TARGET_PATH -v $CARAVEL_ROOT:$CARAVEL_ROOT -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c "cd $PRECHECK_ROOT; python3 mpw_precheck.py magic_drc klayout_offgrid klayout_feol klayout_zeroarea klayout_pin_label_purposes_overlapping_drawing --pdk_root $PDK_ROOT --input_directory $TARGET_PATH --caravel_root $CARAVEL_ROOT --output_directory $OUTPUT_DIRECTORY" |
manarabdelaty | b3cc9df | 2021-09-17 21:53:32 +0200 | [diff] [blame] | 25 | output=$OUTPUT_DIRECTORY/logs/precheck.log |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 26 | |
manarabdelaty | b3cc9df | 2021-09-17 21:53:32 +0200 | [diff] [blame] | 27 | gzipped_file=$OUTPUT_DIRECTORY/logs/precheck.log.gz |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 28 | |
| 29 | if [[ -f $gzipped_file ]]; then |
| 30 | gzip -d $gzipped_file |
| 31 | fi |
| 32 | |
| 33 | grep "Violation Message" $output |
| 34 | |
manarabdelaty | 82c974b | 2021-09-17 21:24:45 +0200 | [diff] [blame] | 35 | cnt=$(grep -c "All Checks Passed" $output) |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 36 | if ! [[ $cnt ]]; then cnt=0; fi |
| 37 | if [[ $cnt -eq 1 ]]; then exit 0; fi |
| 38 | exit 2 |