aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/doc/ale-verilog.txt
blob: c923e2bed2baa8e9775af3a91532b38674efaad5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
===============================================================================
ALE Verilog/SystemVerilog Integration                     *ale-verilog-options*


===============================================================================
ALE can use eight different linters for Verilog HDL:

  HDL Checker
    Using `hdl_checker --lsp`

  iverilog:
    Using `iverilog -t null -Wall`

  slang:
    Using `slang -Weverything`

  verible_ls
    Using `verible-verilog-ls`

  verilator
    Using `verilator --lint-only -Wall`

  ModelSim/Questa
    Using `vlog -quiet -lint`

  Vivado
    Using `xvlog`

  Yosys
    Using `yosys -Q -T -p 'read_verilog'`

By default, both 'verilog' and 'systemverilog' filetypes are checked.

You can limit 'systemverilog' files to be checked using only 'verilator' by
defining 'g:ale_linters' variable: >

    au FileType systemverilog
    \ let g:ale_linters = {'systemverilog' : ['verilator'],}
<

===============================================================================
ALE can use one fixer for Verilog HDL:


  verible_fomat
    Using `verible-verilog-format`
===============================================================================
General notes

Linters/compilers that utilize a "work" directory for analyzing designs- such
as ModelSim and Vivado- can be passed the location of these directories as
part of their respective option strings listed below. This is useful for
holistic analysis of a file (e.g. a design with components, packages, or other
code defined external to the current file as part of a larger project) or
when wanting to simply pass an alternative location for the auto-generated
work directories (such as '/tmp') so as to not muddle the current directory.
Since these type of linters often use this work directory for holding compiled
design data as part of a single build process, they sometimes cannot handle
the frequent, asynchronous application launches when linting while text is
changing. This can happen in the form of hangs or crashes. To help prevent
this when using these linters, it may help to run linting less frequently; for
example, only when a file is saved.

HDL Checker is an alternative for some of the issues described above. It wraps
around ghdl, Vivado and ModelSim/Questa and, when using the latter, it can
handle mixed language (VHDL, Verilog, SystemVerilog) designs.

===============================================================================
hdl-checker                                           *ale-verilog-hdl-checker*

See |ale-vhdl-hdl-checker|


===============================================================================
iverilog                                                 *ale-verilog-iverilog*

  No additional options

===============================================================================
slang                                                       *ale-verilog-slang*

                                            *ale-options.verilog_slang_options*
                                                  *g:ale_verilog_slang_options*
                                                  *b:ale_verilog_slang_options*
verilog_slang_options
g:ale_verilog_slang_options
  Type: |String|
  Default: `''`

  This variable can be changed to modify 'slang' command arguments.

===============================================================================
verible_ls                                             *ale-verilog-verible-ls*

                                     *ale-config.verilog_verible_ls_executable*
                                          *g:ale_verilog_verible_ls_executable*
                                          *b:ale_verilog_verible_ls_executable*
verilog_verible_ls_executable
g:ale_verilog_verible_ls_executable
  Type: |String|
  Default: `'verible-verilog-ls'`

  This variable can be modifies to change the executable path for `verible_ls`

                                         *ale-config.verilog_verible_ls_config*
                                              *g:ale_verilog_verible_ls_config*
                                              *b:ale_verilog_verible_ls_config*
verilog_verible_ls_config
g:ale_verilog_verible_ls_config
  Type: |Dictionary|
  Default: `{}`

  Dictionary with configuration settings for `verible_ls`

                                        *ale-config.verilog_verible_ls_options*
                                             *g:ale_verilog_verible_ls_options*
                                             *b:ale_verilog_verible_ls_options*
verilog_verible_ls_options
g:ale_verilog_verible_ls_options
  Type: |String|
  Default: `'--rules_config_search'`

  Additional flags for `verible_ls`

                                          *ale-config.verilog_verible_ls_rules*
                                               *g:ale_verilog_verible_ls_rules*
                                               *b:ale_verilog_verible_ls_rules*
