Verilator open-source SystemVerilog simulator and lint system
Go to file
2019-06-12 21:49:40 -04:00
bin Mark infrequently called functions with GCC cold attribute. 2019-05-14 22:03:50 -04:00
docs Fix build error on MinGW, bug1460. 2019-06-11 21:38:17 -04:00
examples Internals: Detab and fix spacing style issues in tests and scripts. No functional change. 2019-05-07 22:34:09 -04:00
include Fix build error on MinGW, bug1460. 2019-06-11 21:38:17 -04:00
nodist nodist: Fix git_untabify --narrow. 2019-05-16 21:32:50 -04:00
src Tests: Add additional .out files instead of expects. 2019-06-12 21:49:40 -04:00
test_regress Tests: Add additional .out files instead of expects. 2019-06-12 21:49:40 -04:00
.clang-tidy Internals: Fix many clang-tidy issues. No functional change intended. 2018-10-14 18:39:33 -04:00
.gitignore Internals: Fix many clang-tidy issues. No functional change intended. 2018-10-14 18:39:33 -04:00
Artistic Verilator is now licensed under LGPL v3 and/or Artistic v2.0. 2009-05-04 17:07:57 -04:00
Changes Fix not reporting some duplicate signals, bug1462. 2019-06-12 19:17:10 -04:00
configure.ac devel release 2019-05-08 21:39:23 -04:00
COPYING Verilator is now licensed under LGPL v3 and/or Artistic v2.0. 2009-05-04 17:07:57 -04:00
COPYING.LESSER Internals: Fix spacing and style of v4 changes. No functional change. 2018-08-23 05:22:34 -04:00
doxygen-mainpage Add doxygen comments, bug482 2012-04-15 15:44:32 -04:00
doxygen.config Fix doxygen old dir refs. 2018-07-20 19:45:58 -04:00
install-sh Fix whitespace issues, bug1203. 2017-09-11 19:18:58 -04:00
internals.pod Commentary: Spelling fixes. 2019-05-11 18:42:27 -04:00
Makefile.in Add contributors and test. 2019-06-10 20:29:58 -04:00
MANIFEST.SKIP Add .git file (not directory) to MANIFEST.SKIP for git worktrees 2019-05-01 19:48:27 -04:00
README.pod Copyright year update. 2019-01-03 19:17:22 -05:00
TODO Copyright year update. 2019-01-03 19:17:22 -05:00
verilator_logo.png Docs: Add logo to PDF 2018-09-16 17:01:45 -04:00
verilator.pc.in Fix include, part of bug919. 2015-05-16 18:08:20 -04:00

# DESCRIPTION: DOCUMENT source run through perl to produce README file
# Use 'make README' to produce the output file

=pod

=head1 NAME

This is the Verilator package README file.

=head1 DISTRIBUTION

http://www.veripool.org/verilator

