blob: 91ab69e8be641f5258210415de41dbe2a3c70895 [file] [log] [blame]
#!/bin/bash
# to run lint on all modules, type
# lint_all | tee lint_all.std
#-------------------------------------------------------------------------
# list all blocks
#-------------------------------------------------------------------------
declare -a blocks=(
"alert_handler"
"pinmux"
"padctrl"
"padring"
"gpio"
"rv_core_ibex"
"rv_dm"
"rv_plic"
"spi_device"
"rv_timer"
"uart"
"hmac"
"flash_ctrl"
"usbuart"
"usbdev"
"usb_fs_nb_pe"
"tlul_adapter_sram"
"tlul_socket_1n"
"tlul_socket_m1"
"sram2tlul"
"xbar_main"
"top_earlgrey"
)
#-------------------------------------------------------------------------
# print header
#-------------------------------------------------------------------------
printf "NUMBER OF LINT ERRORS PER BLOCK:\n\n"
format="%20s %10s %10s \n"
printf "${format}" "Block" "Errors" "Warnings"
echo "-------------------------------------------"
#-------------------------------------------------------------------------
# run lint and summarize results
#-------------------------------------------------------------------------
\rm -Rf build ascent_project lint_*.log lint_*.rpt
for block in "${blocks[@]}" ; do
lint $block > /dev/null 2>&1
cp lint.log lint_${block}.log
cp lint.rpt lint_${block}.rpt
# summarize results
crash=`grep "^ ERR" lint.log`
if [ $? -eq 0 ]; then
error_cnt="CRASH"
warni_cnt="CRASH"
else
error_cnt=`grep "^E " lint.rpt | wc -l`
warni_cnt=`grep "^W " lint.rpt | wc -l`
fi
printf "${format}" `echo $block | rev | cut -d"/" -f2 | rev` $error_cnt $warni_cnt
done
#-------------------------------------------------------------------------
# generate detailed reports
#-------------------------------------------------------------------------
printf "\n\nLIST OF ERRORS (E) AND WARNINGS (W) FOR EACH BLOCK:"
for block in "${blocks[@]}" ; do
printf "\n\n${block}\n"
# grep for lint crashes and lint errors, and limit line length
grep "^ ERR" -A 2 lint_${block}.log | cut -c -200
grep "^E " lint_${block}.rpt | cut -c -200
grep "^W " lint_${block}.rpt | cut -c -200
done