This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
geda:icarus_quick_start [2012/02/20 15:14] 127.0.0.1 external edit |
geda:icarus_quick_start [2014/04/14 13:34] (current) rlutz Use <code> instead of <file> |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | [[:|gEDA]] >> [[Documentation]] >> [[icarus|Icarus Verilog]] >> [[|Getting Started]] | ||
+ | |||
====== Getting Started with Icarus Verilog ====== | ====== Getting Started with Icarus Verilog ====== | ||
- | <code>* Getting Started with Icarus Verilog | ||
Icarus Verilog is a Verilog compiler. It is suitable for use as a | Icarus Verilog is a Verilog compiler. It is suitable for use as a | ||
Line 10: | Line 11: | ||
- | * Hello, World! | + | ===== Hello, World! ===== |
The first thing you want to do as a user is learn how to compile and | The first thing you want to do as a user is learn how to compile and | ||
execute even the most trivial design. For the purposes of simulation, | execute even the most trivial design. For the purposes of simulation, | ||
- | we use as our example *the* most trivial simulation: | + | we use as our example //the// most trivial simulation: |
- | module main; | + | <code verilog "hello.vl"> |
+ | module main; | ||
- | initial | + | initial |
- | begin | + | begin |
- | $display("Hello, World"); | + | $display("Hello, World"); |
- | $finish ; | + | $finish ; |
- | end | + | end |
- | endmodule | + | endmodule |
+ | </code> | ||
- | By a text editor (or copy hello.vl from the Icarus Verilog examples | + | [[http://wiki.geda-project.org/_export/code/geda:icarus_quick_start?codeblock=0|Download]] this program, |
- | directory) arrange for this program to be in a text file, "hello.vl". | + | or copy it from the Icarus Verilog examples directory. |
- | Next, compile this program with a command like this: | + | Next, compile it with a command like this: |
% iverilog -o hello hello.vl | % iverilog -o hello hello.vl | ||
- | The results of this compile are placed into the file "hello", as the | + | The results of this compile are placed into the file ''hello'', as the |
- | "-o" flag tells the compiler where to place the compiled result. Next, | + | ''-o'' flag tells the compiler where to place the compiled result. Next, |
execute the compiled program like so: | execute the compiled program like so: | ||
Line 40: | Line 43: | ||
And there it is, the program has been executed. So what happened? The | And there it is, the program has been executed. So what happened? The | ||
- | first step, the "iverilog" command, read and interpreted the source | + | first step, the ''iverilog'' command, read and interpreted the source |
file, then generated a compiled result. The compiled form may be | file, then generated a compiled result. The compiled form may be | ||
selected by command line switches, but the default form is the VVP | selected by command line switches, but the default form is the VVP | ||
- | format, which is actually run by the "vvp" command. | + | format, which is actually run by the ''vvp'' command. |
- | The "iverilog" and "vvp" commands are the only commands that users | + | The ''iverilog'' and ''vvp'' commands are the only commands that users |
use to invoke Icarus Verilog. What the compiler actually does is | use to invoke Icarus Verilog. What the compiler actually does is | ||
controlled by command line switches. In our little example, we asked | controlled by command line switches. In our little example, we asked | ||
Line 52: | Line 55: | ||
- | * Windows Install | + | ===== Windows Install ===== |
The easiest way to install under Windows is to get a precompiled | The easiest way to install under Windows is to get a precompiled | ||
installer for the version you wish to install. Icarus Verilog is | installer for the version you wish to install. Icarus Verilog is | ||
- | distributed for Windows users as a self-installing .exe. Just execute | + | distributed for Windows users as a self-installing ''.exe''. Just execute |
the installer and follow the instructions. During the install, take | the installer and follow the instructions. During the install, take | ||
note of the directory where the program is installed: for example, | note of the directory where the program is installed: for example, | ||
- | C:\iverilog is a good place to install. | + | ''C:\iverilog'' is a good place to install. |
Once the binary is installed, you need to add the bin directory to | Once the binary is installed, you need to add the bin directory to | ||
- | your execution path. The executables you need are in C:\iverilog\bin, | + | your execution path. The executables you need are in ''C:\iverilog\bin'', |
- | where the "C:\iverilog" part is actually the root of where you | + | where the ''C:\iverilog'' part is actually the root of where you |
installed the package. The programs are in the bin subdirectory. Put | installed the package. The programs are in the bin subdirectory. Put | ||
- | this directory in your PATH environment variable, and the above | + | this directory in your ''PATH'' environment variable, and the above |
commands become accessible to you at the command line prompt, or even | commands become accessible to you at the command line prompt, or even | ||
in batch files. | in batch files. | ||
- | * Linux Install | + | ===== Linux Install ===== |
Under Linux, the install is even easier. For RedHat and Mandrake based | Under Linux, the install is even easier. For RedHat and Mandrake based | ||
systems, there is the appropriate RPM file. Just install the package | systems, there is the appropriate RPM file. Just install the package | ||
- | with the "rpm -U <file>" command. Debian users should get Icarus | + | with the ''rpm -U <file>'' command. Debian users should get Icarus |
Verilog packages from the main Debian software site. | Verilog packages from the main Debian software site. | ||
- | * Install From Source | + | ===== Install From Source ===== |
+ | |||
+ | In this case, see [[icarus_readme|The Icarus Verilog Compilation System]] | ||
+ | and other documentation that comes with the source. | ||
- | In this case, see README.txt and other documentation that comes with | ||
- | the source.</code> |