2009-11-03 14:22:47 +00: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
|
|
|
|
|
2012-01-15 15:26:28 +00:00
|
|
|
This package is Copyright 2003-2012 by Wilson Snyder. (Report bugs to
|
2009-11-03 14:22:47 +00:00
|
|
|
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 (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 .sp files for the SystemPerl preprocessor available at
|
|
|
|
http://www.veripool.org.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2010-02-01 11:40:30 +00:00
|
|
|
Verilator is developed and has primary testing on:
|
2009-11-03 14:22:47 +00:00
|
|
|
|
2009-11-13 16:08:30 +00:00
|
|
|
SuSE 11.1 AMD64 i686-linux-2.6.27, GCC 4.3.2
|
2009-11-03 14:22:47 +00:00
|
|
|
|
2010-02-07 00:56:14 +00:00
|
|
|
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.
|
2009-11-03 14:22:47 +00:00
|
|
|
|
|
|
|
=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
|
|
|
|
2.0.1 from L<http://www.systemc.org>. Follow their installation
|
2010-09-25 11:59:18 +00:00
|
|
|
instructions. You will need to set the SYSTEMC environment variable to
|
|
|
|
point to this download. Also, setenv SYSTEMC_ARCH to the architecture name
|
|
|
|
you used with SystemC, generally 'linux' or 'cygwin'.
|
2009-11-03 14:22:47 +00:00
|
|
|
|
2010-09-25 11:59:18 +00:00
|
|
|
Verilator assumes you did a make in the SystemC kit directory and SYSTEMC
|
|
|
|
points to that directory. There must be appropriate files in
|
|
|
|
C<$SYSTEMC/include> and C<$SYSTEMC/lib-linux> for SystemC compilation to
|
|
|
|
work.
|
2009-11-03 14:22:47 +00:00
|
|
|
|
|
|
|
=item
|
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
If you will be using SystemPerl or coverage, download and install
|
|
|
|
System-Perl, L<http://www.veripool.org/systemperl>. Note you'll need to
|
|
|
|
set a C<SYSTEMPERL> environment variable to point to the downloaded kit.
|
2009-11-03 14:22:47 +00:00
|
|
|
Optionally also set C<SYSTEMPERL_INCLUDE> to point to the installed
|
|
|
|
headers.
|
|
|
|
|
|
|
|
=item
|
|
|
|
|
2011-10-05 21:06:08 +00:00
|
|
|
You will need the C<flex> and C<bison> packages installed.
|
|
|
|
|
|
|
|
=item
|
|
|
|
|
2009-11-03 14:22:47 +00:00
|
|
|
C<cd> to the Verilator directory containing this README.
|
|
|
|
|
|
|
|
=item
|
|
|
|
|
2009-11-25 22:20:28 +00:00
|
|
|
You now have to decide how you're going to eventually install the kit.
|
2009-11-03 14:22:47 +00:00
|
|
|
|
2010-12-07 14:30:52 +00:00
|
|
|
Note Verilator builds the current value of VERILATOR_ROOT, SYSTEMC,
|
|
|
|
SYSTEMC_ARCH, SYSTEMPERL, and SYSTEMPERL_INCLUDE as defaults into the
|
|
|
|
executable, so try to have them correct before configuring.
|
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
|
|
|
=item 1.
|
|
|
|
|
2009-11-25 22:20:28 +00:00
|
|
|
Our personal favorite is to always run Verilator from the kit directory.
|
|
|
|
This allows the easiest experimentation and upgrading. It's also how most
|
2010-09-25 11:59:18 +00:00
|
|
|
EDA tools operate; to run any of them you point to the tarball.
|
2009-11-25 22:20:28 +00:00
|
|
|
|
|
|
|
export VERILATOR_ROOT=`pwd` # if your shell is bash
|
|
|
|
setenv VERILATOR_ROOT `pwd` # if your shell is csh
|
|
|
|
./configure
|
|
|
|
|
2010-12-07 14:30:52 +00:00
|
|
|
=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}
|
|
|
|
setenv VERILATOR_ROOT $install_root
|
|
|
|
prepend-path PATH $install_root/bin
|
|
|
|
prepend-path MANPATH $install_root/man
|
|
|
|
|
|
|
|
=item 3.
|
|
|
|
|
2009-11-25 22:20:28 +00:00
|
|
|
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
|
|
|
|
|
2010-12-07 14:30:52 +00:00
|
|
|
=item 4.
|
|
|
|
|
2009-11-25 22:20:28 +00:00
|
|
|
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
|
|
|
|
|
2011-10-05 14:47:05 +00:00
|
|
|
Then after installing you will need to add /opt/verilator-VERSION/bin to
|
|
|
|
PATH.
|
|
|
|
|
2010-12-07 14:30:52 +00:00
|
|
|
=back
|
2009-11-03 14:22:47 +00:00
|
|
|
|
|
|
|
=item
|
|
|
|
|
|
|
|
Type C<make> to compile Verilator.
|
|
|
|
|
|
|
|
Type C<make test_c> to check the compilation.
|
|
|
|
|
|
|
|
Type C<make test> for a more complete test. You may get a error about the
|
|
|
|
Bit::Vector Perl package. You will need to install it and SystemPerl if
|
|
|
|
you want all tests to pass.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2010-09-25 11:59:18 +00:00
|
|
|
If you used the VERILATOR_ROOT scheme you're done. Programs should set the
|
2009-11-25 22:20:28 +00:00
|
|
|
environment variable VERILATOR_ROOT to point to this distribution, then
|
|
|
|
execute $VERILATOR_ROOT/bin/verilator, which will find the path to all
|
|
|
|
needed files.
|
|
|
|
|
2010-09-25 11:59:18 +00:00
|
|
|
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.
|
2009-11-03 14:22:47 +00:00
|
|
|
|
|
|
|
=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
|
|
|
|
|
2010-02-07 00:56:14 +00:00
|
|
|
The directories in the kit after de-taring are as follows:
|
2009-11-03 14:22:47 +00:00
|
|
|
|
2010-02-07 00:56:14 +00:00
|
|
|
bin/verilator => Compiler Wrapper invoked to Verilate code
|
2009-11-03 14:22:47 +00:00
|
|
|
include/ => Files that should be in your -I compiler path
|
2010-02-07 00:56:14 +00:00
|
|
|
include/verilated*.cpp => Global routines to link into your simulator
|
2009-11-03 14:22:47 +00:00
|
|
|
include/verilated.h => Global headers
|
|
|
|
include/verilated.v => Stub defines for linting
|
|
|
|
include/verilated.mk => Common makefile
|
|
|
|
src/ => Translator source code
|
|
|
|
test_v => Example Verilog code for other test dirs
|
|
|
|
test_c => Example Verilog->C++ conversion
|
|
|
|
test_sc => Example Verilog->SystemC conversion
|
|
|
|
test_sp => Example Verilog->SystemPerl conversion
|
|
|
|
test_vcs => Example Verilog->VCS conversion (test the test)
|
|
|
|
test_verilated => Internal tests
|
|
|
|
test_regress => Internal tests
|
|
|
|
|
|
|
|
=head1 LIMITATIONS
|
|
|
|
|
|
|
|
See verilator.txt (or execute C<bin/verilator --help>) for limitations.
|