vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.31k stars 1.14k forks source link

Add support for SystemVerilog #2183

Closed minecraft2048 closed 6 years ago

minecraft2048 commented 6 years ago

Both Verilog linters (Verilator, Icarus Verilog) that syntastic uses supports at least some SystemVerilog, and the only thing that stops .sv file from being checked by both of them is that .sv file extension

lcd047 commented 6 years ago

Syntastic doesn't care about file extensions.

minecraft2048 commented 6 years ago

Well this happens:

counter-ex.sv and counter-ex.v:

//Toggle flip flop
`ifndef COUNTER_SV
`define COUNTER_SV

`default_nettype none

module tff (q, clk, reset);

    output reg q;
    input clk, reset;

    always @(posedge reset or posedge clk) begin
        if (reset) begin
            q <= 1'b0;
        end else begin
            q <= ~q;
        end
    end
endmodule

`endif

If I run :SyntasticInfo on counter-ex.sv:

Syntastic version: 3.9.0-6 (Vim 801, Linux)
Info for filetype: systemverilog
Global mode: active
Filetype systemverilog is active
The current file will be checked automatically
Available checkers: -
Currently enabled checkers: -
Press ENTER or type command to continue

If I rename counter-ex.sv to counter-ex.v and run :SyntasticInfo on counter-ex.v:

Syntastic version: 3.9.0-6 (Vim 801, Linux)
Info for filetype: verilog
Global mode: active
Filetype verilog is active
The current file will be checked automatically
Available checkers: iverilog verilator
Currently enabled checker: verilator
Press ENTER or type command to continue

So the thing that prevents syntastic from checking it is that .sv instead of .v

lcd047 commented 6 years ago

That's the expected behavior:

Please see #2088.

73725f78 commented 3 years ago

https://www.vim.org/scripts/script.php?script_id=5859