Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint: DECLFILENAME warning is picking up a blackboxed module inside the actual module #2430

Closed
imphil opened this issue Jun 17, 2020 · 3 comments
Assignees
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed

Comments

@imphil
Copy link
Member

imphil commented Jun 17, 2020

Have a look at this file:

https://github.com/lowRISC/opentitan/blob/master/hw/ip/prim_xilinx/rtl/prim_xilinx_clock_mux2.sv

Simplified:

module prim_xilinx_clock_mux2 (
  input        clk0_i,
);

  BUFGMUX bufgmux_i (
    .I1 ( clk1_i )
  );
endmodule

BUFGMUX is a Xilinx-provided module which is effectively a black-box for Verilator.

This file is always compiled, but not used for Verilator (an implementation is selected through a generate if/else block).

When running this through Verilator lint, I get:

%Warning-DECLFILENAME: ../../../hw/ip/prim_xilinx/rtl/prim_xilinx_clock_mux2.sv:17:11: Filename 'prim_xilinx_clock_mux2' does not match NOTFOUNDMODULE name: 'BUFGMUX'
   17 |   BUFGMUX bufgmux_i (
      |           ^~~~~~~~~
                       ... Use "/* verilator lint_off DECLFILENAME */" and lint_on around source to disable this message.

I'm not sure what happens here, but the message is strange: the filename of the module has nothing to do with the BUFGMUX module, which is instantiated inside it. And the actual module name prim_xilinx_clock_mux2 matches the file name prim_xilinx_clock_mux2.sv.

$ verilator --version
Verilator 4.037 devel rev v4.036-60-gfa828ac9b

(A recent master.)

@imphil imphil added the new New issue not seen by maintainers label Jun 17, 2020
@wsnyder
Copy link
Member

wsnyder commented Jun 17, 2020

Verilator makes internal notfiundmodules for modules like this. Probably that warning doesn't disable with that (when 'VN_IS(nodep, NotFoundModule)').

Perhaps you could attempt a pull request to fix this with a failing test that it fixes?

@imphil
Copy link
Member Author

imphil commented Jun 17, 2020

I actually wanted to look into a fix for quite a while but didn't find time for it. At least this issue now gives someone else the chance to beat me to it 😄

@wallento
Copy link
Member

Increasing the pressure by assigning to @imphil ;)

@wallento wallento added area: lint Issue involves SystemVerilog lint checking status: ready Issue is ready for someone to fix; then goes to 'status: assigned' and removed new New issue not seen by maintainers labels Jun 20, 2020
imphil added a commit to imphil/opentitan that referenced this issue Jul 3, 2020
When running Verilator lint with blackboxed modules, we get warnings
like the ones below:

```
%Warning-DECLFILENAME: ../../../vendor/lowrisc_ip/prim_xilinx/rtl/prim_xilinx_clock_gating.sv:12:10: Filename 'prim_xilinx_clock_gating' does not match NOTFOUNDMODULE name: 'BUFGCE'
   12 |   BUFGCE u_bufgce (
      |          ^~~~~~~~
                       ... Use "/* verilator lint_off DECLFILENAME */" and lint_on around source to disable this message.
%Warning-DECLFILENAME: ../../../vendor/lowrisc_ip/prim_xilinx/rtl/prim_xilinx_clock_mux2.sv:17:11: Filename 'prim_xilinx_clock_mux2' does not match NOTFOUNDMODULE name: 'BUFGMUX'
   17 |   BUFGMUX bufgmux_i (
      |           ^~~~~~~~~
%Warning-DECLFILENAME: ../../../vendor/lowrisc_ip/prim_xilinx/rtl/prim_xilinx_pad_wrapper.sv:36:9: Filename 'prim_xilinx_pad_wrapper' does not match NOTFOUNDMODULE name: 'IOBUF'
   36 |   IOBUF i_iobuf (
      |         ^~~~~~~
```

This is due to verilator/verilator#2430. Until
the issue is fixed, disable this lint error.

Signed-off-by: Philipp Wagner <phw@lowrisc.org>
imphil added a commit to lowRISC/opentitan that referenced this issue Jul 3, 2020
When running Verilator lint with blackboxed modules, we get warnings
like the ones below:

```
%Warning-DECLFILENAME: ../../../vendor/lowrisc_ip/prim_xilinx/rtl/prim_xilinx_clock_gating.sv:12:10: Filename 'prim_xilinx_clock_gating' does not match NOTFOUNDMODULE name: 'BUFGCE'
   12 |   BUFGCE u_bufgce (
      |          ^~~~~~~~
                       ... Use "/* verilator lint_off DECLFILENAME */" and lint_on around source to disable this message.
%Warning-DECLFILENAME: ../../../vendor/lowrisc_ip/prim_xilinx/rtl/prim_xilinx_clock_mux2.sv:17:11: Filename 'prim_xilinx_clock_mux2' does not match NOTFOUNDMODULE name: 'BUFGMUX'
   17 |   BUFGMUX bufgmux_i (
      |           ^~~~~~~~~
%Warning-DECLFILENAME: ../../../vendor/lowrisc_ip/prim_xilinx/rtl/prim_xilinx_pad_wrapper.sv:36:9: Filename 'prim_xilinx_pad_wrapper' does not match NOTFOUNDMODULE name: 'IOBUF'
   36 |   IOBUF i_iobuf (
      |         ^~~~~~~
```

This is due to verilator/verilator#2430. Until
the issue is fixed, disable this lint error.

Signed-off-by: Philipp Wagner <phw@lowrisc.org>
@wsnyder wsnyder added resolution: fixed Closed; fixed and removed status: ready Issue is ready for someone to fix; then goes to 'status: assigned' labels Aug 22, 2020
@wsnyder wsnyder closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

3 participants