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 | |
| 17 | # comma seperated test ids |
| 18 | IDS=$1 |
| 19 | # simulation mode : RTL/GL |
| 20 | SIM_MODE=$2 |
| 21 | |
| 22 | DV_TEST_IDS=(${IDS//,/ }) |
| 23 | |
| 24 | export TARGET_PATH=$(pwd) |
manarabdelaty | e542bdf | 2021-04-20 11:15:40 +0200 | [diff] [blame] | 25 | export CARAVEL_ROOT=$(pwd)/caravel |
manarabdelaty | eb2b903 | 2021-04-19 12:31:47 +0200 | [diff] [blame] | 26 | |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 27 | if [ ! -d $TARGET_PATH ] |
| 28 | then |
| 29 | echo "Directory /path/to/dir DOES NOT exists." |
| 30 | exit 9999 |
| 31 | fi |
| 32 | |
| 33 | cd .. |
| 34 | |
| 35 | export PDK_PATH=$(pwd)/pdks/sky130A |
| 36 | if [ ! -d $PDK_PATH ] |
| 37 | then |
| 38 | echo "Directory /path/to/dir DOES NOT exists." |
| 39 | exit 9999 |
| 40 | fi |
| 41 | |
| 42 | DV_PATH=$TARGET_PATH/verilog/dv |
| 43 | if [ ! -d $DV_PATH ] |
| 44 | then |
| 45 | echo "Directory /path/to/dir DOES NOT exists." |
| 46 | exit 9999 |
| 47 | fi |
| 48 | |
| 49 | for id in "${DV_TEST_IDS[@]}" |
| 50 | do |
| 51 | docker run -v $TARGET_PATH:$TARGET_PATH -v $PDK_PATH:$PDK_PATH \ |
manarabdelaty | eb2b903 | 2021-04-19 12:31:47 +0200 | [diff] [blame] | 52 | -v $CARAVEL_ROOT:$CARAVEL_ROOT \ |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 53 | -e TARGET_PATH=$TARGET_PATH -e PDK_PATH=$PDK_PATH \ |
manarabdelaty | eb2b903 | 2021-04-19 12:31:47 +0200 | [diff] [blame] | 54 | -e CARAVEL_ROOT=$CARAVEL_ROOT \ |
manarabdelaty | 71c0e0a | 2021-04-08 17:03:47 +0200 | [diff] [blame] | 55 | -u $(id -u $USER):$(id -g $USER) efabless/dv_setup:latest \ |
| 56 | bash -c "bash $TARGET_PATH/.github/scripts/dv/run-dv.sh $PDK_PATH $DV_PATH $id $SIM_MODE" |
| 57 | |
| 58 | echo "DONE!" |
| 59 | |
| 60 | VERDICT_FILE=$TARGET_PATH/verilog/dv/$id.out |
| 61 | |
| 62 | if [ -f $VERDICT_FILE ]; then |
| 63 | cnt=$(grep "Pass" $VERDICT_FILE -s | wc -l) |
| 64 | if ! [[ $cnt ]]; then cnt = 0; fi |
| 65 | else |
| 66 | echo "DV check failed due to subscript failure. Please review the logs"; |
| 67 | exit 2; |
| 68 | fi |
| 69 | |
| 70 | echo "Verdict: $cnt" |
| 71 | |
| 72 | if [[ $cnt -ne 1 ]]; then |
| 73 | exit 2; |
| 74 | fi |
| 75 | done |
| 76 | |
Manar | e4eaf2c | 2021-04-19 19:21:32 +0200 | [diff] [blame] | 77 | exit 0; |