From 746e334cdf3f45cbcdfa0f5cc7c5974a77875224 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Mon, 24 Mar 2014 15:32:08 -0400 Subject: lint: add color, recursive include, Xilinx primitives All subdirectories below ./hdl are now added to the lint search path. %Error and %Warning get colorized. Xilinx Unisim primitives use empty template definitions; errors in this file are ignored using a verilator config file. --- Makefile.example | 3 +++ contrib/xilinx.mk | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.example b/Makefile.example index 81bca85..41d7d76 100644 --- a/Makefile.example +++ b/Makefile.example @@ -93,6 +93,9 @@ xilinx_cores += ### Edit this line to specify a non-empty file for use with your project. bmm_file := contrib/empty.bmm +### Extra project-specific arguments to linter +#lint_extra := -Wno-ASSIGNDLY + ### The bulk of the actual Xilinx-oriented build system is in a different file include ./contrib/xilinx.mk diff --git a/contrib/xilinx.mk b/contrib/xilinx.mk index 3d2a927..adcb792 100644 --- a/contrib/xilinx.mk +++ b/contrib/xilinx.mk @@ -103,6 +103,10 @@ PWD := $(shell pwd) # The following are used to color-code console build output colorize ?= 2>&1 | python $(PWD)/contrib/colorize.py red ERROR: yellow WARNING: green \"Number of error messages: 0\" green \"Number of error messages:\t0\" green \"Number of errors: 0\" colorizetest ?= 2>&1 | python $(PWD)/contrib/colorize.py red FAIL green PASS +colorizelint ?= 2>&1 | python $(PWD)/contrib/colorize.py red %Error yellow %Warning + +# Build up lint include path from all paths below ./hdl/ +lint_search += $(foreach d, $(shell /usr/bin/find ./hdl/ -type d), -I$(d)) # Library stuff (TODO: untested) libs ?= @@ -397,7 +401,10 @@ par_timingan: build/$(project)_post_par.twr timingan -ucf ../$(ucf_file) $(project)_par.ncd $(project).pcf $(project)_post_par.twx &" lint: - verilator --lint-only -I./hdl -I./cores -Wall -Wno-DECLFILENAME hdl/$(top_module)_$(board) || true + @mkdir -p build + @echo "\`verilator_config" > build/verilator_opts.vlt + @echo 'lint_off -file "$(iseenv)/ISE/verilog/src/iSE/unisim_comp.v"' >> build/verilator_opts.vlt + verilator --lint-only -I./cores $(lint_search) -Wall -Wno-DECLFILENAME -v $(iseenv)/ISE/verilog/src/iSE/unisim_comp.v build/verilator_opts.vlt $(lint_extra) hdl/$(top_module)_$(board) $(colorizelint) || true help: @cat ./contrib/README -- cgit v1.2.3