File: command_line_flags.rst

package info (click to toggle)
iverilog 12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,148 kB
  • sloc: cpp: 109,972; ansic: 62,713; yacc: 10,216; sh: 3,470; vhdl: 3,246; perl: 1,814; makefile: 1,774; python: 78; csh: 2
file content (444 lines) | stat: -rw-r--r-- 16,186 bytes parent folder | download | duplicates (2)
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444


iverilog Command Line Flags
===========================

The iverilog command is the compiler/driver that takes the Verilog input and
generates the output format, whether the simulation file or synthesis
results. This information is at least summarized in the iverilog man page
distributed in typical installations, but here we try to include more detail.

General
-------

These flags affect the general behavior of the compiler.

* -c <cmdfile>
  
  This flag selects the command file to use. The command file is an
  alternative to writing a long command line with a lot of file names and
  compiler flags. See the Command File Format page for more information.

* -d <flag>
  
  Enable compiler debug output. These are aids for debugging Icarus Verilog,
  and this flag is not commonly used.
  The flag is one of these debug classes:
  
  * scope
  * eval_tree
  * elaborate
  * synth2

* -g <generation flag>
  the generation is the compiler language, and specifies the language and
  extensions to use during the compile. The language level can be selected
  by a major level selector, and by controlling various features. Various
  "-g" flags can be compined. For example, to get Verilog 2001 without
  specify supoprt, use "-g2001 -gno-specify".

  The supported flags are:

  * 1995
    
    This flag enables the IEEE1364-1995 standard.

  * 2001
    
    This flag enables the IEEE1364-2001 standard.

  * 2001-noconfig
    
    This flag enables the IEEE1364-2001 standard with config file support
    disabled. This eliminates the config file keywords from the language and
    so helps some programs written to older 2001 support compile.

  * 2005
    This flag enables the IEEE1364-2005 standard. This is default enabled
    after v0.9.

  * 2009
    This flag enables the IEEE1800-2009 standard, which includes
    SystemVerilog. The SystemVerilog support is not present in v0.9 and
    earlier. It is new to git master as of November 2009. Actual SystemVerilog
    support is ongoing.

  * 2012
    
    This flag enables the IEEE1800-2012 standard, which includes
    SystemVerilog.

  * verilog-ams
    
    This flag enables Verilog-AMS features that are supported by Icarus
    Verilog. (This is new as of 5 May 2008.)

  * assertions/supported-assertions/no-assertions
    
    Enable or disable SystemVerilog assertions. When enabled, assertion
    statements are elaborated. When disabled, assertion statements are parsed
    but ignored. The supported-assertions option only enables assertions that
    are currently supported by the compiler.

  * specify/no-specify

    Enable or disable support for specify block timing controls. When
    disabled, specify blocks are parsed but ignored. When enabled, specify
    blocks cause timing path and timing checks to be active.

  * std-include/no-std-include

    Enable or disable the search of a standard installation include directory
    after all other explicit include directories. This standard include
    directory is a convenient place to install standard header files that a
    Verilog program may include.

  * relative-include/no-relative-include

    Enable or disable adding the local files directory to the beginning of the
    include file search path. This allows files to be included relative to the
    current file.

  * xtypes/no-xtypes

    Enable or disable support for extended types. Enabling types allows for
    new types and type syntax that are Icarus Verilog extensions.

  * io-range-error/no-io-range-error

    When enabled the range for a port and any associated net declaration must
    match exactly. When disabled a scalar port is allowed to have a net
    declaration with a range (obsolete usage). A warning message will be
    printed for this combination. All other permutations are still considered
    an error.

  * strict-ca-eval/no-strict-ca-eval

    The standard requires that if any input to a continuous assignment
    expression changes value, the entire expression is re-evaluated. By
    default, parts of the expression that do not depend on the changed input
    value(s) are not re-evaluated. If an expression contains a call to a
    function that doesn't depend solely on its input values or that has side
    effects, the resulting behavior will differ from that required by the
    standard. Enabling strict-ca-eval will force standard compliant behavior
    (with some loss in performance).

  * strict-expr-width/no-strict-expr-width

    Enable or disable strict compliance with the standard rules for
    determining expression bit lengths. When disabled, the RHS of a parameter
    assignment is evaluated as a lossless expression, as is any expression
    containing an unsized constant number, and unsized constant numbers are
    not truncated to integer width.

  * shared-loop-index/no-shared-loop-index

    Enable or disable the exclusion of for-loop control variables from
    implicit event_expression lists. When enabled, if a for-loop control
    variable (loop index) is only used inside the for-loop statement, the
    compiler will not include it in an implicit event_expression list it
    calculates for that statement or any enclosing statement. This allows the
    same control variable to be used in multiple processes without risk of
    entering an infinite loop caused by each process triggering all other
    processes that use the same variable. For strict compliance with the
    standards, this behaviour should be disabled.