verilog_verible_ls_rules
g:ale_verilog_verible_ls_rules
  Type: |String|
  Default: `''`

  Additional rules applied by `verible_ls`

===============================================================================
verible_format                                     *ale-verilog-verible-format*

                                 *ale-config.verilog_verible_format_executable*
                                      *g:ale_verilog_verible_format_executable*
                                      *b:ale_verilog_verible_format_executable*
verilog_verible_format_executable
g:ale_verilog_verible_format_executable
  Type: |String|
  Default: `'verible-verilog-format'`

  This variable can be modifies to change the executable path for
  `verible_format`

                                    *ale-config.verilog_verible_format_options*
                                         *g:ale_verilog_verible_format_options*
                                         *b:ale_verilog_verible_format_options*
verilog_verible_format_options
g:ale_verilog_verible_format_options
  Type: |String|
  Default: `''`

  Additional flags for `verible_format`
===============================================================================

verilator                                               *ale-verilog-verilator*

                                        *ale-options.verilog_verilator_options*
                                              *g:ale_verilog_verilator_options*
                                              *b:ale_verilog_verilator_options*
verilog_verilator_options
g:ale_verilog_verilator_options
  Type: |String|
  Default: `''`

  This variable can be changed to modify 'verilator' command arguments.

  For example `'-sv --default-language "1800-2012"'` if you want to enable
  SystemVerilog parsing and select the 2012 version of the language.


===============================================================================
vlog                                                         *ale-verilog-vlog*

                                          *ale-options.verilog_vlog_executable*
                                                *g:ale_verilog_vlog_executable*
                                                *b:ale_verilog_vlog_executable*
verilog_vlog_executable
g:ale_verilog_vlog_executable
  Type: |String|
  Default: `'vlog'`

  This variable can be changed to the path to the 'vlog' executable.

                                             *ale-options.verilog_vlog_options*
                                                   *g:ale_verilog_vlog_options*
                                                   *b:ale_verilog_vlog_options*
verilog_vlog_options
g:ale_verilog_vlog_options
  Type: |String|
  Default: `'-quiet -lint'`

  This variable can be changed to modify the flags/options passed to 'vlog'.


===============================================================================
xvlog                                                       *ale-verilog-xvlog*

                                         *ale-options.verilog_xvlog_executable*
                                               *g:ale_verilog_xvlog_executable*
                                               *b:ale_verilog_xvlog_executable*
verilog_xvlog_executable
g:ale_verilog_xvlog_executable
  Type: |String|
  Default: `'xvlog'`

  This variable can be changed to the path to the 'xvlog' executable.

                                            *ale-options.verilog_xvlog_options*
                                                  *g:ale_verilog_xvlog_options*
                                                  *b:ale_verilog_xvlog_options*
verilog_xvlog_options
g:ale_verilog_xvlog_options
  Type: |String|
  Default: `''`

  This variable can be changed to modify the flags/options passed to 'xvlog'.


===============================================================================
yosys                                                       *ale-verilog-yosys*

                                         *ale-options.verilog_yosys_executable*
                                               *g:ale_verilog_yosys_executable*
                                               *b:ale_verilog_yosys_executable*
verilog_yosys_executable
g:ale_verilog_yosys_executable
  Type: |String|
  Default: `'yosys'`

  This variable can be changed to the path to the 'yosys' executable.

                                            *ale-options.verilog_yosys_options*
                                                  *g:ale_verilog_yosys_options*
                                                  *b:ale_verilog_yosys_options*
verilog_yosys_options
g:ale_verilog_yosys_options
  Type: |String|
  Default: `'-Q -T -p ''read_verilog %s'''`

  This variable can be changed to modify the flags/options passed to 'yosys'.
  By default, Yosys is an interactive program. To obtain linting functionality,
  the `'read_verilog'` command is used.


===============================================================================
  vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: