Trouble getting started with linting
Hello! I'm trying to get basic lint check working and I'm hitting a wall on ~step 1. I'm trying to `include a verilog header/package file and I'm getting a duplicate declaration message that is telling me I am doing something wrong :). Looking for any help to get unstuck...
- Suggestions on how to properly include a .svh file?
- It looks like any common package file is going to have a DECLFILENAME warning?
Charless-Mini:code charlese$ verilator --lint-only -Wall -I./lib ./src/test1.sv ./src/test2.sv --top-module test1 %Warning-MODDUP: lib/iface.svh:16: Duplicate declaration of module: test_interface %Warning-MODDUP: lib/iface.svh:16: ... Location of original declaration %Warning-MODDUP: Use "/* verilator lint_off MODDUP */" and lint_on around source to disable this message. %Warning-DECLFILENAME: lib/iface.svh:16: Filename 'iface' does not match IFACE name: test_interface./src/test1.sv:
`include "iface.svh" module test1 ( input clk, input reset ); endmodule./src/test2.sv:
`include "iface.svh" module test2 ( input clk, input reset ); endmodule./lib/iface.svh:
interface test_interface ; wire test1; endinterface: test_interface
RE: Trouble getting started with linting - Added by Wilson Snyder about 1 year ago
Both test1 and test2 include iface.svh, so the interface is defined twice hence the warning. Put an include guard around all .svh files.
Yes, you'll need to turn off DECLFILENAME if your interface filenames aren't named appropriately.
:FACEPALM: Awesome - I even read about header guards while spinning myself in circles. Thank you!