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

How do you tell "verilator --lint-only" to skip selected files?

Added by Galen Seitz almost 4 years ago

Hi,

I'm trying to use verilator just to lint my code. The design is a Lattice FPGA, and I'm using various Lattice modules, such as PLLs. I need to tell verilator to skip the Lattice-supplied modules and just lint my code.

I'm running verilator like this:

verilator --lint-only --bbox-unsup -f input.vc verilator.vlt dcs_usb.v

dcs_usb instances dcs_usb_pll, which instances a Lattice-specific module named EHXPLLJ. I only have access to the simulation version of EHXPLLJ. It has constructs that verilator doesn't like. Thus the need to have it skip this module/file.

input.vc:
-y /opt/lattice/diamond/3.8_x64/cae_library/simulation/verilog/machxo3l/
-y ../dcs_usb_pll
-y ../usb/usb_xcvr/rtl
verilator.vlt:
`verilator_config
// This works as expected.
lint_off -msg STMTDLY -file "*/EHXPLLJ.v" 
// This does not work.
lint_off -file "*/EHXPLLJ.v" 
The lint_off line that suppresses STMDLY definitely works, but I was expecting the lint_off line without the -msg switch to cause the file to be skipped entirely. Instead, I'm getting error messages like this one:
%Error: /opt/lattice/diamond/3.8_x64/cae_library/simulation/verilog/machxo3l//EHXPLLJ.v:820: Unsupported: Verilog 1995 reserved word not implemented: deassign

I'm running Verilator 3.890 2016-11-25 rev verilator_3_888-18-gc72d473

I assume this is a common thing to want to do. Where am I going wrong?

thanks, galen


Replies (8)

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Wilson Snyder almost 4 years ago

This

lint_off -file "*/EHXPLLJ.v"

Means turn off all lint-related messages on the matching file(s).

There is no way at present to skip files entirely. There's no easy way to do such a thing as Verilator needs the lower modules in order to elaborate the design.

One workaround would be to manually ifdef out the guts of the appropriate library based on some define, then throw that define.

Another would be to teach --bbox-unsup how to still parse the constructs it is complaining about but otherwise ignore them. If you ifdef out only the lines Verilator complains about one-by-one, and the resulting list of removed code patterns are fairly small, I'll can see if I can add those to bbox-unsup.

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Galen Seitz almost 4 years ago

Thanks for the response. I sort of suspected that there would be a problem with skipping an entire file.

Okay, I've hacked the Lattice PLL simulator model to eliminate the errors from verilator --lint-only. Here are the two problematic constructs:
  • deassign foo;
  • always @(bar or posedge baz)

Also, what I'm seeing here is that lint_off -file "EHXPLLJ.v" does not disable lint warnings as expected. Only -msg options successfully suppress the warnings.

`verilator_config
// This works as expected.
lint_off -msg STMTDLY -file "EHXPLLJ.v" 
lint_off -msg COMBDLY -file "EHXPLLJ.v" 
lint_off -msg UNOPTFLAT -file "EHXPLLJ.v" 
lint_off -msg MULTIDRIVEN -file "EHXPLLJ.v" 
// This does not work.
//lint_off -file "EHXPLLJ.v" 

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Galen Seitz almost 4 years ago

I was wrong when I said that lint_off -file "EHXPLLJ.v" doesn't disable lint warnings. It does disable many warnings, but it doesn't disable these particular warnings:
  • STMTDLY
  • COMBDLY
  • UNOPTFLAT
  • MULTIDRIVEN

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Wilson Snyder almost 4 years ago

lint_off without a message does the lint messages described in -Wno-lint, not what are stronger messages that indicate possible false simulation results. I'll update the docs.

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Galen Seitz almost 4 years ago

Would you like me to open an issue for the two unsupported constructs mentioned earlier?

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Wilson Snyder almost 4 years ago

Yes, could you also please make a test_regress file (see the docs) using --lint that fails now, and will pass when they are implemented?

RE: How do you tell "verilator --lint-only" to skip selected files? - Added by Edmond Cote over 3 years ago

Checking in if this has been resolved. Facing same issue. Easy to workaround but would be nice to not navigate here to look for a solution :)

    (1-8/8)