vscode-verilog-hdl-support icon indicating copy to clipboard operation
vscode-verilog-hdl-support copied to clipboard

[BUG] Import of package not possible

Open stu-e opened this issue 2 years ago • 2 comments

Where file B imports a package from file A there is no way to tell the lint tool where to find the package file A, then compile file A before compiling file B.

Example:

File mystuff.sv

package mystuff;
    localparam MYDEF = 1234;
endpackage

File mygadget.sv

import mystuff::*;
module mygadget (
    output logic [7:0] constant
);
assign constant = 8'(MYDEF);
endmodule

The lint tool will always highlight the import statement because it is undeclared. This is a problem because every file that imports a package is highlighted in red making it impossible to spot files that have syntax errors.

stu-e avatar Feb 13 '23 19:02 stu-e

Having the same issue. How can I add packages to my linting path? Im using vivado as my linter.

code-tangent avatar Feb 20 '23 22:02 code-tangent

@stu-e @code-tangent This is resolved on https://github.com/AndrewNolte/vscode-system-verilog. If the package name matches the file name, it'll pick it up in the file index. But if it's a single project you could also pass it to verilog.lint.xvlog.args

AndrewNolte avatar Apr 24 '24 03:04 AndrewNolte