You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository is a collection of HDL related tools.
2
+
This repository contains a fast VHDL language server and analysis library written in Rust.
3
3
4
-
**NOTE**: These tools are at a usable state however they are still intensively developed and thus they are currently only recommended to be used by early adopters and people interested in contributing to the development.
4
+
The speed makes the tool very pleasant to use since it loads projects really fast and does not consume a lot of ram.
5
+
A 200.000 line VHDL project is analyzed in 160 ms on my Desktop using 8 cores and only consumes 180 MByte of RAM when loaded.
5
6
6
-
I am interested in [collaboration](#Collaboration) with other people especially regarding semantic analysis of VHDL.
7
-
You can start contributing by reading the [Contributors Guide](https://github.com/kraigher/rust_hdl/wiki/Contributor-Guide)
7
+
I very much appreciate help from other people especially regarding semantic analysis of VHDL. You do not need to be a programmer to help, it is even more helpful to interpret and clarify the VHDL standard and provide minimal examples and describe how t hey should work according to the standard. Further information about contributing can be found by reading the [Contributors Guide](https://github.com/kraigher/rust_hdl/wiki/Contributor-Guide)
8
8
9
9
[](https://gitter.im/rust_hdl/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A language server is never used directly by the end user and it is integrated into different editor plugins. The ones I know about are listed here.
49
36
50
-
- The parser is a using hand written recursive descent since VHDL is not suitable for parser generators.
51
-
- Error recovery is still very rudimentary.
52
-
- Semantic analysis is ongoing work, currently checks for:
53
-
- Legal primary/secondary design unit combinations
54
-
- Duplicate design units
55
-
- Secondary units without primary unit
56
-
- Duplicate definitions in declarative parts
57
-
- Forbids overloaded name to co-exist with non-overloaded name
58
-
- Missing full constant for deferred constant
59
-
- Missing full type for deferred type
60
-
- Missing body for protected type and vice versa
61
-
- Missing declarations in type marks of most subtype indications
62
-
- Comments not part of AST yet.
37
+
## Use in VSCode
38
+
https://github.com/Bochlin/rust_hdl_vscode
63
39
64
-
## Trying it out
65
-
The VHDL language frontend has a command line demonstrator which will parse a list of files and print syntax and analysis errors. The command line tool currently only serves as a demonstrator and has no intended usability at this point.
40
+
## Use in Atom
41
+
https://github.com/mbrobbel/atom-ide-vhdl
66
42
67
-
## VHDL Language Server
68
-
[](https://crates.io/crates/vhdl_ls)
69
-
### Goals
70
-
- A complete VHDL language server protocol implementation with diagnostics, navigate to symbol, find all references etc.
43
+
## Use in emacs
44
+
### lsp-mode
45
+
VHDL LS has built-in support by emacs `lsp-mode` since 2020-01-04.
46
+
The only thing required is to configure the path to the `vhdl_ls` binary unless it is added to the `$PATH`.
47
+
Just add the following to your `.emacs.el`:
48
+
```elisp
49
+
(require 'use-package)
71
50
72
-
### Status
73
-
- Publishes diagnosics based on parse errors and warnings as well as semantic analysis.
74
-
- Usable today to get full live syntax error checking.
The language server has a command line binary `vhdl_ls` which implements a stdio based language server.
81
-
This repository includes a medium sized example [project](example_project/README.md) which can be used to trying out the language server.
54
+
; Prefer vhdl_ls over other VHDL language servers
55
+
(custom-set-variables
56
+
'(lsp-vhdl-server 'vhdl-ls))
82
57
83
-
### Building
84
-
```console
85
-
> cd rust_hdl
86
-
> cargo build --release
58
+
(use-package lsp-mode
59
+
:config
60
+
(add-hook 'vhdl-mode-hook 'lsp))
87
61
```
88
62
89
63
### Configuration
90
-
The language server uses a configuration file in the [TOML](https://github.com/toml-lang/toml) format named `vhdl_ls.toml`.
91
-
The file contains the library mapping of all files within the project.
64
+
The language server needs to know your library mapping to perform full analysis of the code. For this it uses a configuration file in the [TOML](https://github.com/toml-lang/toml) format named `vhdl_ls.toml`.
92
65
93
66
`vhdl_ls` will load configuration files in the following order of priority (first to last):
94
67
1. A file named `.vhdl_ls.toml` in the user home folder.
@@ -111,49 +84,3 @@ lib1.files = [
111
84
]
112
85
```
113
86
114
-
### Use in emacs
115
-
#### lsp-mode
116
-
VHDL LS has built-in support by emacs `lsp-mode` since 2020-01-04.
117
-
The only thing required is to configure the path to the `vhdl_ls` binary unless it is added to the `$PATH`.
My hope is that other people will be interested in this project and contribute.
142
-
143
-
Some rules for collaboration:
144
-
- Contributions will have to assign copyright to me. Copyright is not about attribution or recognition it is about legal control of a project. Having several independent copyright holders in a project makes future changes difficult.
145
-
- I will add a list of notable contributors to the project to assign recognition.
146
-
- Quality is a priorty. Code has to be elegant and well tested.
147
-
148
-
Collaboration is also hard, you have to communicate with other people to do something coordinated together. Thus to collaborate we need to spend some time discussing *what*, *why* and *how* in GitHub issues or on the chat channel before diving in to the coding. This ensures that we work in the same direction.
149
-
150
-
# Why Rust?
151
-
The tools within this repository have been written in the Rust programming language, thus the name `rust_hdl`.
152
-
The Rust programming language was choosen over Python, C or C++ as the best suited language to write the tools in.
153
-
The main advantages are;
154
-
- Excellent performance
155
-
- Strong modern type system
156
-
- Good libraries and tools
157
-
- Strong community and momentum
158
-
159
-
To install rust and its build tool cargo: https://rustup.rs/
0 commit comments