Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright lowRISC contributors. |
| 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | # A wrapper around Verible lint, used for CI. |
| 7 | # |
| 8 | # Expects a single argument, which is the pull request's target branch |
| 9 | # (usually "master"). |
| 10 | |
| 11 | set -e |
| 12 | |
| 13 | if [ $# != 1 ]; then |
| 14 | echo >&2 "Usage: verible-lint.sh <flavour>" |
| 15 | exit 1 |
| 16 | fi |
| 17 | flavour="$1" |
| 18 | |
| 19 | case "$flavour" in |
| 20 | rtl) |
| 21 | human_desc=design |
| 22 | dvsim_cfg=hw/top_earlgrey/lint/top_earlgrey_lint_cfgs.hjson |
| 23 | ;; |
| 24 | |
| 25 | dv) |
| 26 | human_desc=DV |
| 27 | dvsim_cfg=hw/top_earlgrey/lint/top_earlgrey_dv_lint_cfgs.hjson |
| 28 | ;; |
| 29 | |
| 30 | *) |
| 31 | echo >&2 "Unknown lint flavour: $flavour" |
| 32 | exit 1 |
| 33 | esac |
| 34 | |
| 35 | util/dvsim/dvsim.py --tool=veriblelint "$dvsim_cfg" || { |
| 36 | echo -n "##vso[task.logissue type=error]" |
| 37 | echo "Verilog style lint of $human_desc sources with Verible failed. Run 'util/dvsim/dvsim.py -t veriblelint $dvsim_cfg' and fix all errors." |
| 38 | exit 1 |
| 39 | } |