blob: af67f965cc5b6f0121760fa88162994093dff89a [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
6#-------------------------------------------------------------------------
7# list all blocks
8#-------------------------------------------------------------------------
9declare -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 Schaffnerd0fdd732019-09-19 17:45:07 -070028 # 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 Schaffner622631b2019-10-02 16:51:27 -070033 "pinmux_tb"
Michael Schaffnerfe2ae852019-10-02 17:48:47 -070034 "padctrl_tb"
lowRISC Contributors802543a2019-08-31 12:12:56 +010035)
36
37#-------------------------------------------------------------------------
38# print header
39#-------------------------------------------------------------------------
40printf "FPV RESULTS PER BLOCK\n"
41printf "Below table shows the total number of assertions, and\n"
42printf "the percentages of covered and proven assertions.\n\n"
43format1="%18s %10s %10s %10s \n"
44format2="%18s %10s %9.0f%% %9.0f%% \n"
45printf "${format1}" "Block" "Asserts" "Covered" "Proven"
46echo "----------------------------------------------------"
47
48#-------------------------------------------------------------------------
49# run fpv and summarize results
50#-------------------------------------------------------------------------
51\rm -Rf fpv_*.log
52
53for 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
68done
69
70#-------------------------------------------------------------------------
71# print errors
72#-------------------------------------------------------------------------
73printf "\n\nLIST OF ERRORS AND UNPROVEN ASSERTIONS FOR EACH BLOCK:"
74printf "\nNote: \"cex\" below indicates that JasperGold found a"
75printf "\n\"counter example\", which could be caused by an RTL"
76printf "\nbug or a missing assume property on an input."
77
78for 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) "
84done