1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./style.css" />
6 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./design.css" />
7 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"./print.css" />
9 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
14 <a href=
"start.html" class=
"wikilink1" title=
"start.html">gEDA
</a> >> <a href=
"geda-documentation.html" class=
"wikilink1" title=
"geda-documentation.html">Documentation
</a> >> <a href=
"geda-icarus.html" class=
"wikilink1" title=
"geda-icarus.html">Icarus Verilog
</a> >> <a href=
"geda-icarus_quick_start.txt.html" class=
"wikilink2" title=
"geda-icarus_quick_start.txt.html">Getting Started
</a>
17 <h1 id=
"gettingstartedwithicarusverilog">Getting Started with Icarus Verilog
</h1>
21 Icarus Verilog is a Verilog compiler. It is suitable for use as a
22 simulator, and, to some degree, synthesizer. Icarus Verilog runs under
23 Linux and a variety of UNIX systems, as well as Windows as a command
24 line tool, so the instructions are generally applicable to all
25 environments. Note that this is only a quick start. For more detailed
26 documentation, see the manual page for the iverilog command.
31 <h2 id=
"helloworld">Hello, World!
</h2>
35 The first thing you want to do as a user is learn how to compile and
36 execute even the most trivial design. For the purposes of simulation,
37 we use as our example
<em>the
</em> most trivial simulation:
40 <dt><a href=
"/./doku.php?do=export_code&id=:geda:icarus_quick_start.txt&codeblock=0" title=
"Download Snippet" class=
"mediafile mf_vl_">"hello.vl
"</a></dt>
41 <dd><pre class=
"code verilog"><span class=
"kw1">module
</span> main
<span class=
"sy0">;
</span>
43 <span class=
"kw1">initial
</span>
44 <span class=
"kw1">begin
</span>
45 <span class=
"kw2">$display
</span><span class=
"br0">(</span><span class=
"st0">"Hello, World
"</span><span class=
"br0">)</span><span class=
"sy0">;
</span>
46 <span class=
"kw2">$finish
</span> <span class=
"sy0">;
</span>
47 <span class=
"kw1">end
</span>
49 <span class=
"kw1">endmodule
</span></pre>
53 Download this program,
54 or copy it from the Icarus Verilog examples directory.
55 Next, compile it with a command like this:
57 <pre class=
"code">% iverilog -o hello hello.vl
</pre>
60 The results of this compile are placed into the file
<code>hello
</code>, as the
61 <code>-o
</code> flag tells the compiler where to place the compiled result. Next,
62 execute the compiled program like so:
64 <pre class=
"code">% vvp hello
68 And there it is, the program has been executed. So what happened? The
69 first step, the
<code>iverilog
</code> command, read and interpreted the source
70 file, then generated a compiled result. The compiled form may be
71 selected by command line switches, but the default form is the VVP
72 format, which is actually run by the
<code>vvp
</code> command.
76 The
<code>iverilog
</code> and
<code>vvp
</code> commands are the only commands that users
77 use to invoke Icarus Verilog. What the compiler actually does is
78 controlled by command line switches. In our little example, we asked
79 the compiler to compile the source program to the default vvp form,
80 which is in turn executed by the vvp program.
85 <h2 id=
"windowsinstall">Windows Install
</h2>
89 The easiest way to install under Windows is to get a precompiled
90 installer for the version you wish to install. Icarus Verilog is
91 distributed for Windows users as a self-installing
<code>.exe
</code>. Just execute
92 the installer and follow the instructions. During the install, take
93 note of the directory where the program is installed: for example,
94 <code>C:\iverilog
</code> is a good place to install.
98 Once the binary is installed, you need to add the bin directory to
99 your execution path. The executables you need are in
<code>C:\iverilog\bin
</code>,
100 where the
<code>C:\iverilog
</code> part is actually the root of where you
101 installed the package. The programs are in the bin subdirectory. Put
102 this directory in your
<code>PATH
</code> environment variable, and the above
103 commands become accessible to you at the command line prompt, or even
109 <h2 id=
"linuxinstall">Linux Install
</h2>
113 Under Linux, the install is even easier. For RedHat and Mandrake based
114 systems, there is the appropriate RPM file. Just install the package
115 with the
<code>rpm -U
<file
></code> command. Debian users should get Icarus
116 Verilog packages from the main Debian software site.
121 <h2 id=
"installfromsource">Install From Source
</h2>
125 In this case, see
<a href=
"geda-icarus_readme.html" class=
"wikilink1" title=
"geda-icarus_readme.html">The Icarus Verilog Compilation System
</a>
126 and other documentation that comes with the source.