Skip to content

Commit 859f5aa

Browse files
authored
Update README.md
1 parent 4ad8cad commit 859f5aa

File tree

1 file changed

+38
-111
lines changed

1 file changed

+38
-111
lines changed

README.md

Lines changed: 38 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Overview
2-
This repository is a collection of HDL related tools.
2+
This repository contains a fast VHDL language server and analysis library written in Rust.
33

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.
56

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)
88

99
[![Join the chat at https://gitter.im/rust_hdl/Lobby](https://badges.gitter.im/rust_hdl/Lobby.svg)](https://gitter.im/rust_hdl/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1010
[![Build Status](https://github.com/kraigher/rust_hdl/workflows/Build%20%26%20test%20all%20configs/badge.svg)](https://github.com/kraigher/rust_hdl/actions?query=workflow%3A%22Build+%26+test+all+configs%22)
1111

1212
# Projects
13+
## VHDL Language Server
14+
[![vhdl ls crate](https://img.shields.io/crates/v/vhdl_ls.svg)](https://crates.io/crates/vhdl_ls)
15+
### Goals
16+
- A complete VHDL language server protocol implementation with diagnostics, navigate to symbol, find all references etc.
17+
18+
### Status
19+
- Publishes diagnosics based on parse errors and warnings as well as semantic analysis.
20+
- Usable today to get full live syntax error checking.
21+
- Checks for missing and duplicate declarations
22+
- Supports goto-definition/declaration for non-overloaded items
23+
- Supports find-references for non-overloaded items
24+
1325
## VHDL Language Frontend
1426
[![vhdl language frontend crate](https://img.shields.io/crates/v/vhdl_lang.svg)](https://crates.io/crates/vhdl_lang)
1527
### Goals
@@ -19,76 +31,37 @@ You can start contributing by reading the [Contributors Guide](https://github.co
1931
- Comments will be part of the AST to support document generation.
2032
- Separate parsing from semantic analysis to allow code formatting on non-semantically correct code.
2133

22-
### Current status
23-
- Almost all of VHDL-2008 is parsed, enough to parse the most popular VHDL projects on GitHub:
24-
- https://github.com/VUnit/vunit
25-
- https://github.com/OSVVM/OSVVM
26-
- https://github.com/UVVM/UVVM
27-
- https://github.com/VLSI-EDA/PoC
28-
- https://github.com/FPHDL/fphdl/
29-
- https://github.com/inforichland/freezing-spice (Contains one file with actual syntax error)
30-
- https://github.com/sergeykhbr/riscv_vhdl
31-
- https://github.com/fabioperez/space-invaders-vhdl
32-
- https://github.com/BG2BKK/img_process_vhdl (Contains one file with actual syntax error)
33-
- https://github.com/kevinpt/vhdl-extras
34-
- https://github.com/xesscorp/VHDL_Lib
35-
- Also parses IEEE/IEEE_2008/VITAL_95/VITAL_2000
36-
- Good performance, can parse 440k lines of code (all repos above) in 500 ms on my laptop which is 45.5 MB/s of parsing throughput.
37-
- Provides nice error messages such as:
38-
```
39-
error: Expected 'use', 'type', 'subtype', 'shared', 'constant', 'signal', 'variable', 'file', 'component', 'attribute', 'alias', 'impure', 'function', 'procedure', 'package' or 'for'
40-
--> example.vhd:19
41-
|
42-
17 | package pkg2 is
43-
18 | constant foo : natural := 22;
44-
19 --> error
45-
| ~~~~~
46-
20 | end package;
47-
21 |
48-
```
34+
## Trying it out
35+
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.
4936

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
6339

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
6642

67-
## VHDL Language Server
68-
[![vhdl ls crate](https://img.shields.io/crates/v/vhdl_ls.svg)](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)
7150
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.
75-
- Checks for missing and duplicate declarations
76-
- Supports goto-definition/declaration
77-
- Supports find-references
51+
; Required unless vhdl_ls is on the $PATH
52+
(setq lsp-vhdl-server-path "${PATH_TO_RUST_HDL}/target/release/vhdl_ls")
7853
79-
## Trying it out
80-
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))
8257
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))
8761
```
8862

8963
### 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`.
9265

9366
`vhdl_ls` will load configuration files in the following order of priority (first to last):
9467
1. A file named `.vhdl_ls.toml` in the user home folder.
@@ -111,49 +84,3 @@ lib1.files = [
11184
]
11285
```
11386

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`.
118-
Just add the following to your `.emacs.el`:
119-
```elisp
120-
(require 'use-package)
121-
122-
; Required unless vhdl_ls is on the $PATH
123-
(setq lsp-vhdl-server-path "${PATH_TO_RUST_HDL}/target/release/vhdl_ls")
124-
125-
; Prefer vhdl_ls over other VHDL language servers
126-
(custom-set-variables
127-
'(lsp-vhdl-server 'vhdl-ls))
128-
129-
(use-package lsp-mode
130-
:config
131-
(add-hook 'vhdl-mode-hook 'lsp))
132-
```
133-
134-
### Use in Atom
135-
https://github.com/mbrobbel/atom-ide-vhdl
136-
137-
### Use in VSCode
138-
https://github.com/Bochlin/rust_hdl_vscode
139-
140-
# Collaboration
141-
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

Comments
 (0)