Skip to content

Commit 36371f7

Browse files
Deploy to GitHub pages
0 parents  commit 36371f7

File tree

135 files changed

+25921
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+25921
-0
lines changed

.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 676bacea4a69ade32c1dc1ea5c472d6a
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.nojekyll

Whitespace-only changes.

_images/GTKWave_Example2.png

39.9 KB
Loading
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
2+
Getting Started as a Contributor
3+
================================
4+
5+
Icarus Verilog development is centered around the github repository at
6+
`github.com/steveicarus/iverilog <http://github.com/steveicarus/iverilog>`_.
7+
Contributing to Icarus Verilog requires a basic knowledge of git and github,
8+
so see the github documentation for more information. The sections below will
9+
step you through the basics of getting the source code from github, making a
10+
branch, and submitting a pull request for review.
11+
12+
Getting Icarus Verilog
13+
----------------------
14+
15+
To start, you will need to clone the code. It is preferred that you use the
16+
"ssh" method, and the ssh based clone with the command:
17+
18+
.. code-block:: console
19+
20+
% git clone [email protected]:steveicarus/iverilog.git
21+
22+
This assumes that you have a github account (accounts are free) and you have
23+
set up your ssh authentication keys. See the
24+
`Authentication Guides here <https://docs.github.com/en/authentication>`_.
25+
26+
The "git clone" command will get you all the source:
27+
28+
.. code-block:: console
29+
30+
% git clone [email protected]:steveicarus/iverilog.git
31+
Cloning into 'iverilog'...
32+
remote: Enumerating objects: 66234, done.
33+
remote: Counting objects: 100% (6472/6472), done.
34+
remote: Compressing objects: 100% (4123/4123), done.
35+
remote: Total 66234 (delta 2412), reused 6039 (delta 2190), pack-reused 59762
36+
Receiving objects: 100% (66234/66234), 27.98 MiB | 2.53 MiB/s, done.
37+
Resolving deltas: 100% (50234/50234), done.
38+
% cd iverilog/
39+
40+
Normally, this is enough as you are now pointing at the most current
41+
development code, and you have implicitly created a branch "master" that
42+
tracks the development head. However, If you want to actually be working on a
43+
specific version, say for example version 11, the v11-branch, you checkout
44+
that branch with the command:
45+
46+
.. code-block:: console
47+
48+
% git checkout --track -b v11-branch origin/v11-branch
49+
50+
This creates a local branch that tracks the v11-branch in the repository, and
51+
switches you over to your new v11-branch. The tracking is important as it
52+
causes pulls from the repository to re-merge your local branch with the remote
53+
v11-branch. You always work on a local branch, then merge only when you
54+
push/pull from the remote repository.
55+
56+
Now that you've cloned the repository and optionally selected the branch you
57+
want to work on, your local source tree may later be synced up with the
58+
development source by using the git command:
59+
60+
.. code-block:: console
61+
62+
% git pull
63+
Already up to date.
64+
65+
Finally, configuration files are built by the extra step:
66+
67+
.. code-block:: console
68+
69+
% sh autoconf.sh
70+
Autoconf in root...
71+
Precompiling lexor_keyword.gperf
72+
Precompiling vhdlpp/lexor_keyword.gperf
73+
74+
You will need autoconf and gperf installed in order for the script to work.
75+
If you get errors such as:
76+
77+
.. code-block:: console
78+
79+
% sh autoconf.sh
80+
Autoconf in root...
81+
autoconf.sh: 10: autoconf: not found
82+
Precompiling lexor_keyword.gperf
83+
autoconf.sh: 13: gperf: not found.
84+
85+
You will need to install download and install the autoconf and gperf tools.
86+
87+
Now you are ready to configure and compile the source.
88+
89+
Icarus Specific Configuration Options
90+
-------------------------------------
91+
92+
Icarus takes many of the standard configuration options and those will not be
93+
described here. The following are specific to Icarus Verilog:
94+
95+
.. code-block:: none
96+
97+
--enable-suffix[=suffix]
98+
99+
This option allows the user to build Icarus with a default suffix or when
100+
provided a user defined suffix. All programs or directories are tagged with
101+
this suffix. e.g.(iverilog-0.8, vvp-0.8, etc.). The output of iverilog will
102+
reference the correct run time files and directories. The run time will check
103+
that it is running a file with a compatible version e.g.(you can not run a
104+
V0.9 file with the V0.8 run time).
105+
106+
A debug options is:
107+
108+
.. code-block:: none
109+
110+
--with-valgrind
111+
112+
This option adds extra memory cleanup code and pool management code to allow
113+
better memory leak checking when valgrind is available. This option is not
114+
need when checking for basic errors with valgrind.
115+
116+
Compiling on Linux
117+
------------------
118+
119+
(Note: You will need to install bison, flex, g++ and gcc) This is probably the
120+
easiest step. Given that you have the source tree from the above instructions,
121+
the compile and install is generally as simple as:
122+
123+
.. code-block:: console
124+
125+
% ./configure
126+
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
127+
checking build system type... x86_64-unknown-linux-gnu
128+
checking host system type... x86_64-unknown-linux-gnu
129+
checking for gcc... gcc
130+
checking whether the C compiler works... yes
131+
checking for C compiler default output file name... a.out
132+
checking for suffix of executables...
133+
[...and so on...]
134+
135+
% make
136+
mkdir dep
137+
Using git-describe for VERSION_TAG
138+
g++ -DHAVE_CONFIG_H -I. -Ilibmisc -Wall -Wextra -Wshadow -g -O2 -MD -c main.cc -o main.o
139+
mv main.d dep/main.d
140+
g++ -DHAVE_CONFIG_H -I. -Ilibmisc -Wall -Wextra -Wshadow -g -O2 -MD -c async.cc -o async.o
141+
mv async.d dep/async.d
142+
g++ -DHAVE_CONFIG_H -I. -Ilibmisc -Wall -Wextra -Wshadow -g -O2 -MD -c design_dump.cc -o design_dump.o
143+
mv design_dump.d dep/design_dump.d
144+
g++ -DHAVE_CONFIG_H -I. -Ilibmisc -Wall -Wextra -Wshadow -g -O2 -MD -c discipline.cc -o discipline.o
145+
[...and so on...]
146+
147+
The end result is a complete build of Icarus Verilog. You can install your
148+
compiled version with a command like this:
149+
150+
.. code-block:: console
151+
152+
% sudo make install
153+
154+
Regression Tests
155+
----------------
156+
157+
Icarus Verilog comes with a fairly extensive regression test suite. As of
158+
2022, that test suite is included with the source in the "ivtest"
159+
directory. Contained in that directory are a couple driver scripts that run
160+
all the regression tests on the installed version of Icarus Verilog. So for
161+
example:
162+
163+
.. code-block:: console
164+
165+
% cd ivtest
166+
% ./vvp_reg.pl --strict
167+
168+
will run all the regression tests for the simulation engine. (This is what
169+
most people will want to do.) You should rerun this test before submitting
170+
patches to the developers. Also, if you are adding a new feature, you should
171+
add test programs to the regression test suite to validate your new feature
172+
(or bug fix.)
173+
174+
Note that pull requests will be required to pass these regression tests before
175+
being merged.
176+
177+
Forks, Branches and Pull Requests
178+
---------------------------------
179+
180+
Currently, the preferred way to submit patches to Icarus Verilog is via pull
181+
requests.
182+
`Pull requests <https://docs.github.com/en/github-ae@latest/pull-requests>`_
183+
can be created from the main repository if you have write access (very few
184+
people have write access) or more commonly from a fork, so the first step is
185+
to create a fork that you can work with. It is easy enough to create a fork,
186+
just go to the
187+
`github.com/steveicarus/iverilog <http://github.com/steveicarus/iverilog>`_
188+
page and use the "fork" button in the upper right corner. This will create
189+
a new repository that you can clone instead of the steveicarus/iverilog
190+
repository. You then use your local repository to create feature branches,
191+
then submit them for inclusion in the main repository as pull
192+
requests. Remember to `synchronize your fork
193+
<https://docs.github.com/en/github-ae@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork>`_
194+
periodically with the main repository. This will make sure your work is based
195+
on the latest upstream and avoid merge conflicts.
196+
197+
Create your patch by first creating a branch that contains your commits:
198+
199+
.. code-block:: console
200+
201+
% git checkout -b my-github-id/branch-name
202+
203+
We are encouraging using this scheme for naming your branches that are
204+
destined for pull requests. Use your github id in the branch name. So for
205+
example:
206+
207+
.. code-block:: console
208+
209+
% git checkout -b steveicarus/foo-feature
210+
211+
Do your work in this branch, then when you are ready to create a pull request,
212+
first push the branch up to github:
213+
214+
.. code-block:: console
215+
216+
% git push -u origin my-github-id/branch-name
217+
218+
Then go to github.com to create your pull request. `Create your pull request
219+
against the "master" branch of the upstream repository
220+
<https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork>`_,
221+
or the version branch that you are working on. Your pull request will be run
222+
through continuous integration, and reviewed by one of the main
223+
authors. Feedback may be offered to your PR, and once accepted, an approved
224+
individual will merge it for you. Then you are done.
225+