This package is Copyright 2003-2019 by Wilson Snyder.  (Report bugs to
L<http://www.veripool.org/>.)

Verilator is free software; you can redistribute it and/or modify it under
the terms of either the GNU Lesser General Public License Version 3 or the
Perl Artistic License Version 2.0.  (See the documentation for more
details.)

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
more details.

=head1 DESCRIPTION

Verilator converts synthesizable (generally not behavioral) Verilog code
into C++ or SystemC code.  It is not a complete simulator, just a
translator.

Verilator is invoked with parameters similar to GCC or Synopsys's VCS.  It
reads the specified Verilog code, lints it, and optionally adds coverage
code.  For C++ format, it outputs .cpp and .h files.  For SystemC format,
it outputs .cpp and .h files using the standard SystemC headers.

The resulting files are then compiled with C++.  The user writes a little
C++ wrapper file, which instantiates the top level module.  This is
compiled in C++, and linked with the Verilated files.

The resulting executable will perform the actual simulation.

=head1 SUPPORTED SYSTEMS

Verilator is developed and has primary testing on Ubuntu.  Versions have
also built on Redhat Linux, Macs OS-X, HPUX and Solaris.  It should run
with minor porting on any Linix-ish platform.  Verilator also works on
Windows under Cygwin, and Windows under MinGW (gcc -mno-cygwin).  Verilated
output (not Verilator itself) compiles under MSVC++ 2008 and newer.

=head1 INSTALLATION

For more details see
L<http://www.veripool.org/projects/verilator/wiki/Installing>.

If you will be modifying Verilator, you should use the "git" method as it
will let you track changes.

=over 4

=item

The latest version is available at L<http://www.veripool.org/verilator>.

Download the latest package from that site, and decompress.

    tar xvzf verilator_version.tgz

=item

If you will be using SystemC (vs straight C++ output), download SystemC
from L<http://www.systemc.org>.  Follow their installation instructions.
You will need to set SYSTEMC_INCLUDE to point to the include directory with
systemc.h in it, and SYSTEMC_LIBDIR to points to the directory with
libsystemc.a in it.  (Older installations may set SYSTEMC and SYSTEMC_ARCH
instead.)

=item

To use Verilator you will need the C<perl>, C<make> (or C<gmake>), and
C<g++> (or C<clang>) packages.

To use Verilator FST tracing you will need the C<gtkwave> and C<libgz> (on
Ubuntu C<zlibc> C<zlib1g> C<zlib1g-dev>) packages installed.

To compile Verilator in addition to the above you need the C<flex>,
C<bison> and C<texi2html> packages installed.

=item

C<cd> to the Verilator directory containing this README.

=item

You now have to decide how you're going to eventually install the kit.

Note Verilator builds the current value of VERILATOR_ROOT, SYSTEMC_INCLUDE,
and SYSTEMC_LIBDIR as defaults into the executable, so try to have them
correct before configuring.

=over 4

=item 1.

Our personal favorite is to always run Verilator from the kit directory.
This allows the easiest experimentation and upgrading.  It's also how most
EDA tools operate; to run you point to the tarball, no install is needed.

    export VERILATOR_ROOT=`pwd`   # if your shell is bash
    setenv VERILATOR_ROOT `pwd`   # if your shell is csh
    ./configure

=item 2.

To install globally onto a "cad" disk with multiple versions of every tool,
and add it to path using Modules/modulecmd:

    unset VERILATOR_ROOT      # if your shell is bash
    unsetenv VERILATOR_ROOT   # if your shell is csh
    # For the tarball, use the version number instead of git describe
    ./configure --prefix /CAD_DISK/verilator/`git describe | sed "s/verilator_//"`

    After installing you'll want a module file like the following:

    set install_root /CAD_DISK/verilator/{version-number-used-above}
    unsetenv VERILATOR_ROOT
    prepend-path PATH $install_root/bin
    prepend-path MANPATH $install_root/man
    prepend-path PKG_CONFIG_PATH $install_root/share/pkgconfig

=item 3.

The next option is to install it globally, using the normal system paths:

    unset VERILATOR_ROOT      # if your shell is bash
    unsetenv VERILATOR_ROOT   # if your shell is csh
    ./configure

=item 4.

Alternatively you can configure a prefix that install will populate, as
most GNU tools support:

    unset VERILATOR_ROOT      # if your shell is bash
    unsetenv VERILATOR_ROOT   # if your shell is csh
    ./configure --prefix /opt/verilator-VERSION

Then after installing you will need to add /opt/verilator-VERSION/bin to
PATH.

=back

=item

Type C<make> to compile Verilator.

Type C<make test> to check the compilation.

Configure with C<--enable-longtests> for more complete developer tests.
Additional packages may be required for these tests.

You may get a error about a typedef conflict for uint32_t.  Edit
verilated.h to change the typedef to work, probably to @samp{typedef
unsigned long uint32_t;}.

=item

If you used the VERILATOR_ROOT scheme you're done.  Programs should set the
environment variable VERILATOR_ROOT to point to this distribution, then
execute $VERILATOR_ROOT/bin/verilator, which will find the path to all
needed files.

If you used the prefix scheme, now do a C<make install>.  To run verilator,
have the verilator binary directory in your PATH (this should already be
true if using the default configure), and make sure VERILATOR_ROOT is not
set.

You may now wish to consult the examples directory. Type C<make> inside any
example directory to run the example.

=back

=head1 USAGE DOCUMENTATION

Detailed documentation and the man page can be seen by running:

    bin/verilator --help

or reading verilator.txt in the same directory as this README.

=head1 DIRECTORY STRUCTURE

The directories in the kit after de-taring are as follows:

    bin/verilator               => Compiler Wrapper invoked to Verilate code
    include/                    => Files that should be in your -I compiler path
    include/verilated*.cpp      => Global routines to link into your simulator
    include/verilated*.h        => Global headers
    include/verilated.v         => Stub defines for linting
    include/verilated.mk        => Common makefile
    src/                        => Translator source code
    examples/hello_world_c      => Example simple Verilog->C++ conversion
    examples/hello_world_sc     => Example simple Verilog->SystemC conversion
    examples/tracing_c          => Example Verilog->C++ with tracing
    examples/tracing_sc         => Example Verilog->SystemC with tracing
    test_regress                => Internal tests

=head1 LIMITATIONS

See verilator.txt (or execute C<bin/verilator --help>) for limitations.