* -i

  Ignore missing modules. Normally it is an error if a module instantiation
  refers to an undefined module. This option causes the compiler to skip over
  that instantiation. It will also stop the compiler returning an error if
  there are no top level modules. This allows the compiler to be used to check
  incomplete designs for errors.

  NOTE: The "-i" flag was added in v11.0.

* -L <path>

  Add the specified directory to the path list used to locate VPI modules. The
  default path includes only the install directory for the system.vpi module,
  but this flag can add other directories. Multiple paths are allowed, and the
  paths will be searched in order.

  NOTE: The "-L" flag was added in v11.0.

* -l <path>

  Add the specified file to the list of source files to be compiled, but mark
  it as a library file. All modules contained within that file will be treated
  as library modules, and only elaborated if they are instantiated by other
  modules in the design.

  NOTE: The "-l" flag is new as of 2 October 2016. It will become available in
  releases and snapshots made after that date.

* -M<mode>=<path>

  Write into the file specified by path a list of files that contribute to the
  compilation of the design.

  If _mode_ is *all* or *prefix*, this includes files that are included by
  include directives and files that are automatically loaded by library
  support as well as the files explicitly specified by the user.

  If _mode_ is *include*, only files that are included by include directives
  are listed.

  If _mode_ is *module*, only files that are specified by the user or that are
  automatically loaded by library support are listed. The output is one file
  name per line, with no leading or trailing space.

  If _mode_ is *prefix*, files that are included by include directives are
  prefixed by "I " and other files are prefixed by "M ".

* -m<module>

  Add this module to the list of VPI modules to be loaded by the
  simulation. Many modules can be specified, and all will be loaded, in the
  order specified. The system module is implicit and always included (and
  loaded last).

  If the specified name includes at least one directory character, it is
  assumed to be prefixed by the path to the module, otherwise the module is
  searched for in the paths specified by preceding -L options, and if not
  found there, in the iverilog base directory.

  NOTE: The "-m" flag was added in v11.0.

* -o <path>

  Specify the output file. The <path> is the name of the file to hold the
  output. The default is "a.out".

* -S

  Activate synthesis. This flag tells the compiler to do what synthesis it can
  do before calling the code generator. This flag is rarely used explicitly,
  and certain code generators will implicitly enable this flag.

* -u

  Treat each source file as a separate compilation unit (as defined in
  SystemVerilog). If compiling for an IEEE1364 generation, this will just
  reset all compiler directives (including macro definitions) before each new
  file is processed.

  NOTE: The "-u" flag was added in v11.0.

* -v

  Be verbose. Print copyright information, progress messages, and some timing
  information about various compilation phases.

  (New in snapshots after 2014-12-16) If the selected target is vvp, the -v
  switch is appended to the shebang line in the compiler output file, so
  directly executing the compiler output file will turn on verbose messages in
  vvp. This extra verbosity can be avoided by using the vvp command to
  indirectly execute the compiler output file.

* -V

  Print the version information. This skips all compilation. Just print the
  version information, including version details for the various components of
  the compiler.

* -R

  Print the runtime paths of the compiler. This can be useful to find, e.g.,
  the include path of vpi_user.h.

