vivekmalneedi / veridian Goto Github PK
View Code? Open in Web Editor NEWA SystemVerilog Language Server
License: MIT License
A SystemVerilog Language Server
License: MIT License
This is just an fyi that Henner Zeller [email protected] (@hzeller), the tech lead for the Verible project, has added language server support directly into the Verible project recently.
See https://chipsalliance.github.io/verible/README.html#language-server and https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls
There is an older talk about Henner's work from WOSET at https://woset-workshop.github.io/WOSET2021.html#systemverilog-ide-integration-with-verible-language-server-support
I see that you are supporting both slang and verible together, so it might make sense to still continue development, but I stumbled across your project and wanted to keep you informed about things that are happening.
I'm interested in running veridian along with neovim, but instead of coc.nvim, most configuration frameworks are now using nvim-lspconfig for managing lsp. I'm wondering if a default configuration could be added for veridian to nvim-lspconfig.
Hi Vivek,
before describing the issue I encountered let me first mention that I really like the project so far, good job! It kind of motivates me to (seriously) learn Rust so that I can implement and contribute some improvement ideas that I already have. ๐
Anyway, back to topic, I experimented with veridian and vscode on an old repository and observed that I could crash the language server (built from current master) quite reliably. The action that I perform is nothing sophisticated. I simply start adding a new port to the vscale_mul_div instance and then deleting everything again.
I more detail, the sequence that leads to the crash for me is something like the following:
,
enter
.
(completion appears)shift+Pos1 shift+Pos1
backspace
twice (crash occurs usually on the first backspace
)I tested this with two different builds of the language server (one native windows build, and with a Ubuntu 20.04 build running in WSL) and both showed similar crashes.
# list of directories with header files
include_dirs:
- src/main/verilog
# list of directories to recursively search for SystemVerilog/Verilog sources
source_dirs:
- src/main/verilog
log_level: Debug
DEBUG [veridian::sources] try write global scope
DEBUG [veridian::sources] did_change: file:///c%3A/Users/Mario/HDL/vscale/src/main/verilog/vscale_pipeline.v
DEBUG [veridian::sources] parse complete of file:///c%3A/Users/Mario/HDL/vscale/src/main/verilog/vscale_pipeline.v
DEBUG [veridian::sources] try write global scope
DEBUG [veridian::sources] did_change: file:///c%3A/Users/Mario/HDL/vscale/src/main/verilog/vscale_pipeline.v
thread 'main' panicked at 'Attempt to index past end of Rope: byte index 14714, Rope byte length 14694', C:\Users\Mario\.cargo\registry\src\github.com-1ecc6299db9ec823\ropey-1.2.0\src\rope.rs:743:9
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53\/library\std\src\panicking.rs:493
1: std::panicking::begin_panic_fmt
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53\/library\std\src\panicking.rs:435
2: <ropey::rope::Rope as veridian::sources::LSPSupport>::byte_to_pos
3: veridian::definition::def_types::Scope::document_symbols
4: veridian::definition::<impl veridian::server::LSPServer>::document_symbol
5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
8: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
9: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
10: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
11: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
12: futures_util::stream::stream::StreamExt::poll_next_unpin
13: futures_util::stream::stream::StreamExt::poll_next_unpin
14: <futures_util::stream::stream::filter_map::FilterMap<St,Fut,F> as futures_core::stream::Stream>::poll_next
15: <futures_util::stream::select::Select<St1,St2> as futures_core::stream::Stream>::poll_next
16: <futures_util::stream::stream::forward::Forward<St,Si,Item> as core::future::future::Future>::poll
17: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
18: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
19: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
20: tokio::park::thread::CachedParkThread::block_on
21: tokio::runtime::thread_pool::ThreadPool::block_on
22: structopt::StructOpt::from_args
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info - 22:50:38] Connection to server got closed. Server will restart.
[Error - 22:50:38] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\connection.js:1044:27)
at Object.dispose (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-languageclient\lib\common\client.js:73:35)
at LanguageClient.handleConnectionClosed (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-languageclient\lib\common\client.js:2424:42)
at LanguageClient.handleConnectionClosed (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-languageclient\lib\node\main.js:155:15)
at closeHandler (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-languageclient\lib\common\client.js:2411:18)
at CallbackList.invoke (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\events.js:55:39)
at Emitter.fire (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\events.js:117:36)
at closeHandler (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\connection.js:256:26)
at CallbackList.invoke (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\events.js:55:39)
at Emitter.fire (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\events.js:117:36)
at StreamMessageReader.fireClose (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\messageReader.js:40:27)
at Socket.<anonymous> (c:\Users\Mario\.vscode\extensions\vivekmalneedi.veridian-0.1.0\node_modules\vscode-jsonrpc\lib\common\messageReader.js:125:42)
at Socket.emit (events.js:327:22)
at Pipe.<anonymous> (net.js:673:12)
INFO [veridian] starting veridian...
Any idea on what is going wrong here or is there any other information I can/should provide to find the issue?
Best regards,
Mario
It seems that the verible-verilog-format
does not work according to the new veridian.yml
file without restarting the neovim(normally the formatter should work for me just when saving the file)
after I modified the args under format option. It will be great if the config file can be updated at any time. I really like this LSP
and I need it.
Thanks for your efforts!
Hi, I was looking for a SystemVerilog LSP and I found it. Thank you for your effort.
I am now using Veridian with Verible support. But not sure how to set a default path without veridian.yml
.
Is there any way to set the default path for verible?
Thank you again.
Add a config setting to specify the verible-verilog-format flags.
E.g.:
verible_flags: --net_variable_alignment=align
(BTW: thanks for creating this, just what I was looking for :) )
I'm trying to get the dot completion working like in the asciinema example, but I am getting strange results.
Test case:
interface simple_bus (
input logic clk
);
logic req;
modport slave(input req);
endinterface
module test;
logic clk;
simple_bus bus(. // <-- completing here
endmodule
The only completion option veridian is giving me is simple_bus Interface interface
.
I am using the nvim builtin LSP with completion-nvim plugin, so I may just have a wrong setting here.
I am on version 97ba4a3
Hello,
can you update the lexical-core dependency to 0.7.6?
With rustc 1.66.0 (69f9c33d7 2022-12-12) I get this error:
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `lexical-core` due to 27 previous errors
With updated lexical-core it compiles but 2 cargo tests fail:
failures:
---- diagnostics::tests::test_diagnostics stdout ----
thread 'diagnostics::tests::test_diagnostics' panicked at 'assertion failed: `(left == right)`
left: `PublishDiagnosticsParams { uri: Url { scheme: "file", host: None, port: None, path: "/home/edo/.local/share/nvim/veridian/test_data/diag/diag_test.sv", query: None, fragment: None }, diagnostics: [], version: None }`,
right: `PublishDiagnosticsParams { uri: Url { scheme: "file", host: None, port: None, path: "/home/edo/.local/share/nvim/veridian/test_data/diag/diag_test.sv", query: None, fragment: None }, diagnostics: [Diagnostic { range: Range { start: Position { line: 3, character: 13 }, end: Position { line: 3, character: 13 } }, severity: Some(Error), code: None, code_description: None, source: Some("slang"), message: " cannot refer to element 2 of 'logic[1:0]'", related_information: None, tags: None, data: None }], version: None }`', src/diagnostics.rs:252:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- diagnostics::tests::test_verible_syntax stdout ----
thread 'diagnostics::tests::test_verible_syntax' panicked at 'called `Option::unwrap()` on a `None` value', src/diagnostics.rs:285:74
failures:
diagnostics::tests::test_diagnostics
diagnostics::tests::test_verible_syntax
test result: FAILED. 19 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s
I also tried to update everything and run cargo test --all-features, there is only one failing:
failures:
---- diagnostics::tests::test_verible_syntax stdout ----
thread 'diagnostics::tests::test_verible_syntax' panicked at 'called `Option::unwrap()` on a `None` value', src/diagnostics.rs:285:74
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
diagnostics::tests::test_verible_syntax
test result: FAILED. 20 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.14s
Thanks
I had no idea this project exists until people told me about it, because I couldn't find it when I searched for Verilog in the store.
It would be awesome if this extension got added to the collection there!
Is it possible to add renaming support?
Since updating to the latest version I am not getting any slang messages/errors anymore.
testcase:
// test.sv
module oink #(
parameter param
) (
input logic data
);
endmodule
module foo ();
oink #(.pram(1)) inst_foo (.data(bar));
int bar;
endmodule
which produces the following errors when passing through slang (slang test.sv
):
Running slang in /home/zegervdv/test with args test.sv
Top level design units:
foo
test.sv:9:3: error: instance of 'oink' does not provide a value for parameter 'param' and it does not have a default value
oink #(.pram(1)) inst_foo (.data(bar));
^
test.sv:9:11: error: parameter 'pram' does not exist in 'oink'
oink #(.pram(1)) inst_foo (.data(bar));
^
test.sv:9:36: error: identifier 'bar' used before its declaration
oink #(.pram(1)) inst_foo (.data(bar));
^~~
test.sv:11:7: note: declared here
int bar;
^
Build failed: 3 errors, 0 warnings
I have compiled with --all-features
, but I am not seeing the errors in LSP anymore.
It worked for me on 908945e
For now, veridian
just supports to go to definition
in the current file, but does not support to jump in the whole wordspace. https://github.com/imc-trading/svlangserver supports to go to definition/symbol in the whole workspace folder
. So now I use veridian
and svlangserver
as my verilog/systemveilog LSP simultaneously. I hope veridian
can support this feature.
Thanks!
Veridian is currently the only SystemVerilog Language Server with autocompletion that works with Vim [as of November 2023], but no releases are available for windows devices. It would be great to have a precompiled windows release so users won't have to install the rust toolchain.
Hello,
I am having a problem, it seems that the completion doesn't work, it works for cpp (clang) for example, so is not lsp config problem, it also didn't work with svls, so far i wasn't able to put a lsp for verilog 100% running.
is shows the errors, auto formatting is working, only the completion is not
Hi there,
I recently discovered that Verilator, as another prevailing open-source System Verilog simv toolchain, provides more informative diagnostics on System Verilog compared to verible-verilog-syntax. Therefore, I believe that adding an option in Veridian to support Verilator as a diagnostic backend would be very beneficial to its users, including myself.
To this end, I have implemented this feature in my pull request, with 3 lint levels that align with Verilator. And I believe this will notably enhance the functionality of Veridian. I kindly request that you test my implementation and provide any feedback or suggestions for improvement.
Thank you for considering my request.
Cheers,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.