1 .TH iverilog 1 "$Date: 2007/06/05 01:56:12 $" Version "$Date: 2007/06/05 01:56:12 $"
3 iverilog - Icarus Verilog compiler
7 [-ESVv] [-Bpath] [-ccmdfile|-fcmdfile] [-Dmacro[=defn]] [-pflag=value]
8 [-g1|-g2|-g2x|-gspecify|-gxtypes|-gio-range-error]
9 [-Iincludedir] [-mmodule] [-Mfile] [-Nfile] [-ooutputfilename]
10 [-stopmodule] [-ttype] [-Tmin/typ/max] [-Wclass] [-ypath] sourcefile
14 \fIiverilog\fP is a compiler that translates Verilog source code into
15 executable programs for simulation, or other netlist formats for
16 further processing. The currently supported targets are \fIvvp\fP for
17 simulation, and \fIxnf\fP and \fIfpga\fP for synthesis. Other target
18 types are added as code generators are implemented.
22 \fIiverilog\fP accepts the following options:
25 The \fIiverilog\fP program uses external programs and configuration
26 files to preprocess and compile the Verilog source. Normally, the path
27 used to locate these tools is built into the \fIiverilog\fP
28 program. However, the \fB-B\fP switch allows the user to select a
29 different set of programs. The path given is used to locate
30 \fIivlpp\fP, \fIivl\fP, code generators and the VPI modules.
32 .B -c\fIfile\fP -f\fIfile\fP
33 These flags specifies an input file that contains a list of Verilog
34 source files. This is similar to the \fIcommand file\fP of other
35 Verilog simulators, in that it is a file that contains the file names
36 instead of taking them on the command line. See \fBCommand Files\fP below.
39 Defines macro \fImacro\fP with the string `1' as its definition. This
40 form is normally only used to trigger ifdef conditionals in the
44 Defines macro \fImacro\fP as \fIdefn\fP.
47 Preprocess the Verilog source, but do not compile it. The output file
48 is the Verilog input, but with file inclusions and macro references
49 expanded and removed. This is useful, for example, to preprocess
50 Verilog source for use by other compilers.
52 .B -g1\fI|\fP-g2\fI|\fP-g2x
53 Select the Verilog language \fIgeneration\fP to support in the
54 compiler. This selects between \fIIEEE1364-1995\fP(1),
55 \fIIEEE1364-2001\fP(2), or \fIVerilog with extension\fP(2x). Normally,
56 Icarus Verilog defaults to the latest known generation of the
57 language. This flag is most useful to restrict the language to a set
58 supported by tools of specific generations, for compatibility with
61 .B -gspecify\fI|\fP-gno-specify
62 Enable (default) or disable specify block support. When enabled,
63 specify block code is elaborated. When disabled, specify blocks are
64 parsed but ignored. Specify blocks are commonly not needed for RTL
65 simulation, and in fact can hurt performance of the
66 simulation. However, disabling specify blocks reduces accuracy of
67 full-timing simulations.
69 .B -gxtypes\fI|\fP-gno-xtypes
70 Enable (default) or disable support for extended types. Enabling
71 extended types allows for new types that are supported by Icarus
72 Verilog as extensions beyond the baseline Verilog. It may be necessary
73 to disable extended types if compiling code that clashes with the few
74 new keywords used to implement the type system.
76 .B -gio-range-error\fI|\fP-gno-io-range-error
77 The standards requires that a vectored port have matching ranges for its
78 port declaration as well as any net/register declaration. It was common
79 practice in the past to only specify the range for the net/register
80 declaration and some tools still allow this. By default any mismatch is
81 reported as a error. Using \fI-gno-io-range-error\fP will produce a
82 warning instead of a fatal error for the case of a vectored net/register
83 and a scalar port declaration.
86 Append directory \fIincludedir\fP to list of directories searched
87 for Verilog include files. The \fB-I\fP switch may be used many times
88 to specify several directories to search, the directories are searched
89 in the order they appear on the command line.
92 Write into the file specified by path a list of files that contribute
93 to the compilation of the design. This includes files that are
94 included by include directives and files that are automatically loaded
95 by library support. The output is one file name per line, with no
96 leading or trailing space.
99 Add this module to the list of VPI modules to be loaded by the
100 simulation. Many modules can be specified, and all will be loaded, in
101 the order specified. The system module is implicit and always included.
102 If a System Function Table file (<module>.sft) exists for the module it
103 will be loaded automatically.
106 This is used for debugging the compiler proper. Dump the final netlist
107 form of the design to the specified file. It otherwise does not affect
108 operation of the compiler. The dump happens after the design is
109 elaborated and optimized.
112 Place output in the file \fIfilename\fP. If no output file name is
113 specified, \fIiverilog\fP uses the default name \fBa.out\fP.
115 .B -p\fIflag=value\fP
116 Assign a value to a target specific flag. The \fB-p\fP switch may be
117 used as often as necessary to specify all the desired flags. The flags
118 that are used depend on the target that is selected, and are described
119 in target specific documentation. Flags that are not used are ignored.
122 Synthesize. Normally, if the target can accept behavioral
123 descriptions the compiler will leave processes in behavioral
124 form. The \fB-S\fP switch causes the compiler to perform synthesis
125 even if it is not necessary for the target. If the target type is a
126 netlist format, the \fB-S\fP switch is unnecessary and has no effect.
128 .B -s \fItopmodule\fP
129 Specify the top level module to elaborate. Icarus Verilog will by default
130 choose modules that are not instantiated in any other modules, but
131 sometimes that is not sufficient, or instantiates too many modules. If
132 the user specifies one or more root modules with \fB-s\fP flags, then
133 they will be used as root modules instead.
135 .B -T\fImin|typ|max\fP
136 Use this switch to select min, typ or max times from min:typ:max
137 expressions. Normally, the compiler will simply use the typ value from
138 these expressions (with a warning) but this switch will tell the
139 compiler explicitly which value to use. This will suppress the
140 warning that the compiler is making a choice.
143 Use this switch to specify the target output format. See the
144 \fBTARGETS\fP section below for a list of valid output formats.
147 Turn on verbose messages. This will print the command lines that are
148 executed to perform the actual compilation, along with version
149 information from the various components, as well as the version of the
150 product as a whole. You will notice that the command lines include
151 a reference to a key temporary file that passes information to the
152 compiler proper. To keep that file from being deleted at the end
153 of the process, provide a file name of your own in the environment
154 variable \fBIVERILOG_ICONFIG\fP.
157 Print the version of the compiler, and exit.
160 Turn on different classes of warnings. See the \fBWARNING TYPES\fP
161 section below for descriptions of the different warning groups. If
162 multiple \fB-W\fP switches are used, the warning set is the union of
163 all the requested classes.
166 Append the directory to the library module search path. When the
167 compiler finds an undefined module, it looks in these directories for
168 files with the right name.
172 The Icarus Verilog compiler supports module libraries as directories
173 that contain Verilog source files. During elaboration, the compiler
174 notices the instantiation of undefined module types. If the user
175 specifies library search directories, the compiler will search the
176 directory for files with the name of the missing module type. If it
177 finds such a file, it loads it as a Verilog source file, they tries
178 again to elaborate the module.
180 Library module files should contain only a single module, but this is
181 not a requirement. Library modules may reference other modules in the
182 library or in the main design.
186 The Icarus Verilog compiler supports a variety of targets, for
187 different purposes, and the \fB-t\fP switch is used to select the
192 The null target causes no code to be generated. It is useful for
193 checking the syntax of the Verilog source.
196 This is the default. The vvp target generates code for the vvp
197 runtime. The output is a complete program that simulates the design
198 but must be run by the \fBvvp\fP command.
201 This is the Xilinx Netlist Format used by many tools for placing
202 devices in FPGAs or other programmable devices. This target is
203 obsolete, use the \fBfpga\fP target instead.
206 This is a synthesis target that supports a variety of fpga devices,
207 mostly by EDIF format output. The Icarus Verilog fpga code generator
208 can generate complete designs or EDIF macros that can in turn be
209 imported into larger designs by other tools. The \fBfpga\fP target
210 implies the synthesis \fB-S\fP flag.
213 These are the types of warnings that can be selected by the \fB-W\fP
214 switch. All the warning types (other than \fBall\fP) can also be
215 prefixed with \fBno-\fP to turn off that warning. This is most useful
216 after a \fB-Wall\fP argument to suppress isolated warning types.
220 This enables all supported warning categories.
224 This enables warnings for creation of implicit declarations. For
225 example, if a scalar wire X is used but not declared in the Verilog
226 source, this will print a warning at its first use.
230 This enables warnings for ports of module instantiations that are not
231 connected but probably should be. Dangling input ports, for example,
232 will generate a warning.
236 This enables warnings for inconsistent use of the timescale
237 directive. It detects if some modules have no timescale, or if modules
238 inherit timescale from another file. Both probably mean that
239 timescales are inconsistent, and simulation timing can be confusing
240 and dependent on compilation order.
242 .SH "SYSTEM FUNCTION TABLE FILES"
243 If the source file name as a \fB.sft\fP suffix, then it is taken to be
244 a system function table file. A System function table file is used to
245 describe to the compiler the return types for system functions. This
246 is necessary because the compiler needs this information to elaborate
247 expressions that contain these system functions, but cannot run the
248 sizetf functions since it has no run-time.
250 The format of the table is ASCII, one function per line. Empty lines
251 are ignored, and lines that start with the '\fI#\fP' character are
252 comment lines. Each non-comment line starts with the function name,
253 then the vpi type (i.e. vpiSysFuncReal). The following types are
258 The function returns a real/realtime value.
262 The function returns an integer.
265 .B vpiSysFuncSized <wid> <signed|unsigned>
266 The function returns a vector with the given width, and is signed or
267 unsigned according to the flag.
270 The command file allows the user to place source file names and
271 certain command line switches into a text file instead of on a long
272 command line. Command files can include C or C++ style comments, as
273 well as # comments, if the # starts the line.
277 A simple file name or file path is taken to be the name of a Verilog
278 source file. The path starts with the first non-white-space
279 character. Variables are substituted in file names.
282 .B -c\ \fIcmdfile\fP -f\ \fIcmdfile\fP
283 A \fB-c\fP or \fB-f\fP token prefixes a command file, exactly like it
284 does on the command line. The cmdfile may be on the same line or the
285 next non-comment line.
289 A \fB-y\fP token prefixes a library directory in the command file,
290 exactly like it does on the command line. The parameter to the \fB-y\fP
291 flag may be on the same line or the next non-comment line.
293 Variables in the \fIlibdir\fP are substituted.
296 .B +incdir+\fIincludedir\fP
297 The \fB+incdir+\fP token in command files gives directories to search
298 for include files in much the same way that \fB-I\fP flags work on the
299 command line. The difference is that multiple \fI+includedir\fP
300 directories are valid parameters to a single \fB+incdir+\fP token,
301 although you may also have multiple \fB+incdir+\fP lines.
303 Variables in the \fIincludedir\fP are substituted.
307 The \fB+libext\fP token in command files fives file extensions to try
308 when looking for a library file. This is useful in conjunction with
309 \fB-y\fP flags to list suffixes to try in each directory before moving
310 on to the next library directory.
314 This is another way to specify library directories. See the -y flag.
317 .B +libdir-nocase+\fIdir\fP
318 This is like the \fB+libdir\fP statement, but file names inside the
319 directories declared here are case insensitive. The missing module
320 name in a lookup need not match the file name case, as long as the
321 letters are correct. For example, "foo" matches "Foo.v" but not
325 .B +define+\fINAME\fP=\fIvalue\fP
326 The \fB+define+\fP token is the same as the \fB-D\fP option on the
327 command line. The value part of the token is optional.
330 .B +toupper-filename\fP
331 This token causes file names after this in the command file to be
332 translated to uppercase. This helps with situations where a directory
333 has passed through a DOS machine, and in the process the file names
337 .B +tolower-filename\fP
338 This is similar to the \fB+toupper-filename\fP hack described above.
341 .B +integer-width+\fIvalue\fP
342 This allows the programmer to select the width for integer variables
343 in the Verilog source. The default is 32, the value can be any desired
346 .SH "VARIABLES IN COMMAND FILES"
348 In certain cases, iverilog supports variables in command files. These
349 are strings of the form "$(\fIvarname\fP)", where \fIvarname\fP is the
350 name of the environment variable to read. The entire string is
351 replaced with the contents of that variable. Variables are only
352 substituted in contexts that explicitly support them, including file
353 and directory strings.
355 Variable values come from the operating system environment, and not
356 from preprocessor defines elsewhere in the file or the command line.
358 .SH PREDEFINED MACROS
360 The following macro is predefined by the compiler:
365 These examples assume that you have a Verilog source file called hello.v in
366 the current directory
368 To compile hello.v to an executable file called a.out:
372 To compile hello.v to an executable file called hello:
374 iverilog -o hello hello.v
376 To compile and run explicitly using the vvp runtime:
378 iverilog -ohello.vvp -tvvp hello.v
380 To compile hello.v to a file in XNF-format called hello.xnf
382 iverilog -txnf -ohello.xnf hello.v
387 Steve Williams (steve@icarus.com)
391 .BR "<http://www.icarus.com/eda/verilog/>"
395 Copyright \(co 2002 Stephen Williams
397 This document can be freely redistributed according to the terms of the
398 GNU General Public License version 2.0