* -W<warning class>

  Enable/disable warnings. All the warning types (other then "all") can be
  prefixed with no- to disable that warning.

  * all

    This enables almost all of the available warnings. More specifically, it
    enables these warnings::

      -Wanachronisms
      -Wimplicit
      -Wimplicit-dimensions
      -Wmacro-replacement
      -Wportbind
      -Wselect-range
      -Wtimescale
      -Wsensitivity-entire-array

  * anachronisms

    This enables warnings for use of features that have been deprecated or
    removed in the selected generation of the Verilog language.

  * implicit

    This enables warnings for creation of implicit declarations. For example,
    if a scalar wire X is used but not declared in the Verilog source, this
    will print a warning at its first use.

  * implicit-dimensions
    
    This enables warnings for the case where a port declaration or a var/net
    declaration for the same name is missing dimensions. Normally, Verilog
    allows you to do this (the undecorated declaration gets its dimensions
    form the decorated declaration) but this is no longer common, and some
    other tools (notable Xilix synthesizers) do not handle this correctly.

    This flag is supported in release 10.1 or master branch snapshots after
    2016-02-06.

  * macro-redefinition
    
    This enables warnings when a macro is redefined, even if the macro text
    remains the same.

    NOTE: The "macro-redefinition" flag was added in v11.0.

  * macro-replacement
    
    This enables warnings when a macro is redefined and the macro text
    changes. Use no-macro-redefinition to disable this,

    NOTE: The "macro-replacement" flag was added in v11.0.

  * portbind
    
    This enables warnings for ports of module instantiations that are not
    connected properly, but probably should be. Dangling input ports, for
    example, will generate a warning.

  * select-range
    
    This enables warnings for constant out-of-bound selects. This includes
    partial or fully out-of-bound select as well as a select containing a 'bx
    or 'bz in the index.

  * timescale
    
    This enables warnings for inconsistent use of the timescale directive. It
    detects if some modules have no timescale, or if modules inherit timescale
    from another file. Both probably mean that timescales are inconsistent,
    and simulation timing can be confusing and dependent on compilation order.

  * infloop
    
    This enables warnings for always statements that may have runtime infinite
    loops (i.e. has paths with zero or no delay). This class of warnings is
    not included in -Wall and hence does not have a no- variant. A fatal error
    message will always be printed when the compiler can determine that there
    will definitely be an infinite loop (all paths have no or zero delay).

    When you suspect an always statement is producing a runtine infinite loop,
    use this flag to find the always statements that need to have their logic
    verified. it is expected that many of the warnings will be false
    positives, since the code treats the value of all variables and signals as
    indeterninite.

  * sensitivity-entire-vector

    This enables warnings for when a part select with an "always @*" statement
    results in the entire vector being added to the implicit sensitivity
    list. Although this behavior is prescribed by the IEEE standard, it is not
    what might be expected and can have performance implications if the vector
    is large.

  * sensitivity-entire-array

    This enables warnings for when a word select with an "always @*" statement
    results in the entire array being added to the implicit sensitivity
    list. Although this behavior is prescribed by the IEEE standard, it is not
    what might be expected and can have performance implications if the array
    is large.

  * floating-nets
    
    This enables warnings for nets that are present but have no drivers.

    This flag was added in version 11.0 or later (and is in the master branch
    as of 2015-10-01).

* -y<libdir>

  Append the directory to the library module search path. When the compiler
  finds an undefined module, it looks in these directories for files with the
  right name.

* -Y<suf>

  Appends suf to the list of file extensions that are used to resolve an
  undefined module to a file name. Should be specified before any -y flag. For
  example, this command::

    % iverilog -Y .sv -y sources src.v

  will try to resolve any undefined module m by looking into the directory
  sources and checking if there exist files named m.v or m.sv.


Preprocessor Flags
------------------

These flags control the behavior of the preprocessor. They are similar to
flags for the typical "C" compiler, so C programmers will find them familiar.

* -E

  This flag is special in that it tells the compiler to only run the
  preprocessor. This is useful for example as a way to resolve preprocessing
  for other tools. For example, this command::

    % iverilog -E -ofoo.v -DKEY=10 src1.v src2.v
    
  runs the preprocessor on the source files src1.v and src2.v and produces the
  single output file foo.v that has all the preprocessing (including header
  includes and ifdefs) processed.

* -D<macro>

  Assign a value to the macro name. The format of this flag is one of::

    -Dkey=value
    -Dkey

  The key is defined to have the given value. If no value is given, then it is
  assumed to be "1". The above examples are the same as these defines in
  Verilog source::

    `define key value
    `define key

* -I<path>

  Append directory <path> to list of directories searched for Verilog include
  files. The -I switch may be used many times to specify several directories
  to search, the directories are searched in the order they appear on the
  command line.

Elaboration Flags
-----------------

These are flags that pass information to the elaboration steps.

* -P<symbol>=<value>
  
  Define a parameter using the defparam behavior to override a parameter
  values. This can only be used for parameters of root module instances.

* -s <topmodule>

  Specify the top level module to elaborate. Icarus Verilog will by default
  choose modules that are not instantiated in any other modules, but sometimes
  that is not sufficient, or instantiates too many modules. If the user
  specifies one or more root modules with "-s" flags, then they will be used
  as root modules instead.

* -Tmin, -Ttyp, -Tmax

  Select the timings to use. The Verilog language allows many timings to be
  specified as three numbers, min:typical:max, but for simulation you need to
  choose which set to use. The "-Tmin" flag tells the compiler to at
  elaboration time choose "min" times. The default is "-Ttyp".

Target Flags
------------