| #!/bin/bash |
| |
| # Copyright lowRISC contributors. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| # to run rdc-lint on all modules, type |
| # rdc_lint_all |
| |
| #------------------------------------------------------------------------- |
| # list all blocks |
| #------------------------------------------------------------------------- |
| declare -a blocks=( |
| "prim_fifo_async" |
| "prim_pulse_sync" |
| "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 "RDC LINT REPORT:\n\n" |
| format="%20s %10s %10s %10s \n" |
| printf "${format}" "Block" "Clocks" "Resets" "Warnings" |
| echo "------------------------------------------------------" |
| |
| #------------------------------------------------------------------------- |
| # run rdc-lint (meridian) and summarize results |
| #------------------------------------------------------------------------- |
| \rm -Rf build meridian_project rdc*.log rdc*.rpt |
| |
| for block in "${blocks[@]}" ; do |
| |
| rdc_lint $block > /dev/null 2>&1 |
| cp rdc.rpt rdc_${block}.rpt |
| cp rdc.log rdc_${block}.log |
| |
| # summarize results |
| crash=`grep "^ ERR" rdc.log` |
| if [ $? -eq 0 ]; then |
| printf "${format}" $block "CRASH" |
| else |
| clocks=`grep "Total Async" rdc.log | cut -d":" -f2` |
| resets=`grep "Total Reset signals" rdc.log | cut -d":" -f2 | cut -d"(" -f1` |
| warns=`grep "Total warnings found" rdc.log | cut -d":" -f2` |
| printf "${format}" $block $clocks $resets $warns |
| fi |
| done |
| |
| #------------------------------------------------------------------------- |
| # generate detailed reports |
| #------------------------------------------------------------------------- |
| printf "\n\nLIST OF WARNINGS FOR EACH BLOCK:" |
| for block in "${blocks[@]}" ; do |
| printf "\n\n${block}\n" |
| grep "^W_" rdc_${block}.rpt | cut -d";" -f1 |
| done |