diff --git a/azure-pipelines.yml b/azure-pipelines.yml index da6b38e7..ecf76e03 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,6 +10,7 @@ variables: VERILATOR_PATH: /opt/buildcache/verilator/$(VERILATOR_VERSION) RISCV_TOOLCHAIN_TAR_VERSION: 20190807-1 RISCV_COMPLIANCE_GIT_VERSION: 844c6660ef3f0d9b96957991109dfd80cc4938e2 + VERIBLE_VERSION: v0.0-266-g9e55307 trigger: batch: true @@ -61,9 +62,19 @@ jobs: libelf-dev \ clang-format \ && sudo pip3 install -U setuptools pip six \ - && sudo pip3 install -U fusesoc + && sudo pip3 install -U -r python-requirements.txt displayName: Install dependencies + - bash: | + set -e + mkdir -p build/verible + cd build/verible + curl -Ls -o verible.tar.gz https://github.com/google/verible/releases/download/$(VERIBLE_VERSION)/verible-$(VERIBLE_VERSION)-Ubuntu-16.04-xenial-x86_64.tar.gz + sudo mkdir -p /tools/verible && sudo chmod 777 /tools/verible + tar -C /tools/verible -xf verible.tar.gz --strip-components=1 + echo "##vso[task.setvariable variable=PATH]/tools/verible/bin:$PATH" + displayName: Install Verible + - bash: | set -e if [ ! -d $(VERILATOR_PATH) ]; then @@ -99,17 +110,29 @@ jobs: fusesoc --version verilator --version riscv32-unknown-elf-gcc --version + verilog_lint --version displayName: Display environment - bash: | - fusesoc --cores-root . run --target=lint lowrisc:ibex:ibex_core_tracing + fusesoc --cores-root . run --no-export --target=lint --tool=verilator lowrisc:ibex:ibex_core_tracing if [ $? != 0 ]; then echo -n "##vso[task.logissue type=error]" - echo "Verilog lint failed. Run 'fusesoc --cores-root . run --target=lint lowrisc:ibex:ibex_core_tracing' to check and fix all errors." + echo "Verilog lint with Verilator failed. Run 'fusesoc --cores-root . run --target=lint --tool=verilator lowrisc:ibex:ibex_core_tracing' to check and fix all errors." exit 1 fi displayName: Lint Verilog source files with Verilator + - bash: | + fusesoc --cores-root . run --no-export --target=lint --tool=veriblelint lowrisc:ibex:ibex_core_tracing + if [ $? != 0 ]; then + echo -n "##vso[task.logissue type=error]" + echo "Verilog lint with Verible failed. Run 'fusesoc --cores-root . run --target=lint --tool=veriblelint lowrisc:ibex:ibex_core_tracing' to check and fix all errors." + echo "This flow is currently experimental and failures can be ignored." + exit 1 + fi + continueOnError: true + displayName: Lint Verilog source files with Verible (experimental) + - bash: | fork_origin=$(git merge-base --fork-point origin/master) changed_files=$(git diff --name-only $fork_origin | grep -v '^vendor' | grep -E '\.(cpp|cc|c|h)$') diff --git a/ibex_core.core b/ibex_core.core index a3fb7c08..b92d817f 100644 --- a/ibex_core.core +++ b/ibex_core.core @@ -104,3 +104,7 @@ targets: mode: lint-only verilator_options: - "-Wall" + veriblelint: + ruleset: default + rules: + - "-parameter-name-style" diff --git a/ibex_core_tracing.core b/ibex_core_tracing.core index 9de7f133..5084a242 100644 --- a/ibex_core_tracing.core +++ b/ibex_core_tracing.core @@ -79,3 +79,7 @@ targets: mode: lint-only verilator_options: - "-Wall" + veriblelint: + ruleset: default + rules: + - "-parameter-name-style" diff --git a/python-requirements.txt b/python-requirements.txt new file mode 100644 index 00000000..03e049f3 --- /dev/null +++ b/python-requirements.txt @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +# Development version of edalize until all our changes are upstream +git+https://github.com/lowRISC/edalize.git@ot + +# Development version with OT-specific changes +git+https://github.com/lowRISC/fusesoc.git@ot