_sources/developer/glossary.rst.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
Glossary
3+
========
4+
5+
Throughout Icarus Verilog descriptions and source code, I use a
6+
variety of terms and acronyms that might be specific to Icarus
7+
Verilog, have an Icarus Verilog specific meaning, or just aren't
8+
widely known. So here I define these terms.
9+
10+
11+
LRM - Language Reference Manual
12+
This is a generic acronym, but in the Verilog world we sometimes
13+
mean *the* language reference manual, the IEEE1364 standard.
14+
15+
16+
PLI - Programming Language Interface
17+
This is a C API into Verilog simulators that is defined by the
18+
IEEE1364. There are two major interfaces, sometimes called PLI 1
19+
and PLI 2. PLI 2 is also often called VPI.
20+
21+
22+
UDP - User Defined Primitive
23+
These are objects that Verilog programmers define with the
24+
"primitive" keyword. They are truth-table based devices. The
25+
syntax for defining them is described in the LRM.
26+
27+
28+
VPI - Verilog Procedural Interface
29+
This is the C API that is defined by the Verilog standard, and
30+
that Icarus Verilog partially implements. See also PLI.
31+
32+
33+
VVM - Verilog Virtual Machine
34+
This is the Icarus Verilog runtime that works with the code
35+
generator that generates C++.
36+
37+
38+
VVP - Verilog Virtual Processor
39+
This is the Icarus Verilog runtime that reads in custom code in a
40+
form that I call "VVP Assembly".
41+
42+
LPM - Library of Parameterized Modules
43+
LPM (Library of Parameterized Modules) is EIS-IS standard 103-A. It is
44+
a standard library of abstract devices that are designed to be close
45+
enough to the target hardware to be easily translated, yet abstract
46+
enough to support a variety of target technologies without excessive
47+
constraints. Icarus Verilog uses LPM internally to represent idealized
48+
hardware, especially when doing target neutral synthesis.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
Cadence PLI1 Modules
3+
====================
4+
5+
With the cadpli module, Icarus Verilog is able to load PLI1
6+
applications that were compiled and linked to be dynamic loaded by
7+
Verilog-XL or NC-Verilog. This allows Icarus Verilog users to run
8+
third-party modules that were compiled to interface with XL or
9+
NC. Obviously, this only works on the operating system that the PLI
10+
application was compiled to run on. For example, a Linux module can
11+
only be loaded and run under Linux.
12+
13+
Icarus Verilog uses an interface module, the "cadpli" module, to
14+
connect the worlds. This module is installed with Icarus Verilog, and
15+
is invoked by the usual -m flag to iverilog or vvp. This module in
16+
turn scans the extended arguments, looking for +cadpli= arguments. The
17+
latter specify the share object and bootstrap function for running the
18+
module. For example, to run the module product.so, that has the
19+
bootstrap function "my_boot"::
20+
21+
vvp -mcadpli a.out -cadpli=./product.so:my_boot
22+
23+
The "-mcadpli" argument causes vvp to load the cadpli.vpl library
24+
module. This activates the -cadpli= argument interpreter. The
25+
-cadpli=<module>:<boot_func> argument, then, causes vvp, through the
26+
cadpli module, to load the loadable PLI application, invoke the
27+
my_boot function to get a veriusertfs table, and scan that table to
28+
register the system tasks and functions exported by that object. The
29+
format of the -cadpli= extended argument is essentially the same as
30+
the +loadpli1= argument to Verilog-XL.
31+
32+
The integration from this point is seamless. The PLI application
33+
hardly knows that it is being invoked by Icarus Verilog instead of
34+
Verilog-XL, so operates as it would otherwise.

0 commit comments

Comments
 (0)