| ## get the name of all subdfolders under verilog/dv |
| ALL_DV_TESTS="$(find * -maxdepth 0 -type d)" |
| ## convert all ALL_DV_TESTS to an array |
| TESTS_ARR=($ALL_DV_TESTS) |
| ## get length of the TESTS array |
| ## make sure that the test ID is less than the array length |
| if [ $DV_TEST_ID -ge $len ] |
| echo "Error: Invalid Test ID" |
| ## get the name corresponding to the test ID |
| PATTERN=${TESTS_ARR[$DV_TEST_ID]} |
| OUT_FILE=$DV_PATH/$DV_TEST_ID.out |
| echo "Running $PATTERN $SIM.." |
| logFile=$DV_PATH/$PATTERN.$SIM.dv.out |
| grep "Monitor" $logFile >> $OUT_FILE |
| echo "Execution Done on $PATTERN !" |