blob: 0fbadd60ac5683659a49271ecb87621d842dc385 [file] [log] [blame]
Rupert Swarbrick105df012021-01-29 11:33:13 +00001#!/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
11set -e
12
13if [ $# != 1 ]; then
14 echo >&2 "Usage: verible-lint.sh <flavour>"
15 exit 1
16fi
17flavour="$1"
18
19case "$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
33esac
34
35util/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}