blob: e917fda2238d2a239df1dcc98829b3b55f1adc63 [file] [log] [blame]
lowRISC Contributors802543a2019-08-31 12:12:56 +01001#!/bin/bash
2
3# to run JasperGold FPV on all modules, type
4# fpv_all
5
Cindy Chenc5fb4262020-04-09 13:01:59 -07006tool="jg"
7while [ "$1" != "" ]; do
8 case "$1" in
9 "-t")
10 shift
11 tool=$1
12 ;;
13 esac
14 shift
15done
16
lowRISC Contributors802543a2019-08-31 12:12:56 +010017#-------------------------------------------------------------------------
18# list all blocks
19#-------------------------------------------------------------------------
20declare -a blocks=(
Cindy Chen531ae5a2020-06-05 09:59:50 -070021 "alert_handler"
22 "aes"
lowRISC Contributors802543a2019-08-31 12:12:56 +010023 "gpio"
lowRISC Contributors802543a2019-08-31 12:12:56 +010024 "flash_ctrl"
Cindy Chen531ae5a2020-06-05 09:59:50 -070025 "hmac"
Cindy Chen872edb72020-05-18 21:44:26 -070026 "otp_ctrl"
Cindy Chene89bc962020-04-27 21:18:15 -070027 "pwrmgr"
Cindy Chen531ae5a2020-06-05 09:59:50 -070028 "rv_core_ibex"
29 "rv_dm"
30 "rv_timer"
31 "spi_device"
32 "uart"
lowRISC Contributors802543a2019-08-31 12:12:56 +010033 "usbdev"
Cindy Chen531ae5a2020-06-05 09:59:50 -070034 "usbuart"
Cindy Chende3b0102020-01-17 10:55:43 -080035 #"top_earlgrey"
Michael Schaffnerd0fdd732019-09-19 17:45:07 -070036 # run formal on dedicated FPV testbenches
Michael Schaffner8e1d0932020-01-24 18:13:36 -080037 "prim_arbiter_ppc_fpv"
38 "prim_arbiter_tree_fpv"
Michael Schaffner70080422020-06-16 15:08:37 -070039 "prim_arbiter_fixed_fpv"
Cindy Chen8c725d42019-11-14 09:33:18 -080040 "prim_alert_rxtx_fpv"
41 "prim_alert_rxtx_async_fpv"
42 "prim_esc_rxtx_fpv"
Cindy Chen531ae5a2020-06-05 09:59:50 -070043 "prim_lfsr_fpv"
44 "prim_fifo_sync_fpv"
Cindy Chen496b90f2020-06-07 17:57:13 -070045 "prim_packer_fpv"
Cindy Chen8c725d42019-11-14 09:33:18 -080046 "pinmux_fpv"
47 "padctrl_fpv"
48 "rv_plic_fpv"
Cindy Chenc30dad22020-03-19 13:26:13 -070049 "rv_plic_generic_fpv"
lowRISC Contributors802543a2019-08-31 12:12:56 +010050)
51
52#-------------------------------------------------------------------------
53# print header
54#-------------------------------------------------------------------------
55printf "FPV RESULTS PER BLOCK\n"
56printf "Below table shows the total number of assertions, and\n"
57printf "the percentages of covered and proven assertions.\n\n"
Cindy Chende3b0102020-01-17 10:55:43 -080058format1="%28s %10s %10s %10s \n"
59format2="%28s %10s %9.0f%% %9.0f%% \n"
lowRISC Contributors802543a2019-08-31 12:12:56 +010060printf "${format1}" "Block" "Asserts" "Covered" "Proven"
Cindy Chen18604732020-01-28 09:50:40 -080061echo "-----------------------------------------------------------------"
lowRISC Contributors802543a2019-08-31 12:12:56 +010062
63#-------------------------------------------------------------------------
64# run fpv and summarize results
65#-------------------------------------------------------------------------
66\rm -Rf fpv_*.log
67
68for block in "${blocks[@]}" ; do
69
Cindy Chenc5fb4262020-04-09 13:01:59 -070070 ./fpv $block -t ${tool} > /dev/null 2>&1
lowRISC Contributors802543a2019-08-31 12:12:56 +010071 cp fpv.log fpv_${block}.log
72
73 # summarize results
74 crash=`grep "ERROR" fpv.log`
75 if [ $? -eq 0 ]; then
76 printf "${format1}" $block "CRASH"
77 else
78 asserts=`grep " assertions " fpv.log | cut -d":" -f2 | cut -d"(" -f1`
79 covered=`grep " - covered " fpv.log | cut -d"(" -f2 | cut -d"%" -f1`
80 proven=`grep " - proven " fpv.log | cut -d"(" -f2 | cut -d"%" -f1`
81 printf "${format2}" $block $asserts $covered $proven
82 fi
83done
84
85#-------------------------------------------------------------------------
86# print errors
87#-------------------------------------------------------------------------
88printf "\n\nLIST OF ERRORS AND UNPROVEN ASSERTIONS FOR EACH BLOCK:"
89printf "\nNote: \"cex\" below indicates that JasperGold found a"
90printf "\n\"counter example\", which could be caused by an RTL"
91printf "\nbug or a missing assume property on an input."
92
93for block in "${blocks[@]}" ; do
94 printf "\n\n${block}\n"
95 grep "ERROR" fpv_${block}.log
96
97 # print uncovered and unproven assertions
98 grep "^\[[1-9]" fpv_${block}.log | egrep -v " (proven|covered) "
99done