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

[BUG] Incorrect Diagnose Message Range of Verilator Linter #156

Open
qrqiuren opened this issue May 31, 2021 · 0 comments
Open

[BUG] Incorrect Diagnose Message Range of Verilator Linter #156

qrqiuren opened this issue May 31, 2021 · 0 comments

Comments

@qrqiuren
Copy link

qrqiuren commented May 31, 2021

For the following source code:

// File: warning_example.sv

// Must turn on -Wall while linting.

module warning_example(
    output logic [5:0] dout, input logic [5:0] din
);

logic [5:0] areg, b, c;

assign c = din;
assign b = c;

endmodule

I got such warnings from Verilator (with -Wall flag):

$ verilator --lint-only -Wall warning_example.sv
%Warning-UNDRIVEN: warning_example.sv:6:24: Signal is not driven: 'dout'
                                          : ... In instance warning_example
    6 |     output logic [5:0] dout, input logic [5:0] din
      |                        ^~~~
                   ... For warning description see https://verilator.org/warn/UNDRIVEN?v=4.202
                   ... Use "/* verilator lint_off UNDRIVEN */" and lint_on around source to disable this message.
%Warning-UNUSED: warning_example.sv:9:13: Signal is not driven, nor used: 'areg'
                                        : ... In instance warning_example
    9 | logic [5:0] areg, b, c;
      |             ^~~~
%Warning-UNUSED: warning_example.sv:9:19: Signal is not used: 'b'
                                        : ... In instance warning_example
    9 | logic [5:0] areg, b, c;
      |                   ^
%Error: Exiting due to 3 warning(s)
$

I added "verilog.linting.iverilog.arguments": "-Wall" in my VS code config to see all warnings.

However, the warning message shows as the following in my VS Code:

warning_example_sv

In the above picture, every warning message has been marked from the correct starting position to the end of the line. I hope the message position can be correctly shown.

I have probably located the problem in the following position. It simply uses the max number to indicate the end of the message.

range: new Range(lineNum, colNum, lineNum, Number.MAX_VALUE),

I think we can use marks like ^~~~ to indicate the correct ending position of the warning message.

Sorry that I don't know how to debug TypeScript, so I don't know how to fix it at this moment.

@qrqiuren qrqiuren changed the title [Bug] Incorrect Diagnose Message Range of Verilator Linter [BUG] Incorrect Diagnose Message Range of Verilator Linter Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant