lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # to run JasperGold FPV on all modules, type |
| 4 | # fpv_all |
| 5 | |
| 6 | #------------------------------------------------------------------------- |
| 7 | # list all blocks |
| 8 | #------------------------------------------------------------------------- |
| 9 | declare -a blocks=( |
| 10 | "gpio" |
| 11 | "rv_core_ibex" |
| 12 | "rv_dm" |
| 13 | "rv_plic" |
| 14 | "spi_device" |
| 15 | "rv_timer" |
| 16 | "uart" |
| 17 | "hmac" |
| 18 | "flash_ctrl" |
| 19 | "usbuart" |
| 20 | "usbdev" |
| 21 | # "usb_fs_nb_pe" This module doesn't have any assertions yet |
| 22 | "tlul_adapter_sram" |
| 23 | "tlul_socket_1n" |
| 24 | "tlul_socket_m1" |
| 25 | "sram2tlul" |
| 26 | "xbar_main" |
| 27 | "top_earlgrey" |
Michael Schaffner | d0fdd73 | 2019-09-19 17:45:07 -0700 | [diff] [blame] | 28 | # run formal on dedicated FPV testbenches |
| 29 | "prim_lfsr_tb" |
| 30 | "prim_alert_rxtx_tb" |
| 31 | "prim_alert_rxtx_async_tb" |
| 32 | "prim_esc_rxtx_tb" |
Michael Schaffner | 622631b | 2019-10-02 16:51:27 -0700 | [diff] [blame] | 33 | "pinmux_tb" |
Michael Schaffner | fe2ae85 | 2019-10-02 17:48:47 -0700 | [diff] [blame] | 34 | "padctrl_tb" |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 35 | ) |
| 36 | |
| 37 | #------------------------------------------------------------------------- |
| 38 | # print header |
| 39 | #------------------------------------------------------------------------- |
| 40 | printf "FPV RESULTS PER BLOCK\n" |
| 41 | printf "Below table shows the total number of assertions, and\n" |
| 42 | printf "the percentages of covered and proven assertions.\n\n" |
| 43 | format1="%18s %10s %10s %10s \n" |
| 44 | format2="%18s %10s %9.0f%% %9.0f%% \n" |
| 45 | printf "${format1}" "Block" "Asserts" "Covered" "Proven" |
| 46 | echo "----------------------------------------------------" |
| 47 | |
| 48 | #------------------------------------------------------------------------- |
| 49 | # run fpv and summarize results |
| 50 | #------------------------------------------------------------------------- |
| 51 | \rm -Rf fpv_*.log |
| 52 | |
| 53 | for block in "${blocks[@]}" ; do |
| 54 | |
| 55 | fpv $block > /dev/null 2>&1 |
| 56 | cp fpv.log fpv_${block}.log |
| 57 | |
| 58 | # summarize results |
| 59 | crash=`grep "ERROR" fpv.log` |
| 60 | if [ $? -eq 0 ]; then |
| 61 | printf "${format1}" $block "CRASH" |
| 62 | else |
| 63 | asserts=`grep " assertions " fpv.log | cut -d":" -f2 | cut -d"(" -f1` |
| 64 | covered=`grep " - covered " fpv.log | cut -d"(" -f2 | cut -d"%" -f1` |
| 65 | proven=`grep " - proven " fpv.log | cut -d"(" -f2 | cut -d"%" -f1` |
| 66 | printf "${format2}" $block $asserts $covered $proven |
| 67 | fi |
| 68 | done |
| 69 | |
| 70 | #------------------------------------------------------------------------- |
| 71 | # print errors |
| 72 | #------------------------------------------------------------------------- |
| 73 | printf "\n\nLIST OF ERRORS AND UNPROVEN ASSERTIONS FOR EACH BLOCK:" |
| 74 | printf "\nNote: \"cex\" below indicates that JasperGold found a" |
| 75 | printf "\n\"counter example\", which could be caused by an RTL" |
| 76 | printf "\nbug or a missing assume property on an input." |
| 77 | |
| 78 | for block in "${blocks[@]}" ; do |
| 79 | printf "\n\n${block}\n" |
| 80 | grep "ERROR" fpv_${block}.log |
| 81 | |
| 82 | # print uncovered and unproven assertions |
| 83 | grep "^\[[1-9]" fpv_${block}.log | egrep -v " (proven|covered) " |
| 84 | done |