Project

General

Profile

[logo] 
 
Home
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Trouble getting started with linting

Added by Charles Eddleston over 1 year ago

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...

  1. Suggestions on how to properly include a .svh file?
  2. It looks like any common package file is going to have a DECLFILENAME warning?

Thanks!

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

Replies (2)

RE: Trouble getting started with linting - Added by Wilson Snyder over 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.

RE: Trouble getting started with linting - Added by Charles Eddleston over 1 year ago

:FACEPALM: Awesome - I even read about header guards while spinning myself in circles. Thank you!

    (1-2/2)