Closed chrbirks closed 3 years ago
Wondering if the cache is corrupted somehow. Can you please try deleting the .emacs/.svlangserver directory in your workspace folder and then re-invoking emacs ? Do you see any errors in the lsp-log on the first invocation after deletion of cache?
Thanks
No I get the same error after deleting .emacs. Here is the output of lsp-log (but opening a file in a folder with fewer source files than before)
Command "/usr/bin/svlangserver" is present on the path.
Command "hdl_checker --lsp" is present on the path.
Command "/usr/bin/svlangserver" is present on the path.
Command "hdl_checker --lsp" is present on the path.
Found the following clients for /home/cbs/tmp/sv/crc32_8.sv: (server-id svlangserver, priority -1), (server-id lsp-verilog, priority -2)
The following clients were selected based on priority: (server-id svlangserver, priority -1)
This server does not support foldingRangeProvider
INFO: settings[systemverilog.includeIndexing] = **/*.{sv,svh}
INFO: settings[systemverilog.excludeIndexing] = test/**/*.{sv,svh}
INFO: settings[systemverilog.launchConfiguration] = /usr/bin/verilator -sv --lint-only -Wall
INFO: settings[systemverilog.defines] =
INFO: settings[systemverilog.lintOnUnsaved] = true
INFO: settings[systemverilog.formatCommand] = /usr/bin/verible-verilog-format
INFO: settings[systemverilog.disableCompletionProvider] = false
INFO: settings[systemverilog.disableHoverProvider] = false
INFO: settings[systemverilog.disableSignatureHelpProvider] = false
INFO: settings[systemverilog.disableLinting] = false
INFO: Indexing 6 files ...
INFO: Done indexing 8 files!!!
INFO: Took 333.5421319976449 milliseconds
I looked into if it's a specific one of my source files that is causing the error but it doesn't seem like it. I reduced my source catalog to two files that individually doesn't cause the error, but when both present it happens. I don't have them uploaded anywhere but I can paste them below in case you want to try and reproduce the error.
common_pkg.sv
package common_pkg;
parameter TEST_PARAM = 12;
int test_int = 14;
typedef struct packed {
logic a;
logic b;
} mytype2_t;
endpackage // common_pkg
testmodules.sv
`include "common_pkg.sv";
import common_pkg::*;
module testmodule (
input logic clk_i,
input [$clog2(TEST_PARAM)-1:0] aa_i,
input logic a_i,
output logic [1:0] b_o
);
mytype2_t my;
initial begin
my.a = 0;
my.b = 0;
end
always @(posedge clk_i) begin
undeclared_var <= 1'b1;
my.a <= 1'b1;
my.b <= 1'b1;
end
logic undeclared_var;
always_comb begin
tmpa = tmpb;
tmpb = 1;
end
logic tmpa;
logic tmpb;
endmodule // testmodule
Thanks. I will check this out on my end.
May I ask why the common_pkg.sv is being included at the top? This will cause the tool to lint that file twice.
If you exclude the common_pkg.sv from indexing (using the systemverilog.excludeIndexing setting), does that cause the error to go away?
These files are just a collection of SystemVerilog files I keep to test with different language servers and Emacs configurations. I didn't write all of them myself and some might even contain syntax errors. But from your comment it looks like it's triggered by common_pkg being included twice. If I delete the first line of testmodules.sv with `include I don't get the error anymore.
That is a good confirmation that the double linting might be an issue. I will look into fixing the error. Meanwhile hopefully this workaround is ok for you. Thanks
Fixed in 0.3.4 release.
Hi I ran into a fatal error when trying to get svlangserver up and running on Emacs with lsp-mode. The error happens for all SystemVerilog files shortly after the file is opened in Emacs and lsp-mode tries to run the server. Maybe you have an idea to what the problem is based on the logs from Emacs below.
svlangserver::stderr
lsp-log
Messages
Software versions
init.el