mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a0babb47d | ||
|
|
b085b34a69 | ||
|
|
abc738b6f1 | ||
|
|
d37cc5a160 | ||
|
|
1a0de753e9 | ||
|
|
b798f4fe71 | ||
|
|
0c0a588b55 | ||
|
|
faa5ef193b | ||
|
|
4c7b5005a6 | ||
|
|
9cf61cef9d | ||
|
|
28c61b548b | ||
|
|
0b24e62d43 | ||
|
|
b19dd49fc9 | ||
|
|
91b1e66933 | ||
|
|
eea2712eac | ||
|
|
b19a4b6956 | ||
|
|
a01c995a53 | ||
|
|
59b491e3a8 | ||
|
|
c44febe85e | ||
|
|
15b3c9797b | ||
|
|
584cfa4d4a | ||
|
|
b92f57eacb | ||
|
|
aeeaaa53d4 | ||
|
|
a532fce0e4 | ||
|
|
510fe8e634 | ||
|
|
556d90a1b4 | ||
|
|
4dde1ede0e | ||
|
|
1c833f8a9a | ||
|
|
6a36bd8514 | ||
|
|
12cb819adc | ||
|
|
0607edd191 | ||
|
|
96c7abdb39 | ||
|
|
6835aecdce | ||
|
|
8174c1ad02 | ||
|
|
6129452681 | ||
|
|
be1a3f427e | ||
|
|
18dc947fa9 | ||
|
|
348c43de63 | ||
|
|
cd9b15b2a6 | ||
|
|
8b20d777b0 | ||
|
|
ec0947ef7e | ||
|
|
02e6005fa9 | ||
|
|
a32caac3c1 | ||
|
|
2aa618ce98 | ||
|
|
96b23f6edd | ||
|
|
02d162858f | ||
|
|
82844a5591 | ||
|
|
46fb5a852f | ||
|
|
10a3aa18bc | ||
|
|
3c395c26be | ||
|
|
ea78520220 | ||
|
|
92fbec2294 | ||
|
|
b9be4ae4e8 | ||
|
|
e9a7f60fa7 | ||
|
|
0a02d1f336 | ||
|
|
663f3592ba | ||
|
|
f9484a894f | ||
|
|
4e522ab7f5 | ||
|
|
96d150e92d | ||
|
|
592b2e76a8 | ||
|
|
a3e463030d | ||
|
|
4569278c53 | ||
|
|
851b022c7a | ||
|
|
0985f675e3 | ||
|
|
7df730cedd |
@@ -0,0 +1,197 @@
|
|||||||
|
Artistic License 2.0
|
||||||
|
|
||||||
|
Copyright (c) 2000-2006, The Perl Foundation.
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
********
|
||||||
|
|
||||||
|
This license establishes the terms under which a given free software
|
||||||
|
Package may be copied, modified, distributed, and/or redistributed. The
|
||||||
|
intent is that the Copyright Holder maintains some artistic control over
|
||||||
|
the development of that Package while still keeping the Package
|
||||||
|
available as open source and free software.
|
||||||
|
|
||||||
|
You are always permitted to make arrangements wholly outside of this
|
||||||
|
license directly with the Copyright Holder of a given Package. If the
|
||||||
|
terms of this license do not permit the full use that you propose to
|
||||||
|
make of the Package, you should contact the Copyright Holder and seek a
|
||||||
|
different licensing arrangement.
|
||||||
|
|
||||||
|
Definitions
|
||||||
|
***********
|
||||||
|
|
||||||
|
"Copyright Holder" means the individual(s) or organization(s) named in
|
||||||
|
the copyright notice for the entire Package.
|
||||||
|
|
||||||
|
"Contributor" means any party that has contributed code or other
|
||||||
|
material to the Package, in accordance with the Copyright Holder's
|
||||||
|
procedures.
|
||||||
|
|
||||||
|
"You" and "your" means any person who would like to copy, distribute, or
|
||||||
|
modify the Package.
|
||||||
|
|
||||||
|
"Package" means the collection of files distributed by the Copyright
|
||||||
|
Holder, and derivatives of that collection and/or of those files. A
|
||||||
|
given Package may consist of either the Standard Version, or a Modified
|
||||||
|
Version.
|
||||||
|
|
||||||
|
"Distribute" means providing a copy of the Package or making it
|
||||||
|
accessible to anyone else, or in the case of a company or organization,
|
||||||
|
to others outside of your company or organization.
|
||||||
|
|
||||||
|
"Distributor Fee" means any fee that you charge for Distributing this
|
||||||
|
Package or providing support for this Package to another party. It does
|
||||||
|
not mean licensing fees.
|
||||||
|
|
||||||
|
"Standard Version" refers to the Package if it has not been modified, or
|
||||||
|
has been modified only in ways explicitly requested by the Copyright
|
||||||
|
Holder.
|
||||||
|
|
||||||
|
"Modified Version" means the Package, if it has been changed, and such
|
||||||
|
changes were not explicitly requested by the Copyright Holder.
|
||||||
|
|
||||||
|
"Original License" means this Artistic License as Distributed with the
|
||||||
|
Standard Version of the Package, in its current version or as it may be
|
||||||
|
modified by The Perl Foundation in the future.
|
||||||
|
|
||||||
|
"Source" form means the source code, documentation source, and
|
||||||
|
configuration files for the Package.
|
||||||
|
|
||||||
|
"Compiled" form means the compiled bytecode, object code, binary, or any
|
||||||
|
other form resulting from mechanical transformation or translation of
|
||||||
|
the Source form.
|
||||||
|
|
||||||
|
Permission for Use and Modification Without Distribution
|
||||||
|
********************************************************
|
||||||
|
|
||||||
|
(1) You are permitted to use the Standard Version and create and use
|
||||||
|
Modified Versions for any purpose without restriction, provided that you
|
||||||
|
do not Distribute the Modified Version.
|
||||||
|
|
||||||
|
Permissions for Redistribution of the Standard Version
|
||||||
|
******************************************************
|
||||||
|
|
||||||
|
(2) You may Distribute verbatim copies of the Source form of the
|
||||||
|
Standard Version of this Package in any medium without restriction,
|
||||||
|
either gratis or for a Distributor Fee, provided that you duplicate all
|
||||||
|
of the original copyright notices and associated disclaimers. At your
|
||||||
|
discretion, such verbatim copies may or may not include a Compiled form
|
||||||
|
of the Package.
|
||||||
|
|
||||||
|
(3) You may apply any bug fixes, portability changes, and other
|
||||||
|
modifications made available from the Copyright Holder. The resulting
|
||||||
|
Package will still be considered the Standard Version, and as such will
|
||||||
|
be subject to the Original License.
|
||||||
|
|
||||||
|
Distribution of Modified Versions of the Package as Source
|
||||||
|
**********************************************************
|
||||||
|
|
||||||
|
(4) You may Distribute your Modified Version as Source (either gratis or
|
||||||
|
for a Distributor Fee, and with or without a Compiled form of the
|
||||||
|
Modified Version) provided that you clearly document how it differs from
|
||||||
|
the Standard Version, including, but not limited to, documenting any
|
||||||
|
non-standard features, executables, or modules, and provided that you do
|
||||||
|
at least ONE of the following:
|
||||||
|
|
||||||
|
(a) make the Modified Version available to the Copyright Holder of the
|
||||||
|
Standard Version, under the Original License, so that the Copyright
|
||||||
|
Holder may include your modifications in the Standard Version.
|
||||||
|
|
||||||
|
(b) ensure that installation of your Modified Version does not prevent
|
||||||
|
the user installing or running the Standard Version. In addition, the
|
||||||
|
Modified Version must bear a name that is different from the name of the
|
||||||
|
Standard Version.
|
||||||
|
|
||||||
|
(c) allow anyone who receives a copy of the Modified Version to make the
|
||||||
|
Source form of the Modified Version available to others under
|
||||||
|
|
||||||
|
(i) the Original License or
|
||||||
|
|
||||||
|
(ii) a license that permits the licensee to freely copy, modify and
|
||||||
|
redistribute the Modified Version using the same licensing terms that
|
||||||
|
apply to the copy that the licensee received, and requires that the
|
||||||
|
Source form of the Modified Version, and of any works derived from it,
|
||||||
|
be made freely available in that license fees are prohibited but
|
||||||
|
Distributor Fees are allowed.
|
||||||
|
|
||||||
|
Distribution of Compiled Forms of the Standard Version or Modified
|
||||||
|
******************************************************************
|
||||||
|
Versions without the Source
|
||||||
|
***************************
|
||||||
|
|
||||||
|
(5) You may Distribute Compiled forms of the Standard Version without
|
||||||
|
the Source, provided that you include complete instructions on how to
|
||||||
|
get the Source of the Standard Version. Such instructions must be valid
|
||||||
|
at the time of your distribution. If these instructions, at any time
|
||||||
|
while you are carrying out such distribution, become invalid, you must
|
||||||
|
provide new instructions on demand or cease further distribution. If
|
||||||
|
you provide valid instructions or cease distribution within thirty days
|
||||||
|
after you become aware that the instructions are invalid, then you do
|
||||||
|
not forfeit any of your rights under this license.
|
||||||
|
|
||||||
|
(6) You may Distribute a Modified Version in Compiled form without the
|
||||||
|
Source, provided that you comply with Section 4 with respect to the
|
||||||
|
Source of the Modified Version.
|
||||||
|
|
||||||
|
Aggregating or Linking the Package
|
||||||
|
**********************************
|
||||||
|
|
||||||
|
(7) You may aggregate the Package (either the Standard Version or
|
||||||
|
Modified Version) with other packages and Distribute the resulting
|
||||||
|
aggregation provided that you do not charge a licensing fee for the
|
||||||
|
Package. Distributor Fees are permitted, and licensing fees for other
|
||||||
|
components in the aggregation are permitted. The terms of this license
|
||||||
|
apply to the use and Distribution of the Standard or Modified Versions
|
||||||
|
as included in the aggregation.
|
||||||
|
|
||||||
|
(8) You are permitted to link Modified and Standard Versions with other
|
||||||
|
works, to embed the Package in a larger work of your own, or to build
|
||||||
|
stand-alone binary or bytecode versions of applications that include the
|
||||||
|
Package, and Distribute the result without restriction, provided the
|
||||||
|
result does not expose a direct interface to the Package.
|
||||||
|
|
||||||
|
Items That are Not Considered Part of a Modified Version
|
||||||
|
********************************************************
|
||||||
|
|
||||||
|
(9) Works (including, but not limited to, modules and scripts) that
|
||||||
|
merely extend or make use of the Package, do not, by themselves, cause
|
||||||
|
the Package to be a Modified Version. In addition, such works are not
|
||||||
|
considered parts of the Package itself, and are not subject to the terms
|
||||||
|
of this license.
|
||||||
|
|
||||||
|
General Provisions
|
||||||
|
******************
|
||||||
|
|
||||||
|
(10) Any use, modification, and distribution of the Standard or Modified
|
||||||
|
Versions is governed by this Artistic License. By using, modifying or
|
||||||
|
distributing the Package, you accept this license. Do not use, modify,
|
||||||
|
or distribute the Package, if you do not accept this license.
|
||||||
|
|
||||||
|
(11) If your Modified Version has been derived from a Modified Version
|
||||||
|
made by someone other than you, you are nevertheless required to ensure
|
||||||
|
that your Modified Version complies with the requirements of this
|
||||||
|
license.
|
||||||
|
|
||||||
|
(12) This license does not grant you the right to use any trademark,
|
||||||
|
service mark, tradename, or logo of the Copyright Holder.
|
||||||
|
|
||||||
|
(13) This license includes the non-exclusive, worldwide, free-of-charge
|
||||||
|
patent license to make, have made, use, offer to sell, sell, import and
|
||||||
|
otherwise transfer the Package with respect to any patent claims
|
||||||
|
licensable by the Copyright Holder that are necessarily infringed by the
|
||||||
|
Package. If you institute patent litigation (including a cross-claim or
|
||||||
|
counterclaim) against any party alleging that the Package constitutes
|
||||||
|
direct or contributory patent infringement, then this Artistic License
|
||||||
|
to you shall terminate on the date that such litigation is filed.
|
||||||
|
|
||||||
|
(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT
|
||||||
|
PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -1,285 +1,626 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The GNU General Public License is a free, copyleft license for
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
software and other kinds of works.
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
The licenses for most software and other practical works are designed
|
||||||
General Public License applies to most of the Free Software
|
to take away your freedom to share and change the works. By contrast,
|
||||||
Foundation's software and to any other program whose authors commit to
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
share and change all versions of a program--to make sure it remains free
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
your programs, too.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
have the freedom to distribute copies of free software (and charge for
|
have the freedom to distribute copies of free software (and charge for
|
||||||
this service if you wish), that you receive source code or can get it
|
them if you wish), that you receive source code or can get it if you
|
||||||
if you want it, that you can change the software or use pieces of it
|
want it, that you can change the software or use pieces of it in new
|
||||||
in new free programs; and that you know you can do these things.
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
To protect your rights, we need to prevent others from denying you
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
These restrictions translate to certain responsibilities for you if you
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
distribute copies of the software, or if you modify it.
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
For example, if you distribute copies of such a program, whether
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
you have. You must make sure that they, too, receive or can get the
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
source code. And you must show them these terms so they know their
|
or can get the source code. And you must show them these terms so they
|
||||||
rights.
|
know their rights.
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
distribute and/or modify the software.
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
that everyone understands that there is no warranty for this free
|
that there is no warranty for this free software. For both users' and
|
||||||
software. If the software is modified by someone else and passed on, we
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
want its recipients to know that what they have is not the original, so
|
changed, so that their problems will not be attributed erroneously to
|
||||||
that any problems introduced by others will not reflect on the original
|
authors of previous versions.
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
Some devices are designed to deny users access to install or run
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
modified versions of the software inside them, although the manufacturer
|
||||||
program will individually obtain patent licenses, in effect making the
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
protecting users' freedom to change the software. The systematic
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
TERMS AND CONDITIONS
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
0. Definitions.
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
of it, thus forming a work based on the Program, and copy and
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
distribute such modifications or work under the terms of Section 1
|
"recipients" may be individuals or organizations.
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
stating that you changed the files and the date of any change.
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
A "covered work" means either the unmodified Program or a work based
|
||||||
whole or in part contains or is derived from the Program or any
|
on the Program.
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
To "propagate" a work means to do anything with it that, without
|
||||||
when run, you must cause it, when started running for such
|
permission, would make you directly or secondarily liable for
|
||||||
interactive use in the most ordinary way, to print or display an
|
infringement under applicable copyright law, except executing it on a
|
||||||
announcement including an appropriate copyright notice and a
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
notice that there is no warranty (or else, saying that you provide
|
distribution (with or without modification), making available to the
|
||||||
a warranty) and that users may redistribute the program under
|
public, and in some countries other activities as well.
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
To "convey" a work means any kind of propagation that enables other
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
exercise the right to control the distribution of derivative or
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
to the extent that it includes a convenient and prominently visible
|
||||||
a storage or distribution medium does not bring the other work under
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
the scope of this License.
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
1. Source Code.
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
The "source code" for a work means the preferred form of the work
|
||||||
source code, which must be distributed under the terms of Sections
|
for making modifications to it. "Object code" means any non-source
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
form of a work.
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
A "Standard Interface" means an interface that either is an official
|
||||||
years, to give any third party, for a charge no more than your
|
standard defined by a recognized standards body, or, in the case of
|
||||||
cost of physically performing source distribution, a complete
|
interfaces specified for a particular programming language, one that
|
||||||
machine-readable copy of the corresponding source code, to be
|
is widely used among developers working in that language.
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
The "System Libraries" of an executable work include anything, other
|
||||||
to distribute corresponding source code. (This alternative is
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
allowed only for noncommercial distribution and only if you
|
packaging a Major Component, but which is not part of that Major
|
||||||
received the program in object code or executable form with such
|
Component, and (b) serves only to enable use of the work with that
|
||||||
an offer, in accord with Subsection b above.)
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
The "Corresponding Source" for a work in object code form means all
|
||||||
making modifications to it. For an executable work, complete source
|
the source code needed to generate, install, and (for an executable
|
||||||
code means all the source code for all modules it contains, plus any
|
work) run the object code and to modify the work, including scripts to
|
||||||
associated interface definition files, plus the scripts used to
|
control those activities. However, it does not include the work's
|
||||||
control compilation and installation of the executable. However, as a
|
System Libraries, or general-purpose tools or generally available free
|
||||||
special exception, the source code distributed need not include
|
programs which are used unmodified in performing those activities but
|
||||||
anything that is normally distributed (in either source or binary
|
which are not part of the work. For example, Corresponding Source
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
includes interface definition files associated with source files for
|
||||||
operating system on which the executable runs, unless that component
|
the work, and the source code for shared libraries and dynamically
|
||||||
itself accompanies the executable.
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
The Corresponding Source need not include anything that users
|
||||||
access to copy from a designated place, then offering equivalent
|
can regenerate automatically from other parts of the Corresponding
|
||||||
access to copy the source code from the same place counts as
|
Source.
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
The Corresponding Source for a work in source code form is that
|
||||||
signed it. However, nothing else grants you permission to modify or
|
same work.
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
2. Basic Permissions.
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
All rights granted under this License are granted for the term of
|
||||||
these terms and conditions. You may not impose any further
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
You are not responsible for enforcing compliance by third parties to
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
this License.
|
this License.
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
infringement or for any other reason (not limited to patent issues),
|
patent license under the contributor's essential patent claims, to
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
excuse you from the conditions of this License. If you cannot
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
License and any other pertinent obligations, then as a consequence you
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
may not distribute the Program at all. For example, if a patent
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
license would not permit royalty-free redistribution of the Program by
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
all those who receive copies directly or indirectly through you, then
|
the Program, the only way you could satisfy both those terms and this
|
||||||
the only way you could satisfy both it and this License would be to
|
License would be to refrain entirely from conveying the Program.
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
13. Use with the GNU Affero General Public License.
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
Notwithstanding any other provision of this License, you have
|
||||||
patents or other property right claims or to contest validity of any
|
permission to link or combine any covered work with a work licensed
|
||||||
such claims; this section has the sole purpose of protecting the
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
integrity of the free software distribution system, which is
|
combined work, and to convey the resulting work. The terms of this
|
||||||
implemented by public license practices. Many people have made
|
License will continue to apply to the part which is the covered work,
|
||||||
generous contributions to the wide range of software distributed
|
but the special requirements of the GNU Affero General Public License,
|
||||||
through that system in reliance on consistent application of that
|
section 13, concerning interaction through a network will apply to the
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
combination as such.
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
14. Revised Versions of this License.
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
of the General Public License from time to time. Such new versions will
|
the GNU General Public License from time to time. Such new versions will
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
address new problems or concerns.
|
address new problems or concerns.
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
Each version is given a distinguishing version number. If the
|
||||||
specifies a version number of this License which applies to it and "any
|
Program specifies that a certain numbered version of the GNU General
|
||||||
later version", you have the option of following the terms and conditions
|
Public License "or any later version" applies to it, you have the
|
||||||
either of that version or of any later version published by the Free
|
option of following the terms and conditions either of that numbered
|
||||||
Software Foundation. If the Program does not specify a version number of
|
version or of any later version published by the Free Software
|
||||||
this License, you may choose any version ever published by the Free Software
|
Foundation. If the Program does not specify a version number of the
|
||||||
Foundation.
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
If the Program specifies that a proxy can decide which future
|
||||||
programs whose distribution conditions are different, write to the author
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
public statement of acceptance of a version permanently authorizes you
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
to choose that version for the Program.
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
15. Disclaimer of Warranty.
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
16. Limitation of Liability.
|
||||||
|
|
||||||
Appendix: How to Apply These Terms to Your New Programs
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
possible use to the public, the best way to achieve this is to make it
|
possible use to the public, the best way to achieve this is to make it
|
||||||
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
|
|||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
To do so, attach the following notices to the program. It is safest
|
||||||
to attach them to the start of each source file to most effectively
|
to attach them to the start of each source file to most effectively
|
||||||
convey the exclusion of warranty; and each file should have at least
|
state the exclusion of warranty; and each file should have at least
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) 19yy <name of author>
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
@@ -304,36 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
If the program does terminal interaction, make it output a short
|
||||||
when it starts in an interactive mode:
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
<program> Copyright (C) <year> <name of author>
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
parts of the General Public License. Of course, the commands you use may
|
parts of the General Public License. Of course, your program's commands
|
||||||
be called something other than `show w' and `show c'; they could even be
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
necessary. Here is a sample; alter the names:
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
The GNU General Public License does not permit incorporating your program
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
<signature of Ty Coon>, 1 April 1989
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
Ty Coon, President of Vice
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Library General
|
|
||||||
Public License instead of this License.
|
|
||||||
|
|||||||
@@ -3,6 +3,77 @@ Revision history for Verilator
|
|||||||
The contributors that suggested a given feature are shown in []. [by ...]
|
The contributors that suggested a given feature are shown in []. [by ...]
|
||||||
indicates the contributor was also the author of the fix; Thanks!
|
indicates the contributor was also the author of the fix; Thanks!
|
||||||
|
|
||||||
|
* Verilator 3.714 2009/09/18
|
||||||
|
|
||||||
|
** Add --bbox-sys option to blackbox $system calls.
|
||||||
|
|
||||||
|
** Support generate for var++, var--, ++var, --var.
|
||||||
|
|
||||||
|
*** Improved warning when "do" used as identifier.
|
||||||
|
|
||||||
|
**** Don't require SYSTEMPERL_INCLUDE if SYSTEMPERL/src exists. [Gary Thomas]
|
||||||
|
|
||||||
|
**** Fix deep defines causing flex scanner overflows. [Brad Dobbie]
|
||||||
|
|
||||||
|
**** Fix preprocessing commas in deep parameterized macros. [Brad Dobbie]
|
||||||
|
|
||||||
|
**** Fix tracing escaped dotted identifiers, bug107.
|
||||||
|
|
||||||
|
**** Fix $display with uppercase %M.
|
||||||
|
|
||||||
|
**** Fix --error-limit option being ignored.
|
||||||
|
|
||||||
|
* Verilator 3.713 2009/08/04
|
||||||
|
|
||||||
|
** Support constant function calls for parameters. [many!]
|
||||||
|
|
||||||
|
*** Support SystemVerilog "logic", bug101. [by Alex Duller]
|
||||||
|
|
||||||
|
*** Name SYMRSVDWORD error, and allow disabling it, bug103. [Gary Thomas]
|
||||||
|
|
||||||
|
**** Fix escaped preprocessor identifiers, bug106. [Nimrod Gileadi]
|
||||||
|
|
||||||
|
* Verilator 3.712 2009/07/14
|
||||||
|
|
||||||
|
** Patching SystemC is no longer required to trace sc_bvs.
|
||||||
|
|
||||||
|
*** Support zero-width constants in concatenations. [Jeff Winston]
|
||||||
|
|
||||||
|
*** Add verilator --pins-uint8 option to use sc_in<uint8_t/uint16_t>.
|
||||||
|
|
||||||
|
*** Add verilator -V option, to show verbose version.
|
||||||
|
|
||||||
|
*** On WIDTH warnings, show variable name causing error. [Jeff Winston]
|
||||||
|
|
||||||
|
**** Add BLKLOOPINIT error code, and describe --unroll-count. [Jeff Winston]
|
||||||
|
|
||||||
|
* Verilator 3.711 2009/06/23
|
||||||
|
|
||||||
|
**** Support decimal constants of arbitrary widths. [Mark Marshall]
|
||||||
|
|
||||||
|
**** Fix error on case statement with all duplicate items, bug99. [Gary Thomas]
|
||||||
|
|
||||||
|
**** Fix segfault on unrolling for's with bad inits, bug90. [Andreas Olofsson]
|
||||||
|
|
||||||
|
**** Fix tristates causing "Assigned pin is neither...". [by Lane Brooks]
|
||||||
|
|
||||||
|
**** Fix compiler errors under Fedora release candidate 11. [Chitlesh Goorah]
|
||||||
|
|
||||||
|
* Verilator 3.710 2009/05/19
|
||||||
|
|
||||||
|
** Verilator is now licensed under LGPL v3 and/or Artistic v2.0.
|
||||||
|
|
||||||
|
*** `__FILE__ now expands to a string, per draft SystemVerilog 2010(ish).
|
||||||
|
|
||||||
|
**** The front end parser has been re-factored to enable more SV parsing.
|
||||||
|
Code should parse the same, but minor parsing bugs may pop up.
|
||||||
|
|
||||||
|
**** Verilator_includer is no longer installed twice, bug48. [Lane Brooks]
|
||||||
|
|
||||||
|
**** Fix escaped identifiers with '.' causing conflicts, bug83. [J Baxter]
|
||||||
|
|
||||||
|
**** Fix define formal arguments that contain newlines, bug84. [David A]
|
||||||
|
|
||||||
* Verilator 3.703 2009/05/02
|
* Verilator 3.703 2009/05/02
|
||||||
|
|
||||||
*** Fix $clog2 calculation error with powers-of-2, bug81. [Patricio Kaplan]
|
*** Fix $clog2 calculation error with powers-of-2, bug81. [Patricio Kaplan]
|
||||||
@@ -1417,9 +1488,10 @@ of input ports exists for tracing.
|
|||||||
|
|
||||||
This uses outline mode in Emacs. See C-h m [M-x describe-mode].
|
This uses outline mode in Emacs. See C-h m [M-x describe-mode].
|
||||||
|
|
||||||
Copyright 2001-2009 by Wilson Snyder. This program is free software;
|
Copyright 2001-2009 by Wilson Snyder. This program is free software; you
|
||||||
you can redistribute it and/or modify it under the terms of either the GNU
|
can redistribute it and/or modify it under the terms of either the GNU
|
||||||
General Public License or the Perl Artistic License.
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
Version 2.0.
|
||||||
|
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: outline
|
mode: outline
|
||||||
|
|||||||
+11
-5
@@ -11,7 +11,8 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
# redistribute it and/or modify it under the terms of either the GNU
|
# redistribute it and/or modify it under the terms of either the GNU
|
||||||
# General Public License or the Perl Artistic License.
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
# Version 2.0.
|
||||||
#
|
#
|
||||||
# Verilator is distributed in the hope that it will be useful,
|
# Verilator is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -86,6 +87,9 @@ pkgdatadir = @pkgdatadir@
|
|||||||
# Directory in which to install data across multiple architectures
|
# Directory in which to install data across multiple architectures
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
|
|
||||||
|
# Compile options
|
||||||
|
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
|
||||||
|
|
||||||
#### End of system configuration section. ####
|
#### End of system configuration section. ####
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -100,13 +104,12 @@ DISTDEP = info Makefile
|
|||||||
# Files to distribute.
|
# Files to distribute.
|
||||||
DISTBIN = $(wildcard bin/verilator-*)
|
DISTBIN = $(wildcard bin/verilator-*)
|
||||||
|
|
||||||
DISTFILES_INC = $(INFOS) .gitignore COPYING *.in *.ac \
|
DISTFILES_INC = $(INFOS) .gitignore Artistic COPYING *.in *.ac \
|
||||||
Changes README TODO \
|
Changes README TODO \
|
||||||
MANIFEST.SKIP \
|
MANIFEST.SKIP \
|
||||||
bin/* \
|
bin/* \
|
||||||
install-sh configure mkinstalldirs *.texi \
|
install-sh configure mkinstalldirs *.texi \
|
||||||
include/verilated.[chv]* \
|
include/verilated*.[chv]* \
|
||||||
include/verilatedos.[chv]* \
|
|
||||||
include/*.in \
|
include/*.in \
|
||||||
include/.*ignore \
|
include/.*ignore \
|
||||||
.*attributes */.*attributes */*/.*attributes \
|
.*attributes */.*attributes */*/.*attributes \
|
||||||
@@ -230,7 +233,6 @@ VL_INST_BIN_FILES = verilator verilator_bin verilator_bin_dbg \
|
|||||||
installbin:
|
installbin:
|
||||||
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
|
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
|
||||||
( cd bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
|
( cd bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
|
||||||
( cd bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(bindir)/verilator_includer )
|
|
||||||
( cd bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
|
( cd bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
|
||||||
( $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin )
|
( $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin )
|
||||||
( $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg )
|
( $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg )
|
||||||
@@ -271,6 +273,10 @@ install-project: dist
|
|||||||
rm $(DISTNAME).tgz
|
rm $(DISTNAME).tgz
|
||||||
|
|
||||||
install-project-quick:
|
install-project-quick:
|
||||||
|
ifeq ($(CFG_WITH_DEFENV),yes)
|
||||||
|
@echo "%Error: Reconfigure with './configure --disable-defenv' to avoid hardcoded paths."
|
||||||
|
false
|
||||||
|
endif
|
||||||
@echo "Install-project-quick (no strip) to $(DIRPROJECT)"
|
@echo "Install-project-quick (no strip) to $(DIRPROJECT)"
|
||||||
for p in $(INST_PROJ_FILES) ; do \
|
for p in $(INST_PROJ_FILES) ; do \
|
||||||
$(INST_PROJ_CVS) $$p $(DIRPROJECT)/hw/utils/verilator/$$p; \
|
$(INST_PROJ_CVS) $$p $(DIRPROJECT)/hw/utils/verilator/$$p; \
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
|
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|||||||
+155
-35
@@ -3,9 +3,10 @@ eval 'exec perl -wS $0 ${1+"$@"}'
|
|||||||
if 0;
|
if 0;
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you
|
||||||
# redistribute it and/or modify it under the terms of either the GNU
|
# can redistribute it and/or modify it under the terms of either the GNU
|
||||||
# General Public License or the Perl Artistic License.
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
# Version 2.0.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -17,9 +18,9 @@ eval 'exec perl -wS $0 ${1+"$@"}'
|
|||||||
require 5.006_001;
|
require 5.006_001;
|
||||||
use warnings;
|
use warnings;
|
||||||
BEGIN {
|
BEGIN {
|
||||||
if (my $Project=($ENV{DIRPROJECT}||$ENV{PROJECT})) {
|
if ($ENV{DIRPROJECT} && $ENV{DIRPROJECT_PERL_BOOT}) {
|
||||||
# Magic to allow author testing of perl packages in local directory
|
# Magic to allow author testing of perl packages in local directory
|
||||||
require "$Project/hw/utils/perltools/boot.pl";
|
require $ENV{DIRPROJECT}."/".$ENV{DIRPROJECT_PERL_BOOT};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,6 +179,7 @@ descriptions in the next sections for more information.
|
|||||||
|
|
||||||
--assert Enable all assertions
|
--assert Enable all assertions
|
||||||
--autoflush Flush streams after all $displays
|
--autoflush Flush streams after all $displays
|
||||||
|
--bbox-sys Blackbox unknown $system calls
|
||||||
--bin <filename> Override Verilator binary
|
--bin <filename> Override Verilator binary
|
||||||
--cc Create C++ output
|
--cc Create C++ output
|
||||||
--compiler <compiler-name> Tune for specified C++ compiler
|
--compiler <compiler-name> Tune for specified C++ compiler
|
||||||
@@ -192,7 +194,7 @@ descriptions in the next sections for more information.
|
|||||||
--debugi-<srcfile> <level> Enable debugging a source file at a level
|
--debugi-<srcfile> <level> Enable debugging a source file at a level
|
||||||
--dump-tree Enable dumping .tree files
|
--dump-tree Enable dumping .tree files
|
||||||
-E Preprocess, but do not compile
|
-E Preprocess, but do not compile
|
||||||
--error-limit <value> Abort after this number of errors
|
--error-limit <value> Abort after this number of errors
|
||||||
--exe Link to create executable
|
--exe Link to create executable
|
||||||
-f <file> Parse options from a file
|
-f <file> Parse options from a file
|
||||||
--help Display this help.
|
--help Display this help.
|
||||||
@@ -213,6 +215,7 @@ descriptions in the next sections for more information.
|
|||||||
--output-split <bytes> Split .cpp files into pieces
|
--output-split <bytes> Split .cpp files into pieces
|
||||||
--output-split-cfuncs <statements> Split .ccp functions
|
--output-split-cfuncs <statements> Split .ccp functions
|
||||||
--pins-bv <bits> Specify types for top level ports
|
--pins-bv <bits> Specify types for top level ports
|
||||||
|
--pins-uint8 Specify types for top level ports
|
||||||
--prefix <topname> Name of top level class
|
--prefix <topname> Name of top level class
|
||||||
--profile-cfuncs Name functions for profiling
|
--profile-cfuncs Name functions for profiling
|
||||||
--private Debugging; see docs
|
--private Debugging; see docs
|
||||||
@@ -226,10 +229,14 @@ descriptions in the next sections for more information.
|
|||||||
--trace-depth <levels> Depth of tracing
|
--trace-depth <levels> Depth of tracing
|
||||||
-U<var> Undefine preprocessor define
|
-U<var> Undefine preprocessor define
|
||||||
--underline-zero Zero signals with leading _'s
|
--underline-zero Zero signals with leading _'s
|
||||||
|
--unroll-count <loops> Tune maximum loop iterations
|
||||||
|
--unroll-stmts <stmts> Tune maximum loop body size
|
||||||
|
-V Verbose version and config
|
||||||
-v <filename> Verilog library
|
-v <filename> Verilog library
|
||||||
-Werror-<message> Convert warning to error
|
-Werror-<message> Convert warning to error
|
||||||
-Wfuture-<message> Disable unknown message warnings
|
-Wfuture-<message> Disable unknown message warnings
|
||||||
-Wno-<message> Disable warning
|
-Wno-<message> Disable warning
|
||||||
|
-Wno-lint Disable all lint warnings
|
||||||
-x-assign <mode> Initially assign Xs to this value
|
-x-assign <mode> Initially assign Xs to this value
|
||||||
-y <dir> Directory to search for modules
|
-y <dir> Directory to search for modules
|
||||||
|
|
||||||
@@ -266,6 +273,14 @@ After every $display or $fdisplay, flush the output stream. This insures
|
|||||||
that messages will appear immediately but may reduce performance. Defaults
|
that messages will appear immediately but may reduce performance. Defaults
|
||||||
off, which will buffer output as provided by the normal C stdio calls.
|
off, which will buffer output as provided by the normal C stdio calls.
|
||||||
|
|
||||||
|
=item --bbox-sys
|
||||||
|
|
||||||
|
Black box any unknown $system task or function calls. System tasks will be
|
||||||
|
simply NOPed, and system functions will be replaced by unsized zero.
|
||||||
|
Arguments to such functions will be parsed, but not otherwise checked.
|
||||||
|
This prevents errors when linting in the presence of company specific PLI
|
||||||
|
calls.
|
||||||
|
|
||||||
=item --bin I<filename>
|
=item --bin I<filename>
|
||||||
|
|
||||||
Rarely needed. Override the default filename for Verilator itself. When a
|
Rarely needed. Override the default filename for Verilator itself. When a
|
||||||
@@ -438,6 +453,9 @@ appropriate `begin_keywords.
|
|||||||
|
|
||||||
Check the files for lint violations only, do not create any other output.
|
Check the files for lint violations only, do not create any other output.
|
||||||
|
|
||||||
|
If the design is not to be completely Verilated see also the --bbox-sys
|
||||||
|
option.
|
||||||
|
|
||||||
=item --MMD
|
=item --MMD
|
||||||
|
|
||||||
Enable creation of .d dependency files, used for make dependency detection,
|
Enable creation of .d dependency files, used for make dependency detection,
|
||||||
@@ -512,10 +530,16 @@ Backward compatible alias for "--pins-bv 65". Note that's a 65, not a 64.
|
|||||||
|
|
||||||
=item --pins-bv I<width>
|
=item --pins-bv I<width>
|
||||||
|
|
||||||
Specifies SystemC outputs of greater than or equal to I<width> bits wide
|
Specifies SystemC inputs/outputs of greater than or equal to I<width> bits
|
||||||
should use sc_bv's instead of uint32/uint64_t's. The default is "--pins-bv
|
wide should use sc_bv's instead of uint32/uint64_t's. The default is
|
||||||
65". Versions before Verilator 3.671 defaulted to "--pins-bv 33". The
|
"--pins-bv 65". Versions before Verilator 3.671 defaulted to "--pins-bv
|
||||||
more sc_bv is used, the worse for performance.
|
33". The more sc_bv is used, the worse for performance.
|
||||||
|
|
||||||
|
=item --pins-uint8
|
||||||
|
|
||||||
|
Specifies SystemC inputs/outputs that are smaller than the --pins-bv
|
||||||
|
setting and 8 bits or less should use uint8_t instead of uint32_t.
|
||||||
|
Likewise pins of width 9-16 will use uint16_t instead of uint32_t.
|
||||||
|
|
||||||
=item --prefix I<topname>
|
=item --prefix I<topname>
|
||||||
|
|
||||||
@@ -601,6 +625,16 @@ zero, as was done in Verilator 2. Default is for all signals including
|
|||||||
those with underlines being randomized. This option may be depreciated in
|
those with underlines being randomized. This option may be depreciated in
|
||||||
future versions.
|
future versions.
|
||||||
|
|
||||||
|
=item --unroll-count I<loops>
|
||||||
|
|
||||||
|
Rarely needed. Specifies the maximum number of loop iterations that may be
|
||||||
|
unrolled. See also BLKLOOPINIT warning.
|
||||||
|
|
||||||
|
=item --unroll-stmts I<statements>
|
||||||
|
|
||||||
|
Rarely needed. Specifies the maximum number of statements in a loop for
|
||||||
|
that loop to be unrolled. See also BLKLOOPINIT warning.
|
||||||
|
|
||||||
=item -Werror-I<message>
|
=item -Werror-I<message>
|
||||||
|
|
||||||
Convert the specified warning message into a error message. This is
|
Convert the specified warning message into a error message. This is
|
||||||
@@ -695,6 +729,11 @@ example module I<x> is referenced, look in I<x>.I<ext>.
|
|||||||
|
|
||||||
Undefines the given preprocessor symbol.
|
Undefines the given preprocessor symbol.
|
||||||
|
|
||||||
|
=item -V
|
||||||
|
|
||||||
|
Shows the verbose version, including configuration information compiled
|
||||||
|
into Verilator. (Similar to perl -V.)
|
||||||
|
|
||||||
=item -v I<filename>
|
=item -v I<filename>
|
||||||
|
|
||||||
Read the filename as a Verilog library. Any modules in the file may be
|
Read the filename as a Verilog library. Any modules in the file may be
|
||||||
@@ -827,6 +866,27 @@ Really, you're better off using a Makefile to do all this for you. Then,
|
|||||||
when your source changes it will automatically run all of these steps. See
|
when your source changes it will automatically run all of these steps. See
|
||||||
the test_sp directory in the distribution for an example.
|
the test_sp directory in the distribution for an example.
|
||||||
|
|
||||||
|
=head1 CADENCE NC-SYSTEMC EXECUTION
|
||||||
|
|
||||||
|
Similar to compiling Verilated designs with gcc, Verilated designs may be
|
||||||
|
compiled inside other simulators that support SystemC models. One such
|
||||||
|
simulator is Cadence's NC-SystemC, part of their Incisive Verification
|
||||||
|
Suite. (Highly recommended.)
|
||||||
|
|
||||||
|
Using the example files above, the following command will build the model
|
||||||
|
underneath NC:
|
||||||
|
|
||||||
|
cd obj_dir
|
||||||
|
ncsc_run \
|
||||||
|
sc_main.cpp \
|
||||||
|
Vour__ALLcls.cpp \
|
||||||
|
Vour__ALLsup.cpp \
|
||||||
|
verilated.cpp
|
||||||
|
|
||||||
|
For larger designs you'll want to automate this using makefiles, which pull
|
||||||
|
the names of the .cpp files to compile in from the make variables generated
|
||||||
|
in obj_dir/Vour_classes.mk.
|
||||||
|
|
||||||
=head1 BENCHMARKING & OPTIMIZATION
|
=head1 BENCHMARKING & OPTIMIZATION
|
||||||
|
|
||||||
For best performance, run Verilator with the "-O3 -x-assign=fast
|
For best performance, run Verilator with the "-O3 -x-assign=fast
|
||||||
@@ -1109,8 +1169,8 @@ including function call-like preprocessor defines.
|
|||||||
|
|
||||||
Verilator supports ==? and !=? operators, $bits, $countones, $error,
|
Verilator supports ==? and !=? operators, $bits, $countones, $error,
|
||||||
$fatal, $info, $isunknown, $onehot, $onehot0, $warning, always_comb,
|
$fatal, $info, $isunknown, $onehot, $onehot0, $warning, always_comb,
|
||||||
always_ff, always_latch, do-while, final, priority case/if, and unique
|
always_ff, always_latch, do-while, final, logic, priority case/if, and
|
||||||
case/if.
|
unique case/if.
|
||||||
|
|
||||||
It also supports .name and .* interconnection.
|
It also supports .name and .* interconnection.
|
||||||
|
|
||||||
@@ -1595,17 +1655,9 @@ All specify blocks and timing checks are ignored.
|
|||||||
|
|
||||||
=head2 Array Initialization
|
=head2 Array Initialization
|
||||||
|
|
||||||
When initializing an array, you need to use non-delayed assignments. This
|
When initializing a large array, you need to use non-delayed assignments.
|
||||||
is done in the interest of speed; if delayed assignments were used, the
|
Verilator will tell you when this needs to be fixed; see the BLKLOOPINIT
|
||||||
simulator would have to copy large arrays every cycle. (In smaller loops,
|
error for more information.
|
||||||
loop unrolling allows the delayed assignment to work, though it's a bit
|
|
||||||
slower than a non-delayed assignment.) Here's an example
|
|
||||||
|
|
||||||
always @ (posedge clk)
|
|
||||||
if (~reset_l) begin
|
|
||||||
for (i=0; i<`ARRAY_SIZE; i++) begin
|
|
||||||
array[i] = 0; // Non-delayed for verilator
|
|
||||||
end
|
|
||||||
|
|
||||||
=head2 Array Out of Bounds
|
=head2 Array Out of Bounds
|
||||||
|
|
||||||
@@ -1773,6 +1825,25 @@ inside a public task.
|
|||||||
Ignoring this warning may make Verilator simulations differ from other
|
Ignoring this warning may make Verilator simulations differ from other
|
||||||
simulators.
|
simulators.
|
||||||
|
|
||||||
|
=item BLKLOOPINIT
|
||||||
|
|
||||||
|
This indicates that the initialization of an array needs to use non-delayed
|
||||||
|
assignments. This is done in the interest of speed; if delayed assignments
|
||||||
|
were used, the simulator would have to copy large arrays every cycle. (In
|
||||||
|
smaller loops, loop unrolling allows the delayed assignment to work, though
|
||||||
|
it's a bit slower than a non-delayed assignment.) Here's an example
|
||||||
|
|
||||||
|
always @ (posedge clk)
|
||||||
|
if (~reset_l) begin
|
||||||
|
for (i=0; i<`ARRAY_SIZE; i++) begin
|
||||||
|
array[i] = 0; // Non-delayed for verilator
|
||||||
|
end
|
||||||
|
|
||||||
|
This message is only seen on large or complicated loops because Verilator
|
||||||
|
generally unrolls small loops. You may want to try increasing
|
||||||
|
--unroll-count (and occasionally --unroll-stmts) which will raise the small
|
||||||
|
loop bar to avoid this error.
|
||||||
|
|
||||||
=item CASEINCOMPLETE
|
=item CASEINCOMPLETE
|
||||||
|
|
||||||
Warns that inside a case statement there is a stimulus pattern for which
|
Warns that inside a case statement there is a stimulus pattern for which
|
||||||
@@ -1920,6 +1991,13 @@ example:
|
|||||||
Ignoring this warning may make Verilator simulations differ from other
|
Ignoring this warning may make Verilator simulations differ from other
|
||||||
simulators.
|
simulators.
|
||||||
|
|
||||||
|
=item SYMRSVDWORD
|
||||||
|
|
||||||
|
Error that a symbol matches a C++ reserved word and using this as a symbol
|
||||||
|
name would result in odd C compiler errors. You may disable this error
|
||||||
|
message as you would disable warnings, but the symbol will be renamed by
|
||||||
|
Verilator to avoid the conflict.
|
||||||
|
|
||||||
=item TASKNSVAR
|
=item TASKNSVAR
|
||||||
|
|
||||||
Error when a call to a task or function has a output from that task tied to
|
Error when a call to a task or function has a output from that task tied to
|
||||||
@@ -2163,10 +2241,13 @@ silicon.
|
|||||||
|
|
||||||
=item May programs I create with Verilator remain under my own copyright?
|
=item May programs I create with Verilator remain under my own copyright?
|
||||||
|
|
||||||
Yes, it's just like using GCC on your programs. If you change Verilator
|
Yes, it's just like using GCC on your programs; this is why Verilator uses
|
||||||
itself, you must make the source code available under the GNU Public
|
the "GNU *Lesser* Public License" instead of the more typical "GNU Public
|
||||||
License. However, the include and generated files use the GNU Lesser
|
License". If you change Verilator itself or the header files Verilator
|
||||||
Public License, which means that files using them are NOT required to be released.
|
includes, you must make the source code available under the GNU Lesser
|
||||||
|
Public License. However, Verilator output (the Verilated code) only
|
||||||
|
includes the licensed files, and so you are NOT required to release any
|
||||||
|
output from Verilator.
|
||||||
|
|
||||||
You also have the option of using the Perl Artistic License, which again
|
You also have the option of using the Perl Artistic License, which again
|
||||||
does not require you release your Verilog or generated code.
|
does not require you release your Verilog or generated code.
|
||||||
@@ -2193,26 +2274,64 @@ untarred directory.
|
|||||||
In your top level C code, call Verilated::traceEverOn(true). Then create a
|
In your top level C code, call Verilated::traceEverOn(true). Then create a
|
||||||
SpTraceVcdC object, and in your main loop call "trace_object->dump(time)"
|
SpTraceVcdC object, and in your main loop call "trace_object->dump(time)"
|
||||||
every time step, and finally call "trace_object->close()". For an example,
|
every time step, and finally call "trace_object->close()". For an example,
|
||||||
see the call to SpTraceVcdC in the test_c/sim_main.cpp file of the
|
see below and the test_c/sim_main.cpp file of the distribution.
|
||||||
distribution.
|
|
||||||
|
|
||||||
You also need to compile SpTraceVcdC.cpp and add it to your link. This is
|
You also need to compile SpTraceVcdC.cpp and add it to your link. This is
|
||||||
done for you if using the Verilator --exe flag.
|
done for you if using the Verilator --exe flag.
|
||||||
|
|
||||||
|
Note you can also call ->trace on multiple Verilated objects with the same
|
||||||
|
trace file if you want all data to land in the same output file.
|
||||||
|
|
||||||
|
#include "SpTraceVcdC.cpp"
|
||||||
|
...
|
||||||
|
int main(int argc, char **argv, char **env) {
|
||||||
|
...
|
||||||
|
Verilated::traceEverOn(true);
|
||||||
|
SpTraceVcdCFile* tfp = new SpTraceVcdCFile;
|
||||||
|
topp->trace (tfp, 99);
|
||||||
|
tfp->open ("obj_dir/t_trace_ena_cc/simx.vcd");
|
||||||
|
...
|
||||||
|
while (sc_time_stamp() < sim_time && !Verilated::gotFinish()) {
|
||||||
|
main_time += #;
|
||||||
|
tfp->dump (main_time);
|
||||||
|
}
|
||||||
|
tfp->close();
|
||||||
|
}
|
||||||
|
|
||||||
=item How do I generate waveforms (traces) in SystemC/SystemPerl?
|
=item How do I generate waveforms (traces) in SystemC/SystemPerl?
|
||||||
|
|
||||||
Add the --trace switch to Verilator, and make sure the SystemPerl package
|
Add the --trace switch to Verilator, and make sure the SystemPerl package
|
||||||
is installed.
|
is installed.
|
||||||
|
|
||||||
In your top level C sc_main code, call Verilated::traceEverOn(true). Then
|
In your top level C sc_main code, include SpTraceVcd.h. Then call
|
||||||
create a SpTraceFile object as you would create a normal SystemC trace
|
Verilated::traceEverOn(true). Then create a SpTraceFile object as you
|
||||||
file. For an example, see the call to SpTraceFile in the
|
would create a normal SystemC trace file. For an example, see the call to
|
||||||
test_sp/sc_main.cpp file of the distribution.
|
SpTraceFile in the test_sp/sc_main.cpp file of the distribution, and below.
|
||||||
|
|
||||||
Alternatively you may use the C++ trace mechanism described in the previous
|
Alternatively you may use the C++ trace mechanism described in the previous
|
||||||
question, however the timescale and timeprecision will not inherited from
|
question, however the timescale and timeprecision will not inherited from
|
||||||
your SystemC settings.
|
your SystemC settings.
|
||||||
|
|
||||||
|
You'll then need to compile in Sp.cpp, which includes SpTraceVcd.cpp among
|
||||||
|
other things.
|
||||||
|
|
||||||
|
Note you can also call ->trace on multiple Verilated objects with the same
|
||||||
|
trace file if you want all data to land in the same output file.
|
||||||
|
|
||||||
|
#include "SpTraceVcd.cpp"
|
||||||
|
...
|
||||||
|
int main(int argc, char **argv, char **env) {
|
||||||
|
...
|
||||||
|
Verilated::traceEverOn(true);
|
||||||
|
SpTraceFile* tfp = new SpTraceFile;
|
||||||
|
topp->trace (tfp, 99);
|
||||||
|
tfp->open ("obj_dir/t_trace_ena_cc/simx.vcd");
|
||||||
|
...
|
||||||
|
sc_start(1);
|
||||||
|
...
|
||||||
|
tfp->close();
|
||||||
|
}
|
||||||
|
|
||||||
=item How do I view waveforms (traces)?
|
=item How do I view waveforms (traces)?
|
||||||
|
|
||||||
Verilator makes standard VCD (Value Change Dump) files. They are viewable
|
Verilator makes standard VCD (Value Change Dump) files. They are viewable
|
||||||
@@ -2513,8 +2632,9 @@ Ding Xiaoliang.
|
|||||||
The latest version is available from L<http://www.veripool.org/>.
|
The latest version is available from L<http://www.veripool.org/>.
|
||||||
|
|
||||||
Copyright 2003-2009 by Wilson Snyder. Verilator is free software; you can
|
Copyright 2003-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
redistribute it and/or modify it under the terms of either the GNU Lesser
|
redistribute it and/or modify the Verilator internals under the terms of
|
||||||
General Public License or the Perl Artistic License.
|
either the GNU Lesser General Public License Version 3 or the Perl Artistic
|
||||||
|
License Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ sub diff_file {
|
|||||||
|
|
||||||
filter ($a, $tmp_a);
|
filter ($a, $tmp_a);
|
||||||
filter ($b, $tmp_b);
|
filter ($b, $tmp_b);
|
||||||
system("diff $tmp_a $tmp_b");
|
system("diff -u $tmp_a $tmp_b");
|
||||||
unlink $tmp_a;
|
unlink $tmp_a;
|
||||||
unlink $tmp_b;
|
unlink $tmp_b;
|
||||||
}
|
}
|
||||||
@@ -174,9 +174,9 @@ Do not show differences in line numbering.
|
|||||||
|
|
||||||
The latest version is available from L<http://www.veripool.org/verilator>.
|
The latest version is available from L<http://www.veripool.org/verilator>.
|
||||||
|
|
||||||
Copyright 2005-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2005-2009 by Wilson Snyder. This package is free software; you can
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
Lesser General Public License or the Perl Artistic License.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ eval 'exec perl -wS $0 ${1+"$@"}'
|
|||||||
if 0;
|
if 0;
|
||||||
# DESCRIPTION: Print include statements for each ARGV
|
# DESCRIPTION: Print include statements for each ARGV
|
||||||
#
|
#
|
||||||
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
# Copyright 2003-2009 by Wilson Snyder. This package is free software; you can
|
||||||
# redistribute it and/or modify it under the terms of either the GNU
|
# redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
# General Public License or the Perl Artistic License.
|
# General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
require 5.005;
|
require 5.005;
|
||||||
|
|||||||
@@ -208,9 +208,9 @@ Displays this message and program version and exits.
|
|||||||
|
|
||||||
The latest version is available from L<http://www.veripool.org/>.
|
The latest version is available from L<http://www.veripool.org/>.
|
||||||
|
|
||||||
Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2007-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
Lesser General Public License or the Perl Artistic License.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -1,7 +1,8 @@
|
|||||||
dnl DESCRIPTION: Process this file with autoconf to produce a configure script.
|
dnl DESCRIPTION: Process this file with autoconf to produce a configure script.
|
||||||
dnl Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
dnl
|
||||||
dnl redistribute it and/or modify it under the terms of either the GNU
|
dnl Copyright 2003-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
dnl General Public License or the Perl Artistic License.
|
dnl redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
|
dnl General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
AC_INIT(src/Verilator.cpp)
|
AC_INIT(src/Verilator.cpp)
|
||||||
AC_CONFIG_HEADER(src/config_build.h)
|
AC_CONFIG_HEADER(src/config_build.h)
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License.
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -3,7 +3,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License.
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
######################################################################
|
######################################################################
|
||||||
# DESCRIPTION: Makefile commands for all verilated target files
|
# DESCRIPTION: Makefile commands for all verilated target files
|
||||||
#
|
#
|
||||||
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
# Copyright 2003-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
# redistribute it and/or modify it under the terms of either the GNU
|
# redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
# Lesser General Public License or the Perl Artistic License.
|
# General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
PERL = @PERL@
|
PERL = @PERL@
|
||||||
|
|||||||
+2
-1
@@ -7,7 +7,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License.
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// This is distributed in the hope that it will be useful,
|
// This is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License.
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
// -*- C++ -*-
|
||||||
|
//*************************************************************************
|
||||||
|
//
|
||||||
|
// Copyright 2009-2009 by Wilson Snyder. This program 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.
|
||||||
|
//
|
||||||
|
// Verilator 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.
|
||||||
|
//
|
||||||
|
//*************************************************************************
|
||||||
|
///
|
||||||
|
/// \file
|
||||||
|
/// \brief Verilator: Common include for all Verilated SystemC files
|
||||||
|
///
|
||||||
|
/// This file is included automatically by Verilator at the top of
|
||||||
|
/// all SystemC files it generates.
|
||||||
|
///
|
||||||
|
/// Code available from: http://www.veripool.org/verilator
|
||||||
|
///
|
||||||
|
//*************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _VERILATEDSC_H_
|
||||||
|
#define _VERILATEDSC_H_ 1 ///< Header Guard
|
||||||
|
|
||||||
|
#include "verilatedos.h"
|
||||||
|
#include "systemc.h"
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
// VL_SC_BV_DATAP
|
||||||
|
// We want to get a pointer to m_data in the sc_bv_base class,
|
||||||
|
// but it is protected. So make an exposing class, then use
|
||||||
|
// cast magic to get at it. Saves patching get_datap in SystemC.
|
||||||
|
|
||||||
|
#define VL_SC_BV_DATAP(bv) (VlScBvExposer::sp_datap(bv))
|
||||||
|
class VlScBvExposer : public sc_bv_base {
|
||||||
|
public:
|
||||||
|
static uint32_t* sp_datap(const sc_bv_base& base) {
|
||||||
|
return static_cast<const VlScBvExposer*>(&base)->sp_datatp(); }
|
||||||
|
uint32_t* sp_datatp() const { return (uint32_t*)(m_data); }
|
||||||
|
// Above reads this protected element in sc_bv_base:
|
||||||
|
// sc_digit* m_data; // data array
|
||||||
|
};
|
||||||
|
|
||||||
|
//=========================================================================
|
||||||
|
|
||||||
|
#endif // guard
|
||||||
+23
-11
@@ -1,29 +1,34 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2007-2009 by Wilson Snyder.
|
# Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
||||||
#
|
# can redistribute it and/or modify it under the terms of either the GNU
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# it under the terms of either the GNU General Public License or the
|
# Version 2.0.
|
||||||
# Perl Artistic License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the Perl Artistic License
|
|
||||||
# along with this module; see the file COPYING. If not, see
|
|
||||||
# www.cpan.org
|
|
||||||
#
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
# DESCRIPTION: Diff bison files
|
# DESCRIPTION: Diff bison files
|
||||||
|
|
||||||
|
use Getopt::Long;
|
||||||
use IO::File;
|
use IO::File;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my $Debug;
|
our $Debug;
|
||||||
|
our $Opt_Unsup;
|
||||||
|
|
||||||
|
if (! GetOptions (
|
||||||
|
#"help" => \&usage,
|
||||||
|
"debug" => sub { $Debug = 1; },
|
||||||
|
"unsup!" => \$Opt_Unsup, # Ignore unsupported
|
||||||
|
)) {
|
||||||
|
die "usage();"
|
||||||
|
}
|
||||||
|
|
||||||
diff($ARGV[0],$ARGV[1]);
|
diff($ARGV[0],$ARGV[1]);
|
||||||
|
|
||||||
@@ -58,16 +63,23 @@ sub prep {
|
|||||||
next if $line !~ /%token/;
|
next if $line !~ /%token/;
|
||||||
$skip = 2;
|
$skip = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($Opt_Unsup) {
|
||||||
|
$line =~ s!//UNSUP!|!g;
|
||||||
|
$line =~ s!(\s+)\|(\s+)!$1$2!g; # As "UNSUP" often replaces "|"
|
||||||
|
}
|
||||||
|
|
||||||
# %type<foo>
|
# %type<foo>
|
||||||
$line =~ s/^(%\S+)<(\S+)>/$1/;
|
$line =~ s/^(%\S+)<(\S+)>/$1/;
|
||||||
# rule<foo>
|
# rule<foo>
|
||||||
$line =~ s/^([a-zA-Z0-9_]+)<\S+>:/$1:/;
|
$line =~ s/^([a-zA-Z0-9_]+)<\S+>:/$1:/;
|
||||||
# Productions
|
# Productions
|
||||||
$line =~ s/[ \t]{[^}]*?}/\t{}/g;
|
$line =~ s/[ \t]{[^}]*?}/\t{}/g;
|
||||||
|
|
||||||
$fho->print($line);
|
$fho->print($line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
# compile-command: "./bisondiff $WUP/Verilog/Parser/VParseBison.y ../src/verilog.y"
|
# compile-command: "./bisondiff --unsup $WUP/Verilog/Parser/VParseBison.y ../src/verilog.y"
|
||||||
# End:
|
# End:
|
||||||
|
|||||||
+4
-9
@@ -1,21 +1,16 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2007-2009 by Wilson Snyder.
|
# Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
||||||
#
|
# can redistribute it and/or modify it under the terms of either the GNU
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# it under the terms of either the GNU General Public License or the
|
# Version 2.0.
|
||||||
# Perl Artistic License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the Perl Artistic License
|
|
||||||
# along with this module; see the file COPYING. If not, see
|
|
||||||
# www.cpan.org
|
|
||||||
#
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
# DESCRIPTION: Debugging of bison output
|
# DESCRIPTION: Debugging of bison output
|
||||||
|
|||||||
+3
-3
@@ -143,9 +143,9 @@ Displays this message and program version and exits.
|
|||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
Copyright 2005-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2005-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
Lesser General Public License or the Perl Artistic License.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -184,9 +184,9 @@ Displays this message and program version and exits.
|
|||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
Copyright 2005-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2005-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
Lesser General Public License or the Perl Artistic License.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
Executable
+61
@@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
######################################################################
|
||||||
|
#
|
||||||
|
# Copyright 2007-2009 by Wilson Snyder. This package 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.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
# DESCRIPTION: Diff flex files
|
||||||
|
|
||||||
|
use IO::File;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $Debug;
|
||||||
|
|
||||||
|
diff($ARGV[0],$ARGV[1]);
|
||||||
|
|
||||||
|
sub diff {
|
||||||
|
my $a=shift;
|
||||||
|
my $b=shift;
|
||||||
|
|
||||||
|
my $ta = "/tmp/flexdiff.$$.a";
|
||||||
|
my $tb = "/tmp/flexdiff.$$.b";
|
||||||
|
|
||||||
|
prep($a,$ta);
|
||||||
|
prep($b,$tb);
|
||||||
|
|
||||||
|
system("diff -u -w $ta $tb");
|
||||||
|
}
|
||||||
|
|
||||||
|
sub prep {
|
||||||
|
my $filename = shift;
|
||||||
|
my $wfilename = shift;
|
||||||
|
|
||||||
|
my $fh = IO::File->new("<$filename") or die "%Error: $! $filename";
|
||||||
|
my $fho = IO::File->new(">$wfilename") or die "%Error: $! writing $wfilename";
|
||||||
|
|
||||||
|
my %declared;
|
||||||
|
my %used;
|
||||||
|
my @lines;
|
||||||
|
|
||||||
|
while (defined(my $line = $fh->getline)) {
|
||||||
|
# Productions
|
||||||
|
$line =~ s/[ \t]{[^}]*?}/\t{}/g;
|
||||||
|
push @lines, $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
#@lines = sort @lines;
|
||||||
|
$fho->print(@lines);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# compile-command: "./flexdiff $WUP/Verilog/Parser/VParseLex.l ../src/verilog.l"
|
||||||
|
# End:
|
||||||
+2
-1
@@ -42,7 +42,8 @@ invoke_iccr - Invoke tool under "modules" command
|
|||||||
|
|
||||||
Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
can redistribute it and/or modify it under the terms of either the GNU
|
||||||
Lesser General Public License or the Perl Artistic License.
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
@@ -40,9 +40,10 @@ invoke_ncverilog - Invoke tool under "modules" command
|
|||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2005-2009 by Wilson Snyder. This package is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
can redistribute it and/or modify it under the terms of either the GNU
|
||||||
Lesser General Public License or the Perl Artistic License.
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
@@ -331,9 +331,9 @@ Displays this message and program version and exits.
|
|||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
Copyright 2005-2009 by Wilson Snyder. This package is free software; you
|
Copyright 2005-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
Lesser General Public License or the Perl Artistic License.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
=head1 AUTHORS
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
|||||||
+9
-6
@@ -28,11 +28,15 @@ This is the Verilator Package.
|
|||||||
|
|
||||||
This package is Copyright 2003-2009 by Wilson Snyder @email{wsnyder@@wsnyder.org}.
|
This package is Copyright 2003-2009 by Wilson Snyder @email{wsnyder@@wsnyder.org}.
|
||||||
|
|
||||||
You may distribute under the terms of either the GNU General Public License
|
Verilator is free software; you can redistribute it and/or modify it
|
||||||
or the Artistic License, as specified in the Perl README file.
|
under the terms of either the GNU General Public License Version 3 or
|
||||||
|
the Perl Artistic License Version 2.0. (See the documentation for
|
||||||
|
more details.)
|
||||||
|
|
||||||
This code is provided with no warranty of any kind, and is used entirely at
|
This program is distributed in the hope that it will be useful, but
|
||||||
your own risk.
|
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.
|
||||||
|
|
||||||
@node Description, Obtaining Distribution, Copyright, Top
|
@node Description, Obtaining Distribution, Copyright, Top
|
||||||
@section Description
|
@section Description
|
||||||
@@ -117,8 +121,7 @@ If you will be using SystemC, download and install System-Perl,
|
|||||||
@url{http://search.cpan.org/search?module=SystemC::Netlist}. Note
|
@url{http://search.cpan.org/search?module=SystemC::Netlist}. Note
|
||||||
you'll need to set a @samp{SYSTEMPERL} environment variable to point
|
you'll need to set a @samp{SYSTEMPERL} environment variable to point
|
||||||
to the downloaded kit. Optionally also set @samp{SYSTEMPERL_INCLUDE}
|
to the downloaded kit. Optionally also set @samp{SYSTEMPERL_INCLUDE}
|
||||||
to point to the installed headers. Also, make sure to do a @code{make
|
to point to the installed headers.
|
||||||
sc_patch}.
|
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@code{cd} to the Verilator directory containing this README.
|
@code{cd} to the Verilator directory containing this README.
|
||||||
|
|||||||
+3
-3
@@ -65,6 +65,6 @@ what made a <e####> line in the tree dumps):
|
|||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
Copyright 2008-2009 by Wilson Snyder. This program is free software; you
|
Copyright 2008-2009 by Wilson Snyder. Verilator is free software; you can
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||||
General Public License or the Perl Artistic License.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|||||||
+4
-4
@@ -9,7 +9,8 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
# redistribute it and/or modify it under the terms of either the GNU
|
# redistribute it and/or modify it under the terms of either the GNU
|
||||||
# General Public License or the Perl Artistic License.
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
# Version 2.0.
|
||||||
#
|
#
|
||||||
# Verilator is distributed in the hope that it will be useful,
|
# Verilator is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -46,7 +47,7 @@ export OBJCACHE_JOBS := -j $(shell objcache --jobs "$(OBJCACHE_HOSTS)")
|
|||||||
export OBJCACHE := @objcache --read --write
|
export OBJCACHE := @objcache --read --write
|
||||||
endif
|
endif
|
||||||
|
|
||||||
UNDER_GIT = $(wildcard ../.git)
|
UNDER_GIT = $(wildcard ../.git/logs/HEAD)
|
||||||
|
|
||||||
#*********************************************************************
|
#*********************************************************************
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ prefiles::
|
|||||||
ifneq ($(UNDER_GIT),) # If local git tree... Else don't burden users
|
ifneq ($(UNDER_GIT),) # If local git tree... Else don't burden users
|
||||||
prefiles:: config_rev.h
|
prefiles:: config_rev.h
|
||||||
# This output goes into srcdir, as we need to distribute it as part of the kit.
|
# This output goes into srcdir, as we need to distribute it as part of the kit.
|
||||||
config_rev.h: config_rev.pl ../.git/index
|
config_rev.h: config_rev.pl ../.git/logs/HEAD
|
||||||
$(PERL) config_rev.pl . >$@
|
$(PERL) config_rev.pl . >$@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -87,7 +88,6 @@ clean mostlyclean distclean maintainer-clean::
|
|||||||
-rm -rf obj_* *.log *.dmp *.vpd core
|
-rm -rf obj_* *.log *.dmp *.vpd core
|
||||||
-rm -f *.o *.d perlxsi.c *_gen_*
|
-rm -f *.o *.d perlxsi.c *_gen_*
|
||||||
-rm -f *__gen*
|
-rm -f *__gen*
|
||||||
-rm -f *.yy.* y.output y.tab.[cho] *_test
|
|
||||||
-rm -f .objcache*
|
-rm -f .objcache*
|
||||||
|
|
||||||
distclean maintainer-clean::
|
distclean maintainer-clean::
|
||||||
|
|||||||
+11
-11
@@ -9,7 +9,8 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
# redistribute it and/or modify it under the terms of either the GNU
|
# redistribute it and/or modify it under the terms of either the GNU
|
||||||
# General Public License or the Perl Artistic License.
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
# Version 2.0.
|
||||||
#
|
#
|
||||||
# Verilator is distributed in the hope that it will be useful,
|
# Verilator is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -117,7 +118,6 @@ make_info:
|
|||||||
clean mostlyclean distclean maintainer-clean::
|
clean mostlyclean distclean maintainer-clean::
|
||||||
-rm -f *.o *.d perlxsi.c *_gen_*
|
-rm -f *.o *.d perlxsi.c *_gen_*
|
||||||
-rm -f *__gen*
|
-rm -f *__gen*
|
||||||
-rm -f *.yy.* y.output y.tab.[cho] *_test
|
|
||||||
-rm -f obj_* .objcache*
|
-rm -f obj_* .objcache*
|
||||||
|
|
||||||
distclean maintainer-clean:: clean
|
distclean maintainer-clean:: clean
|
||||||
@@ -228,8 +228,8 @@ $(TGT): V3Ast__gen_classes.h $(OBJS)
|
|||||||
@echo " Linking $@..."
|
@echo " Linking $@..."
|
||||||
-rm -rf $@ [email protected]
|
-rm -rf $@ [email protected]
|
||||||
${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS}
|
${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS}
|
||||||
@-cp [email protected] $@
|
@-(cp [email protected] $@ || true)
|
||||||
# ok if cp failes on linux, it's there to insure make works on NT
|
# ok if cp failes on linux, it's there to insure executable works on NT
|
||||||
|
|
||||||
V3Number_test: V3Number_test.o
|
V3Number_test: V3Number_test.o
|
||||||
${LINK} ${LDFLAGS} -o $@ $^ ${LIBS}
|
${LINK} ${LDFLAGS} -o $@ $^ ${LIBS}
|
||||||
@@ -244,10 +244,10 @@ V3Number_test: V3Number_test.o
|
|||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(OBJCACHE) ${CC} ${CPPFLAGS} -c $<
|
$(OBJCACHE) ${CC} ${CPPFLAGS} -c $<
|
||||||
|
|
||||||
V3Read.o: V3Read.cpp V3Lexer.yy.cpp
|
V3Read.o: V3Read.cpp V3Lexer.yy.cpp V3ParseBison.c
|
||||||
$(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
|
$(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
|
||||||
|
|
||||||
V3Parse.o: V3Parse.cpp y.tab.c
|
V3Parse.o: V3Parse.cpp V3ParseBison.c
|
||||||
$(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
|
$(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
|
||||||
|
|
||||||
V3PreProc.o: V3PreProc.cpp V3PreLex.yy.cpp
|
V3PreProc.o: V3PreProc.cpp V3PreLex.yy.cpp
|
||||||
@@ -256,19 +256,19 @@ V3PreProc.o: V3PreProc.cpp V3PreLex.yy.cpp
|
|||||||
#### Generated files
|
#### Generated files
|
||||||
|
|
||||||
# Target rule called before parallel build to make generated files
|
# Target rule called before parallel build to make generated files
|
||||||
serial:: V3Ast__gen_classes.h y.tab.c
|
serial:: V3Ast__gen_classes.h V3ParseBison.c
|
||||||
|
|
||||||
V3Ast__gen_classes.h : $(ASTGEN) V3Ast.h V3AstNodes.h
|
V3Ast__gen_classes.h : $(ASTGEN) V3Ast.h V3AstNodes.h
|
||||||
$(PERL) $(ASTGEN) -I$(srcdir) --classes
|
$(PERL) $(ASTGEN) -I$(srcdir) --classes
|
||||||
|
|
||||||
y.tab.h: y.tab.c
|
V3ParseBison.h: V3ParseBison.c
|
||||||
|
|
||||||
# Have only one output file in this rule to prevent parallel make issues
|
# Have only one output file in this rule to prevent parallel make issues
|
||||||
y.tab.c: verilog.y $(HEADERS) bisonpre
|
V3ParseBison.c: verilog.y $(BISONPRE)
|
||||||
@echo "If you get errors from verilog.y below, try upgrading bison to version 1.875 or newer."
|
@echo "If you get errors from verilog.y below, try upgrading bison to version 1.875 or newer."
|
||||||
$(PERL) $(BISONPRE) --yacc ${YACC} -d -v -o y.tab.c $<
|
$(PERL) $(BISONPRE) --yacc ${YACC} -d -v -o V3ParseBison.c $<
|
||||||
|
|
||||||
V3Lexer_pregen.yy.cpp: verilog.l y.tab.h $(HEADERS)
|
V3Lexer_pregen.yy.cpp: verilog.l V3ParseBison.h $(HEADERS)
|
||||||
${LEX} --version
|
${LEX} --version
|
||||||
${LEX} ${LFLAGS} -o$@ $<
|
${LEX} ${LFLAGS} -o$@ $<
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+5
-2
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -64,7 +65,9 @@ private:
|
|||||||
AstNode* timesp = nodep->exprsp(); if (timesp) timesp->unlinkFrBack();
|
AstNode* timesp = nodep->exprsp(); if (timesp) timesp->unlinkFrBack();
|
||||||
timesp = timesp->addNext(new AstTime(nodep->fileline()));
|
timesp = timesp->addNext(new AstTime(nodep->fileline()));
|
||||||
nodep->exprsp(timesp);
|
nodep->exprsp(timesp);
|
||||||
if (!nodep->scopeNamep() && nodep->name().find("%m") != string::npos) {
|
if (!nodep->scopeNamep()
|
||||||
|
&& (nodep->name().find("%m") != string::npos
|
||||||
|
|| nodep->name().find("%M") != string::npos)) {
|
||||||
nodep->scopeNamep(new AstScopeName(nodep->fileline()));
|
nodep->scopeNamep(new AstScopeName(nodep->fileline()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2005-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+16
-14
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -85,9 +86,9 @@ void AstNode::init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string AstNode::encodeName(const string& namein) {
|
string AstNode::encodeName(const string& namein) {
|
||||||
string name2 = namein;
|
// Encode signal name raw from parser, then not called again on same signal
|
||||||
|
const char* start = namein.c_str();
|
||||||
string out;
|
string out;
|
||||||
const char* start = name2.c_str();
|
|
||||||
for (const char* pos = start; *pos; pos++) {
|
for (const char* pos = start; *pos; pos++) {
|
||||||
if ((pos==start) ? isalpha(pos[0]) // digits can't lead identifiers
|
if ((pos==start) ? isalpha(pos[0]) // digits can't lead identifiers
|
||||||
: isalnum(pos[0])) {
|
: isalnum(pos[0])) {
|
||||||
@@ -99,17 +100,13 @@ string AstNode::encodeName(const string& namein) {
|
|||||||
} else {
|
} else {
|
||||||
out += pos[0];
|
out += pos[0];
|
||||||
}
|
}
|
||||||
} else if (pos[0]=='.') {
|
|
||||||
out += "__DOT__";
|
|
||||||
} else if (pos[0]=='[') {
|
|
||||||
out += "__BRA__";
|
|
||||||
} else if (pos[0]==']') {
|
|
||||||
out += "__KET__";
|
|
||||||
} else {
|
} else {
|
||||||
// Need the leading 0 so this will never collide with
|
// Need the leading 0 so this will never collide with
|
||||||
// a user identifier nor a temp we create in Verilator.
|
// a user identifier nor a temp we create in Verilator.
|
||||||
char hex[10]; sprintf(hex,"%02X",pos[0]);
|
// We also do *NOT* use __DOT__ etc, as we search for those
|
||||||
out += "__0"; out += hex;
|
// in some replacements, and don't want to mangle the user's names.
|
||||||
|
char hex[10]; sprintf(hex,"__0%02X",pos[0]);
|
||||||
|
out += hex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
@@ -144,9 +141,8 @@ string AstNode::dedotName(const string& namein) {
|
|||||||
|
|
||||||
string AstNode::prettyName(const string& namein) {
|
string AstNode::prettyName(const string& namein) {
|
||||||
string pretty;
|
string pretty;
|
||||||
string name2 = namein;
|
|
||||||
pretty = "";
|
pretty = "";
|
||||||
for (const char* pos = name2.c_str(); *pos; ) {
|
for (const char* pos = namein.c_str(); *pos; ) {
|
||||||
if (0==strncmp(pos,"__BRA__",7)) {
|
if (0==strncmp(pos,"__BRA__",7)) {
|
||||||
pretty += "[";
|
pretty += "[";
|
||||||
pos += 7;
|
pos += 7;
|
||||||
@@ -176,7 +172,13 @@ string AstNode::prettyName(const string& namein) {
|
|||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AstNode::dedotName(pretty);
|
if (pretty.substr(0,4) == "TOP.") pretty.replace(0,4,"");
|
||||||
|
return pretty;
|
||||||
|
}
|
||||||
|
|
||||||
|
string AstNode::prettyTypeName() const {
|
||||||
|
if (name()=="") return typeName();
|
||||||
|
return string(typeName())+" '"+prettyName()+"'";
|
||||||
}
|
}
|
||||||
|
|
||||||
int AstNode::widthPow2() const {
|
int AstNode::widthPow2() const {
|
||||||
|
|||||||
+74
-58
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -40,10 +41,10 @@ public:
|
|||||||
// enum en {...};
|
// enum en {...};
|
||||||
// const char* ascii() const {...};
|
// const char* ascii() const {...};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstType () {};
|
inline AstType () {}
|
||||||
inline AstType (en _e) : m_e(_e) {};
|
inline AstType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstType lhs, AstType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstType lhs, AstType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstType lhs, AstType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstType lhs, AstType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -63,10 +64,10 @@ public:
|
|||||||
PUBLIC_TASK
|
PUBLIC_TASK
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstPragmaType () {};
|
inline AstPragmaType () {}
|
||||||
inline AstPragmaType (en _e) : m_e(_e) {};
|
inline AstPragmaType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstPragmaType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstPragmaType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstPragmaType lhs, AstPragmaType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstPragmaType lhs, AstPragmaType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstPragmaType lhs, AstPragmaType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstPragmaType lhs, AstPragmaType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -86,10 +87,10 @@ public:
|
|||||||
TRACE_CHANGE_SUB
|
TRACE_CHANGE_SUB
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstCFuncType () {};
|
inline AstCFuncType () {}
|
||||||
inline AstCFuncType (en _e) : m_e(_e) {};
|
inline AstCFuncType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstCFuncType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstCFuncType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
// METHODS
|
// METHODS
|
||||||
bool isTrace() const { return (m_e==TRACE_INIT || m_e==TRACE_INIT_SUB
|
bool isTrace() const { return (m_e==TRACE_INIT || m_e==TRACE_INIT_SUB
|
||||||
|| m_e==TRACE_FULL || m_e==TRACE_FULL_SUB
|
|| m_e==TRACE_FULL || m_e==TRACE_FULL_SUB
|
||||||
@@ -154,10 +155,10 @@ public:
|
|||||||
};
|
};
|
||||||
return names[m_e];
|
return names[m_e];
|
||||||
};
|
};
|
||||||
inline AstEdgeType () {};
|
inline AstEdgeType () {}
|
||||||
inline AstEdgeType (en _e) : m_e(_e) {};
|
inline AstEdgeType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstEdgeType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstEdgeType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstEdgeType lhs, AstEdgeType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstEdgeType lhs, AstEdgeType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstEdgeType lhs, AstEdgeType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstEdgeType lhs, AstEdgeType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -168,16 +169,29 @@ public:
|
|||||||
class AstAttrType {
|
class AstAttrType {
|
||||||
public:
|
public:
|
||||||
enum en {
|
enum en {
|
||||||
BITS,
|
BITS, // V3Const converts to constant
|
||||||
RANGE_LSB,
|
RANGE_LSB, // V3Const converts to constant
|
||||||
ARRAY_LSB,
|
ARRAY_LSB, // V3Const converts to constant
|
||||||
SCOPE_TEXT
|
//
|
||||||
|
VAR_CLOCK, // V3LinkParse moves to AstVar::attrScClocked
|
||||||
|
VAR_CLOCK_ENABLE, // V3LinkParse moves to AstVar::attrClockEn
|
||||||
|
VAR_PUBLIC, // V3LinkParse moves to AstVar::sigPublic
|
||||||
|
VAR_PUBLIC_FLAT, // V3LinkParse moves to AstVar::sigPublic
|
||||||
|
VAR_ISOLATE_ASSIGNMENTS // V3LinkParse moves to AstVar::attrIsolateAssign
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstAttrType () {};
|
const char* ascii() const {
|
||||||
inline AstAttrType (en _e) : m_e(_e) {};
|
static const char* names[] = {
|
||||||
explicit inline AstAttrType (int _e) : m_e(static_cast<en>(_e)) {};
|
"BITS", "RANGE_LSB", "ARRAY_LSB",
|
||||||
operator en () const { return m_e; };
|
"VAR_CLOCK", "VAR_CLOCK_ENABLE", "VAR_PUBLIC", "VAR_PUBLIC_FLAT",
|
||||||
|
"VAR_ISOLATE_ASSIGNMENTS"
|
||||||
|
};
|
||||||
|
return names[m_e];
|
||||||
|
};
|
||||||
|
inline AstAttrType () {}
|
||||||
|
inline AstAttrType (en _e) : m_e(_e) {}
|
||||||
|
explicit inline AstAttrType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
|
operator en () const { return m_e; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstAttrType lhs, AstAttrType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstAttrType lhs, AstAttrType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstAttrType lhs, AstAttrType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstAttrType lhs, AstAttrType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -202,23 +216,24 @@ public:
|
|||||||
IMPLICIT,
|
IMPLICIT,
|
||||||
REG,
|
REG,
|
||||||
TRIWIRE,
|
TRIWIRE,
|
||||||
|
PORT, // Temp type used in parser only
|
||||||
BLOCKTEMP,
|
BLOCKTEMP,
|
||||||
MODULETEMP,
|
MODULETEMP,
|
||||||
STMTTEMP,
|
STMTTEMP,
|
||||||
XTEMP
|
XTEMP
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstVarType () {};
|
inline AstVarType () {}
|
||||||
inline AstVarType (en _e) : m_e(_e) {};
|
inline AstVarType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstVarType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstVarType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
const char* ascii() const {
|
const char* ascii() const {
|
||||||
static const char* names[] = {
|
static const char* names[] = {
|
||||||
"?","GPARAM","LPARAM","GENVAR",
|
"?","GPARAM","LPARAM","GENVAR",
|
||||||
"INTEGER","INPUT","OUTPUT","INOUT",
|
"INTEGER","INPUT","OUTPUT","INOUT",
|
||||||
"SUPPLY0","SUPPLY1","WIRE","IMPLICIT","REG","TRIWIRE",
|
"SUPPLY0","SUPPLY1","WIRE","IMPLICIT","REG","TRIWIRE","PORT",
|
||||||
"BLOCKTEMP","MODULETEMP","STMTTEMP","XTEMP"};
|
"BLOCKTEMP","MODULETEMP","STMTTEMP","XTEMP"};
|
||||||
return names[m_e];};
|
return names[m_e]; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstVarType lhs, AstVarType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstVarType lhs, AstVarType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstVarType lhs, AstVarType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstVarType lhs, AstVarType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -237,10 +252,10 @@ public:
|
|||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
// CONSTRUCTOR - note defaults to *UNKNOWN*
|
// CONSTRUCTOR - note defaults to *UNKNOWN*
|
||||||
inline AstBranchPred () : m_e(UNKNOWN) {};
|
inline AstBranchPred () : m_e(UNKNOWN) {}
|
||||||
inline AstBranchPred (en _e) : m_e(_e) {};
|
inline AstBranchPred (en _e) : m_e(_e) {}
|
||||||
explicit inline AstBranchPred (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstBranchPred (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
AstBranchPred invert() const {
|
AstBranchPred invert() const {
|
||||||
if (m_e==UNLIKELY) return LIKELY;
|
if (m_e==UNLIKELY) return LIKELY;
|
||||||
else if (m_e==LIKELY) return UNLIKELY;
|
else if (m_e==LIKELY) return UNLIKELY;
|
||||||
@@ -249,7 +264,7 @@ public:
|
|||||||
const char* ascii() const {
|
const char* ascii() const {
|
||||||
static const char* names[] = {
|
static const char* names[] = {
|
||||||
"","VL_LIKELY","VL_UNLIKELY"};
|
"","VL_LIKELY","VL_UNLIKELY"};
|
||||||
return names[m_e];};
|
return names[m_e]; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstBranchPred lhs, AstBranchPred rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstBranchPred lhs, AstBranchPred rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstBranchPred lhs, AstBranchPred::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstBranchPred lhs, AstBranchPred::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -266,10 +281,10 @@ public:
|
|||||||
CASEZ
|
CASEZ
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstCaseType () {};
|
inline AstCaseType () {}
|
||||||
inline AstCaseType (en _e) : m_e(_e) {};
|
inline AstCaseType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstCaseType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstCaseType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstCaseType lhs, AstCaseType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstCaseType lhs, AstCaseType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstCaseType lhs, AstCaseType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstCaseType lhs, AstCaseType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -288,16 +303,16 @@ public:
|
|||||||
FATAL
|
FATAL
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstDisplayType () {};
|
inline AstDisplayType () {}
|
||||||
inline AstDisplayType (en _e) : m_e(_e) {};
|
inline AstDisplayType (en _e) : m_e(_e) {}
|
||||||
explicit inline AstDisplayType (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstDisplayType (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
bool addNewline() const { return m_e!=WRITE; }
|
bool addNewline() const { return m_e!=WRITE; }
|
||||||
bool needScopeTracking() const { return m_e!=DISPLAY && m_e!=WRITE; }
|
bool needScopeTracking() const { return m_e!=DISPLAY && m_e!=WRITE; }
|
||||||
const char* ascii() const {
|
const char* ascii() const {
|
||||||
static const char* names[] = {
|
static const char* names[] = {
|
||||||
"display","write","info","error","warning","fatal"};
|
"display","write","info","error","warning","fatal"};
|
||||||
return names[m_e];};
|
return names[m_e]; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstDisplayType lhs, AstDisplayType rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstDisplayType lhs, AstDisplayType rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstDisplayType lhs, AstDisplayType::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstDisplayType lhs, AstDisplayType::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -316,14 +331,14 @@ public:
|
|||||||
_ENUM_END
|
_ENUM_END
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline AstParseRefExp() : m_e(NONE) {};
|
inline AstParseRefExp() : m_e(NONE) {}
|
||||||
inline AstParseRefExp (en _e) : m_e(_e) {};
|
inline AstParseRefExp (en _e) : m_e(_e) {}
|
||||||
explicit inline AstParseRefExp (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline AstParseRefExp (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
const char* ascii() const {
|
const char* ascii() const {
|
||||||
static const char* names[] = {
|
static const char* names[] = {
|
||||||
"","VAR_MEM","VAR_ANY","TASK","FUNC"};
|
"","VAR_MEM","VAR_ANY","TASK","FUNC"};
|
||||||
return names[m_e];};
|
return names[m_e]; }
|
||||||
};
|
};
|
||||||
inline bool operator== (AstParseRefExp lhs, AstParseRefExp rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (AstParseRefExp lhs, AstParseRefExp rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (AstParseRefExp lhs, AstParseRefExp::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (AstParseRefExp lhs, AstParseRefExp::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -505,9 +520,9 @@ public:
|
|||||||
uint32_t depth() const { return (m_both >> 24) & 255; }
|
uint32_t depth() const { return (m_both >> 24) & 255; }
|
||||||
uint32_t hshval() const { return m_both & M24; }
|
uint32_t hshval() const { return m_both & M24; }
|
||||||
// OPERATORS
|
// OPERATORS
|
||||||
inline bool operator== (const V3Hash& rh) const { return m_both==rh.m_both; };
|
inline bool operator== (const V3Hash& rh) const { return m_both==rh.m_both; }
|
||||||
inline bool operator!= (const V3Hash& rh) const { return m_both!=rh.m_both; };
|
inline bool operator!= (const V3Hash& rh) const { return m_both!=rh.m_both; }
|
||||||
inline bool operator< (const V3Hash& rh) const { return m_both<rh.m_both; };
|
inline bool operator< (const V3Hash& rh) const { return m_both<rh.m_both; }
|
||||||
// CREATORS
|
// CREATORS
|
||||||
class Illegal {}; // for creator type-overload selection
|
class Illegal {}; // for creator type-overload selection
|
||||||
class FullValue {}; // for creator type-overload selection
|
class FullValue {}; // for creator type-overload selection
|
||||||
@@ -625,7 +640,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
// ACCESSORS
|
// ACCESSORS
|
||||||
virtual AstType type() const = 0;
|
virtual AstType type() const = 0;
|
||||||
const char* typeName() const { return type().ascii(); }
|
const char* typeName() const { return type().ascii(); } // See also prettyTypeName
|
||||||
AstNode* nextp() const { return m_nextp; }
|
AstNode* nextp() const { return m_nextp; }
|
||||||
AstNode* backp() const { return m_backp; }
|
AstNode* backp() const { return m_backp; }
|
||||||
AstNode* op1p() const { return m_op1p; }
|
AstNode* op1p() const { return m_op1p; }
|
||||||
@@ -654,6 +669,7 @@ public:
|
|||||||
|
|
||||||
// ACCESSORS
|
// ACCESSORS
|
||||||
virtual string name() const { return ""; }
|
virtual string name() const { return ""; }
|
||||||
|
virtual void name(const string& name) { this->v3fatalSrc("name() called on object without name() method"); }
|
||||||
virtual string verilogKwd() const { return ""; }
|
virtual string verilogKwd() const { return ""; }
|
||||||
string shortName() const; // Name with __PVT__ removed for concatenating scopes
|
string shortName() const; // Name with __PVT__ removed for concatenating scopes
|
||||||
static string dedotName(const string& namein); // Name with dots removed
|
static string dedotName(const string& namein); // Name with dots removed
|
||||||
@@ -661,6 +677,7 @@ public:
|
|||||||
static string encodeName(const string& namein); // Encode user name into internal C representation
|
static string encodeName(const string& namein); // Encode user name into internal C representation
|
||||||
static string encodeNumber(vlsint64_t numin); // Encode number into internal C representation
|
static string encodeNumber(vlsint64_t numin); // Encode number into internal C representation
|
||||||
string prettyName() const { return prettyName(name()); }
|
string prettyName() const { return prettyName(name()); }
|
||||||
|
string prettyTypeName() const; // "VARREF name" for error messages
|
||||||
FileLine* fileline() const { return m_fileline; }
|
FileLine* fileline() const { return m_fileline; }
|
||||||
int width() const { return m_width; }
|
int width() const { return m_width; }
|
||||||
bool width1() const { return width()==1; }
|
bool width1() const { return width()==1; }
|
||||||
@@ -964,7 +981,6 @@ struct AstNodeFor : public AstNodeStmt {
|
|||||||
AstNode* incsp() const { return op3p()->castNode(); } // op3= increment statements
|
AstNode* incsp() const { return op3p()->castNode(); } // op3= increment statements
|
||||||
AstNode* bodysp() const { return op4p()->castNode(); } // op4= body of loop
|
AstNode* bodysp() const { return op4p()->castNode(); } // op4= body of loop
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
|
||||||
virtual int instrCount() const { return instrCountBranch(); }
|
virtual int instrCount() const { return instrCountBranch(); }
|
||||||
virtual V3Hash sameHash() const { return V3Hash(); }
|
virtual V3Hash sameHash() const { return V3Hash(); }
|
||||||
virtual bool same(AstNode* samep) const { return true; }
|
virtual bool same(AstNode* samep) const { return true; }
|
||||||
@@ -1043,7 +1059,7 @@ public:
|
|||||||
virtual int instrCount() const { return widthInstrs(); }
|
virtual int instrCount() const { return widthInstrs(); }
|
||||||
virtual void cloneRelink();
|
virtual void cloneRelink();
|
||||||
virtual string name() const { return m_name; } // * = Var name
|
virtual string name() const { return m_name; } // * = Var name
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
bool lvalue() const { return m_lvalue; }
|
bool lvalue() const { return m_lvalue; }
|
||||||
void lvalue(bool lval) { m_lvalue=lval; } // Avoid using this; Set in constructor
|
void lvalue(bool lval) { m_lvalue=lval; } // Avoid using this; Set in constructor
|
||||||
AstVar* varp() const { return m_varp; } // [After Link] Pointer to variable
|
AstVar* varp() const { return m_varp; } // [After Link] Pointer to variable
|
||||||
@@ -1120,7 +1136,7 @@ public:
|
|||||||
virtual bool maybePointedTo() const { return true; }
|
virtual bool maybePointedTo() const { return true; }
|
||||||
// {AstFunc only} op1 = Range output variable
|
// {AstFunc only} op1 = Range output variable
|
||||||
// op3 = Statements/Ports/Vars
|
// op3 = Statements/Ports/Vars
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
AstNode* stmtsp() const { return op3p()->castNode(); } // op1 = List of statements
|
AstNode* stmtsp() const { return op3p()->castNode(); } // op1 = List of statements
|
||||||
void addStmtsp(AstNode* nodep) { addOp3p(nodep); }
|
void addStmtsp(AstNode* nodep) { addOp3p(nodep); }
|
||||||
void taskPublic(bool flag) { m_taskPublic=flag; }
|
void taskPublic(bool flag) { m_taskPublic=flag; }
|
||||||
@@ -1153,7 +1169,7 @@ public:
|
|||||||
void inlinedDots(const string& flag) { m_inlinedDots = flag; }
|
void inlinedDots(const string& flag) { m_inlinedDots = flag; }
|
||||||
AstNodeFTask* taskp() const { return m_taskp; } // [After Link] Pointer to variable
|
AstNodeFTask* taskp() const { return m_taskp; } // [After Link] Pointer to variable
|
||||||
void taskp(AstNodeFTask* taskp) { m_taskp=taskp; }
|
void taskp(AstNodeFTask* taskp) { m_taskp=taskp; }
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
void dotted(const string& name) { m_dotted = name; }
|
void dotted(const string& name) { m_dotted = name; }
|
||||||
// op1 = namep
|
// op1 = namep
|
||||||
AstNode* namep() const { return op1p(); }
|
AstNode* namep() const { return op1p(); }
|
||||||
|
|||||||
+14
-3
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -121,7 +122,13 @@ string AstVar::scType() const {
|
|||||||
} else if (widthMin() == 1) {
|
} else if (widthMin() == 1) {
|
||||||
return "bool";
|
return "bool";
|
||||||
} else if (widthMin() <= VL_WORDSIZE) {
|
} else if (widthMin() <= VL_WORDSIZE) {
|
||||||
return "uint32_t";
|
if (widthMin() <= 8 && v3Global.opt.pinsUint8()) {
|
||||||
|
return "uint8_t";
|
||||||
|
} else if (widthMin() <= 16 && v3Global.opt.pinsUint8()) {
|
||||||
|
return "uint16_t";
|
||||||
|
} else {
|
||||||
|
return "uint32_t";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return "uint64_t";
|
return "uint64_t";
|
||||||
}
|
}
|
||||||
@@ -206,6 +213,11 @@ void AstNode::dump(ostream& os) {
|
|||||||
if (!widthSized()) os<<"/"<<widthMin();
|
if (!widthSized()) os<<"/"<<widthMin();
|
||||||
if (name()!="") os<<" "<<name();
|
if (name()!="") os<<" "<<name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AstAttrOf::dump(ostream& str) {
|
||||||
|
this->AstNode::dump(str);
|
||||||
|
str<<" ["<<attrType().ascii()<<"]";
|
||||||
|
}
|
||||||
void AstCast::dump(ostream& str) {
|
void AstCast::dump(ostream& str) {
|
||||||
this->AstNode::dump(str);
|
this->AstNode::dump(str);
|
||||||
str<<" sz"<<size();
|
str<<" sz"<<size();
|
||||||
@@ -214,7 +226,6 @@ void AstCell::dump(ostream& str) {
|
|||||||
this->AstNode::dump(str);
|
this->AstNode::dump(str);
|
||||||
if (modp()) { str<<" -> "; modp()->dump(str); }
|
if (modp()) { str<<" -> "; modp()->dump(str); }
|
||||||
else { str<<" ->UNLINKED:"<<modName(); }
|
else { str<<" ->UNLINKED:"<<modName(); }
|
||||||
if (pinStar()) str<<" [.*]";
|
|
||||||
}
|
}
|
||||||
void AstCellInline::dump(ostream& str) {
|
void AstCellInline::dump(ostream& str) {
|
||||||
this->AstNode::dump(str);
|
this->AstNode::dump(str);
|
||||||
|
|||||||
+26
-33
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -250,13 +251,6 @@ private:
|
|||||||
m_trace=false;
|
m_trace=false;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name)
|
|
||||||
:AstNode(fl)
|
|
||||||
, m_name(name) {
|
|
||||||
init();
|
|
||||||
combineType(type);
|
|
||||||
width(msb()-lsb()+1,0);
|
|
||||||
}
|
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name, AstRange* rangep, AstRange* arrayp=NULL)
|
AstVar(FileLine* fl, AstVarType type, const string& name, AstRange* rangep, AstRange* arrayp=NULL)
|
||||||
:AstNode(fl)
|
:AstNode(fl)
|
||||||
, m_name(name) {
|
, m_name(name) {
|
||||||
@@ -276,7 +270,7 @@ public:
|
|||||||
if (examplep->arraysp()) {
|
if (examplep->arraysp()) {
|
||||||
setOp2p(examplep->arraysp()->cloneTree(true));
|
setOp2p(examplep->arraysp()->cloneTree(true));
|
||||||
}
|
}
|
||||||
width(msb()-lsb()+1,0);
|
width(examplep->width(), examplep->widthMin());
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(Var, VAR)
|
ASTNODE_NODE_FUNCS(Var, VAR)
|
||||||
virtual void dump(ostream& str);
|
virtual void dump(ostream& str);
|
||||||
@@ -293,6 +287,8 @@ public:
|
|||||||
AstRange* arrayp(int dim) const; // op2 = Range for specific dimension #
|
AstRange* arrayp(int dim) const; // op2 = Range for specific dimension #
|
||||||
AstNode* initp() const { return op3p()->castNode(); } // op3 = Initial value that never changes (static const)
|
AstNode* initp() const { return op3p()->castNode(); } // op3 = Initial value that never changes (static const)
|
||||||
void initp(AstNode* nodep) { setOp3p(nodep); }
|
void initp(AstNode* nodep) { setOp3p(nodep); }
|
||||||
|
void addAttrsp(AstNode* nodep) { addNOp4p(nodep); }
|
||||||
|
AstNode* attrsp() const { return op4p()->castNode(); } // op4 = Attributes during early parse
|
||||||
bool hasSimpleInit() const { return (op3p() && !op3p()->castInitArray()); }
|
bool hasSimpleInit() const { return (op3p() && !op3p()->castInitArray()); }
|
||||||
void rangep(AstRange* nodep) { setOp1p(nodep); }
|
void rangep(AstRange* nodep) { setOp1p(nodep); }
|
||||||
void attrClockEn(bool flag) { m_attrClockEn = flag; }
|
void attrClockEn(bool flag) { m_attrClockEn = flag; }
|
||||||
@@ -312,7 +308,7 @@ public:
|
|||||||
void funcReturn(bool flag) { m_funcReturn = flag; }
|
void funcReturn(bool flag) { m_funcReturn = flag; }
|
||||||
void trace(bool flag) { m_trace=flag; }
|
void trace(bool flag) { m_trace=flag; }
|
||||||
// METHODS
|
// METHODS
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
bool isInput() const { return m_input; }
|
bool isInput() const { return m_input; }
|
||||||
bool isOutput() const { return m_output; }
|
bool isOutput() const { return m_output; }
|
||||||
bool isInOnly() const { return m_input && !m_output; }
|
bool isInOnly() const { return m_input && !m_output; }
|
||||||
@@ -429,7 +425,7 @@ public:
|
|||||||
virtual bool broken() const;
|
virtual bool broken() const;
|
||||||
virtual bool maybePointedTo() const { return true; }
|
virtual bool maybePointedTo() const { return true; }
|
||||||
virtual string name() const { return m_name; } // * = Scope name
|
virtual string name() const { return m_name; } // * = Scope name
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
string nameDotless() const;
|
string nameDotless() const;
|
||||||
string nameVlSym() const { return (((string)"vlSymsp->") + nameDotless()); }
|
string nameVlSym() const { return (((string)"vlSymsp->") + nameDotless()); }
|
||||||
AstModule* modp() const { return m_modp; }
|
AstModule* modp() const { return m_modp; }
|
||||||
@@ -569,7 +565,8 @@ public:
|
|||||||
virtual void dump(ostream& str);
|
virtual void dump(ostream& str);
|
||||||
virtual bool broken() const { return (m_modVarp && !m_modVarp->brokeExists()); }
|
virtual bool broken() const { return (m_modVarp && !m_modVarp->brokeExists()); }
|
||||||
virtual string name() const { return m_name; } // * = Pin name, ""=go by number
|
virtual string name() const { return m_name; } // * = Pin name, ""=go by number
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
|
bool dotStar() const { return name() == ".*"; } // Special fake name for .* connections until linked
|
||||||
int pinNum() const { return m_pinNum; }
|
int pinNum() const { return m_pinNum; }
|
||||||
void exprp(AstNode* nodep) { addOp1p(nodep); }
|
void exprp(AstNode* nodep) { addOp1p(nodep); }
|
||||||
AstNode* exprp() const { return op1p()->castNode(); } // op1 = Expression connected to pin
|
AstNode* exprp() const { return op1p()->castNode(); } // op1 = Expression connected to pin
|
||||||
@@ -608,7 +605,7 @@ public:
|
|||||||
void addStmtp(AstNode* nodep) { addOp2p(nodep); }
|
void addStmtp(AstNode* nodep) { addOp2p(nodep); }
|
||||||
void addActivep(AstNode* nodep) { addOp3p(nodep); }
|
void addActivep(AstNode* nodep) { addOp3p(nodep); }
|
||||||
// ACCESSORS
|
// ACCESSORS
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
string origName() const { return m_origName; }
|
string origName() const { return m_origName; }
|
||||||
bool inLibrary() const { return m_inLibrary; }
|
bool inLibrary() const { return m_inLibrary; }
|
||||||
void inLibrary(bool flag) { m_inLibrary = flag; }
|
void inLibrary(bool flag) { m_inLibrary = flag; }
|
||||||
@@ -630,14 +627,13 @@ private:
|
|||||||
string m_name; // Cell name
|
string m_name; // Cell name
|
||||||
string m_origName; // Original name before dot addition
|
string m_origName; // Original name before dot addition
|
||||||
string m_modName; // Module the cell instances
|
string m_modName; // Module the cell instances
|
||||||
bool m_pinStar; // Pin list has .*
|
|
||||||
AstModule* m_modp; // [AfterLink] Pointer to module instanced
|
AstModule* m_modp; // [AfterLink] Pointer to module instanced
|
||||||
public:
|
public:
|
||||||
AstCell(FileLine* fl, const string& instName, const string& modName,
|
AstCell(FileLine* fl, const string& instName, const string& modName,
|
||||||
AstPin* pinsp, AstPin* paramsp, AstRange* rangep)
|
AstPin* pinsp, AstPin* paramsp, AstRange* rangep)
|
||||||
: AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_name(instName), m_origName(instName), m_modName(modName)
|
, m_name(instName), m_origName(instName), m_modName(modName)
|
||||||
, m_pinStar(false), m_modp(NULL) {
|
, m_modp(NULL) {
|
||||||
addNOp1p(pinsp); addNOp2p(paramsp); setNOp3p(rangep); }
|
addNOp1p(pinsp); addNOp2p(paramsp); setNOp3p(rangep); }
|
||||||
ASTNODE_NODE_FUNCS(Cell, CELL)
|
ASTNODE_NODE_FUNCS(Cell, CELL)
|
||||||
// No cloneRelink, we presume cloneee's want the same module linkages
|
// No cloneRelink, we presume cloneee's want the same module linkages
|
||||||
@@ -646,13 +642,11 @@ public:
|
|||||||
virtual bool maybePointedTo() const { return true; }
|
virtual bool maybePointedTo() const { return true; }
|
||||||
// ACCESSORS
|
// ACCESSORS
|
||||||
virtual string name() const { return m_name; } // * = Cell name
|
virtual string name() const { return m_name; } // * = Cell name
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
string origName() const { return m_origName; } // * = Original name
|
string origName() const { return m_origName; } // * = Original name
|
||||||
void origName(const string& name) { m_origName = name; }
|
void origName(const string& name) { m_origName = name; }
|
||||||
string modName() const { return m_modName; } // * = Instance name
|
string modName() const { return m_modName; } // * = Instance name
|
||||||
void modName(const string& name) { m_modName = name; }
|
void modName(const string& name) { m_modName = name; }
|
||||||
bool pinStar() const { return m_pinStar; }
|
|
||||||
void pinStar(bool flag) { m_pinStar = flag; }
|
|
||||||
AstPin* pinsp() const { return op1p()->castPin(); } // op1 = List of cell ports
|
AstPin* pinsp() const { return op1p()->castPin(); } // op1 = List of cell ports
|
||||||
AstPin* paramsp() const { return op2p()->castPin(); } // op2 = List of parameter #(##) values
|
AstPin* paramsp() const { return op2p()->castPin(); } // op2 = List of parameter #(##) values
|
||||||
AstRange* rangep() const { return op3p()->castRange(); } // op3 = Range of arrayed instants (NULL=not ranged)
|
AstRange* rangep() const { return op3p()->castRange(); } // op3 = Range of arrayed instants (NULL=not ranged)
|
||||||
@@ -678,7 +672,7 @@ public:
|
|||||||
// ACCESSORS
|
// ACCESSORS
|
||||||
virtual string name() const { return m_name; } // * = Cell name
|
virtual string name() const { return m_name; } // * = Cell name
|
||||||
string origModName() const { return m_origModName; } // * = modp()->origName() before inlining
|
string origModName() const { return m_origModName; } // * = modp()->origName() before inlining
|
||||||
void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AstPort : public AstNode {
|
struct AstPort : public AstNode {
|
||||||
@@ -713,7 +707,7 @@ public:
|
|||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(Begin, BEGIN)
|
ASTNODE_NODE_FUNCS(Begin, BEGIN)
|
||||||
virtual string name() const { return m_name; } // * = Block name
|
virtual string name() const { return m_name; } // * = Block name
|
||||||
void name(const string& flag) { m_name=flag; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
// op1 = Statements
|
// op1 = Statements
|
||||||
AstNode* stmtsp() const { return op1p()->castNode(); } // op1 = List of statements
|
AstNode* stmtsp() const { return op1p()->castNode(); } // op1 = List of statements
|
||||||
void addStmtp(AstNode* nodep) { addOp1p(nodep); }
|
void addStmtp(AstNode* nodep) { addOp1p(nodep); }
|
||||||
@@ -941,7 +935,7 @@ struct AstAssign : public AstNodeAssign {
|
|||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(Assign, ASSIGN)
|
ASTNODE_NODE_FUNCS(Assign, ASSIGN)
|
||||||
virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) { return new AstAssign(this->fileline(), lhsp, rhsp); }
|
virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) { return new AstAssign(this->fileline(), lhsp, rhsp); }
|
||||||
virtual string verilogKwd() const { return "="; };
|
virtual string verilogKwd() const { return "="; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AstAssignAlias : public AstNodeAssign {
|
struct AstAssignAlias : public AstNodeAssign {
|
||||||
@@ -960,7 +954,7 @@ struct AstAssignDly : public AstNodeAssign {
|
|||||||
ASTNODE_NODE_FUNCS(AssignDly, ASSIGNDLY)
|
ASTNODE_NODE_FUNCS(AssignDly, ASSIGNDLY)
|
||||||
virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) { return new AstAssignDly(this->fileline(), lhsp, rhsp); }
|
virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) { return new AstAssignDly(this->fileline(), lhsp, rhsp); }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual string verilogKwd() const { return "<="; };
|
virtual string verilogKwd() const { return "<="; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AstAssignW : public AstNodeAssign {
|
struct AstAssignW : public AstNodeAssign {
|
||||||
@@ -1248,7 +1242,7 @@ struct AstFClose : public AstNodeStmt {
|
|||||||
setNOp2p(filep);
|
setNOp2p(filep);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(FClose, FCLOSE)
|
ASTNODE_NODE_FUNCS(FClose, FCLOSE)
|
||||||
virtual string verilogKwd() const { return "$fclose"; };
|
virtual string verilogKwd() const { return "$fclose"; }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
virtual bool isPredictOptimizable() const { return false; }
|
||||||
virtual bool isSplittable() const { return false; }
|
virtual bool isSplittable() const { return false; }
|
||||||
@@ -1268,7 +1262,7 @@ struct AstFOpen : public AstNodeStmt {
|
|||||||
setOp3p(modep);
|
setOp3p(modep);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(FOpen, FOPEN)
|
ASTNODE_NODE_FUNCS(FOpen, FOPEN)
|
||||||
virtual string verilogKwd() const { return "$fclose"; };
|
virtual string verilogKwd() const { return "$fclose"; }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
virtual bool isPredictOptimizable() const { return false; }
|
||||||
virtual bool isSplittable() const { return false; }
|
virtual bool isSplittable() const { return false; }
|
||||||
@@ -1289,7 +1283,7 @@ struct AstFFlush : public AstNodeStmt {
|
|||||||
setNOp2p(filep);
|
setNOp2p(filep);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(FFlush, FFLUSH)
|
ASTNODE_NODE_FUNCS(FFlush, FFLUSH)
|
||||||
virtual string verilogKwd() const { return "$fflush"; };
|
virtual string verilogKwd() const { return "$fflush"; }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
virtual bool isPredictOptimizable() const { return false; }
|
||||||
virtual bool isSplittable() const { return false; }
|
virtual bool isSplittable() const { return false; }
|
||||||
@@ -1377,7 +1371,7 @@ public:
|
|||||||
setOp1p(filenamep); setOp2p(memp); setNOp3p(lsbp); setNOp4p(msbp);
|
setOp1p(filenamep); setOp2p(memp); setNOp3p(lsbp); setNOp4p(msbp);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(ReadMem, READMEM)
|
ASTNODE_NODE_FUNCS(ReadMem, READMEM)
|
||||||
virtual string verilogKwd() const { return (isHex()?"$readmemh":"$readmemb"); };
|
virtual string verilogKwd() const { return (isHex()?"$readmemh":"$readmemb"); }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
virtual bool isPredictOptimizable() const { return false; }
|
||||||
virtual bool isSplittable() const { return false; }
|
virtual bool isSplittable() const { return false; }
|
||||||
@@ -1416,8 +1410,7 @@ struct AstRepeat : public AstNodeStmt {
|
|||||||
ASTNODE_NODE_FUNCS(Repeat, REPEAT)
|
ASTNODE_NODE_FUNCS(Repeat, REPEAT)
|
||||||
AstNode* countp() const { return op2p()->castNode(); } // op2= condition to continue
|
AstNode* countp() const { return op2p()->castNode(); } // op2= condition to continue
|
||||||
AstNode* bodysp() const { return op3p()->castNode(); } // op3= body of loop
|
AstNode* bodysp() const { return op3p()->castNode(); } // op3= body of loop
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; } // Not releavant - converted to FOR
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
|
||||||
virtual int instrCount() const { return instrCountBranch(); }
|
virtual int instrCount() const { return instrCountBranch(); }
|
||||||
virtual V3Hash sameHash() const { return V3Hash(); }
|
virtual V3Hash sameHash() const { return V3Hash(); }
|
||||||
virtual bool same(AstNode* samep) const { return true; }
|
virtual bool same(AstNode* samep) const { return true; }
|
||||||
@@ -1435,7 +1428,6 @@ struct AstWhile : public AstNodeStmt {
|
|||||||
void addPrecondsp(AstNode* newp) { addOp1p(newp); }
|
void addPrecondsp(AstNode* newp) { addOp1p(newp); }
|
||||||
void addBodysp(AstNode* newp) { addOp3p(newp); }
|
void addBodysp(AstNode* newp) { addOp3p(newp); }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
|
||||||
virtual int instrCount() const { return instrCountBranch(); }
|
virtual int instrCount() const { return instrCountBranch(); }
|
||||||
virtual V3Hash sameHash() const { return V3Hash(); }
|
virtual V3Hash sameHash() const { return V3Hash(); }
|
||||||
virtual bool same(AstNode* samep) const { return true; }
|
virtual bool same(AstNode* samep) const { return true; }
|
||||||
@@ -1716,13 +1708,14 @@ private:
|
|||||||
AstAttrType m_attrType; // What sort of extraction
|
AstAttrType m_attrType; // What sort of extraction
|
||||||
int m_dimension; // Dimension number (0 is leftmost), for ARRAY_LSB extractions
|
int m_dimension; // Dimension number (0 is leftmost), for ARRAY_LSB extractions
|
||||||
public:
|
public:
|
||||||
AstAttrOf(FileLine* fl, AstAttrType attrtype, AstNode* fromp, int dimension=0)
|
AstAttrOf(FileLine* fl, AstAttrType attrtype, AstNode* fromp=NULL, int dimension=0)
|
||||||
: AstNode(fl) {
|
: AstNode(fl) {
|
||||||
setOp1p(fromp); m_attrType = attrtype; m_dimension = dimension; }
|
setNOp1p(fromp); m_attrType = attrtype; m_dimension = dimension; }
|
||||||
ASTNODE_NODE_FUNCS(AttrOf, ATTROF)
|
ASTNODE_NODE_FUNCS(AttrOf, ATTROF)
|
||||||
AstNode* fromp() const { return op1p(); }
|
AstNode* fromp() const { return op1p(); }
|
||||||
AstAttrType attrType() const { return m_attrType; }
|
AstAttrType attrType() const { return m_attrType; }
|
||||||
int dimension() const { return m_dimension; }
|
int dimension() const { return m_dimension; }
|
||||||
|
virtual void dump(ostream& str=cout);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AstScopeName : public AstNode {
|
struct AstScopeName : public AstNode {
|
||||||
@@ -2634,7 +2627,7 @@ public:
|
|||||||
virtual string name() const { return m_name; } // * = Var name
|
virtual string name() const { return m_name; } // * = Var name
|
||||||
virtual V3Hash sameHash() const { return V3Hash(name()); }
|
virtual V3Hash sameHash() const { return V3Hash(name()); }
|
||||||
virtual bool same(AstNode* samep) const { return samep->name() == name(); }
|
virtual bool same(AstNode* samep) const { return samep->name() == name(); }
|
||||||
void name(const string& flag) { m_name = flag; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
AstNode* propp() const { return op1p(); } // op1 = property
|
AstNode* propp() const { return op1p(); } // op1 = property
|
||||||
AstSenTree* sentreep() const { return op2p()->castSenTree(); } // op2 = clock domain
|
AstSenTree* sentreep() const { return op2p()->castSenTree(); } // op2 = clock domain
|
||||||
void sentreep(AstSenTree* sentreep) { addOp2p(sentreep); } // op2 = clock domain
|
void sentreep(AstSenTree* sentreep) { addOp2p(sentreep); } // op2 = clock domain
|
||||||
@@ -2816,7 +2809,7 @@ public:
|
|||||||
&& (rtnTypeVoid()==samep->castCFunc()->rtnTypeVoid())
|
&& (rtnTypeVoid()==samep->castCFunc()->rtnTypeVoid())
|
||||||
&& (argTypes()==samep->castCFunc()->argTypes())); }
|
&& (argTypes()==samep->castCFunc()->argTypes())); }
|
||||||
//
|
//
|
||||||
void name(const string& flag) { m_name = flag; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
AstScope* scopep() const { return m_scopep; }
|
AstScope* scopep() const { return m_scopep; }
|
||||||
void scopep(AstScope* nodep) { m_scopep = nodep; }
|
void scopep(AstScope* nodep) { m_scopep = nodep; }
|
||||||
string rtnTypeVoid() const { return ((m_rtnType=="") ? "void" : m_rtnType); }
|
string rtnTypeVoid() const { return ((m_rtnType=="") ? "void" : m_rtnType); }
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+5
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -218,6 +219,7 @@ private:
|
|||||||
if (msb<0) {
|
if (msb<0) {
|
||||||
// There's no space for a IF. We know upperValue is thus down to a specific
|
// There's no space for a IF. We know upperValue is thus down to a specific
|
||||||
// exact value, so just return the tree value
|
// exact value, so just return the tree value
|
||||||
|
// Note can't clone here, as we're going to check for equivelence above
|
||||||
return m_valueItem[upperValue];
|
return m_valueItem[upperValue];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -283,6 +285,8 @@ private:
|
|||||||
|
|
||||||
AstNode::user3ClearTree();
|
AstNode::user3ClearTree();
|
||||||
AstNode* ifrootp = replaceCaseFastRecurse(cexprp, m_caseWidth-1, 0UL);
|
AstNode* ifrootp = replaceCaseFastRecurse(cexprp, m_caseWidth-1, 0UL);
|
||||||
|
// Case expressions can't be linked twice, so clone them
|
||||||
|
if (ifrootp && !ifrootp->user3()) ifrootp = ifrootp->cloneTree(true);
|
||||||
|
|
||||||
if (ifrootp) nodep->replaceWith(ifrootp);
|
if (ifrootp) nodep->replaceWith(ifrootp);
|
||||||
else nodep->unlinkFrBack();
|
else nodep->unlinkFrBack();
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+3
-2
@@ -8,9 +8,10 @@
|
|||||||
//
|
//
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
//
|
//
|
||||||
// Copyright 2008-2008 by Wilson Snyder. This program is free software; you can
|
// Copyright 2008-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+3
-2
@@ -8,9 +8,10 @@
|
|||||||
//
|
//
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
//
|
//
|
||||||
// Copyright 2003-2008 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+3
-2
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -85,7 +86,7 @@ private:
|
|||||||
if (varp->width()!=1) varp->v3error("Unsupported: Clock edge on non-single bit signal: "<<varp->prettyName());
|
if (varp->width()!=1) varp->v3error("Unsupported: Clock edge on non-single bit signal: "<<varp->prettyName());
|
||||||
string newvarname = ((string)"__Vclklast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName());
|
string newvarname = ((string)"__Vclklast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName());
|
||||||
AstVar* newvarp
|
AstVar* newvarp
|
||||||
= new AstVar (vscp->fileline(), AstVarType::MODULETEMP, newvarname); // No range; 1 bit.
|
= new AstVar (vscp->fileline(), AstVarType::MODULETEMP, newvarname, NULL, NULL); // No range; 1 bit.
|
||||||
newvarp->width(1,1);
|
newvarp->width(1,1);
|
||||||
m_modp->addStmtp(newvarp);
|
m_modp->addStmtp(newvarp);
|
||||||
AstVarScope* newvscp = new AstVarScope(vscp->fileline(), m_scopep, newvarp);
|
AstVarScope* newvscp = new AstVarScope(vscp->fileline(), m_scopep, newvarp);
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+62
-19
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
#include "V3Ast.h"
|
#include "V3Ast.h"
|
||||||
#include "V3Width.h"
|
#include "V3Width.h"
|
||||||
#include "V3Signed.h"
|
#include "V3Signed.h"
|
||||||
|
#include "V3Simulate.h"
|
||||||
|
|
||||||
//######################################################################
|
//######################################################################
|
||||||
// Utilities
|
// Utilities
|
||||||
@@ -311,15 +313,24 @@ private:
|
|||||||
if (m_warn
|
if (m_warn
|
||||||
&& nodep->lsbp()->castConst()
|
&& nodep->lsbp()->castConst()
|
||||||
&& nodep->widthp()->castConst()
|
&& nodep->widthp()->castConst()
|
||||||
&& (!varp->rangep() || varp->msb()) // else it's non-resolvable parameterized
|
&& (!varp->rangep() || varp->msb())) { // else it's non-resolvable parameterized
|
||||||
&& ( ( (nodep->msbConst() > varp->msbMaxSelect())
|
if (nodep->lsbp()->castConst()->num().isFourState()
|
||||||
|| (nodep->lsbConst() > varp->msbMaxSelect())))) {
|
|| nodep->widthp()->castConst()->num().isFourState()) {
|
||||||
// See also warning in V3Width
|
nodep->v3error("Selection index is constantly unknown or tristated: "
|
||||||
nodep->v3error("Selection index out of range: "
|
"lsb="<<nodep->lsbp()->name()<<" width="<<nodep->widthp()->name());
|
||||||
<<nodep->msbConst()<<":"<<nodep->lsbConst()
|
// Replacing nodep will make a mess above, so we replace the offender
|
||||||
<<" outside "<<varp->msbMaxSelect()<<":0"
|
replaceZero(nodep->lsbp());
|
||||||
<<(varp->lsb()>=0 ? ""
|
}
|
||||||
:" (adjusted +"+cvtToStr(-varp->lsb())+" to account for negative lsb)"));
|
else if ((nodep->msbConst() > varp->msbMaxSelect())
|
||||||
|
|| (nodep->lsbConst() > varp->msbMaxSelect())) {
|
||||||
|
// See also warning in V3Width
|
||||||
|
nodep->v3error("Selection index out of range: "
|
||||||
|
<<nodep->msbConst()<<":"<<nodep->lsbConst()
|
||||||
|
<<" outside "<<varp->msbMaxSelect()<<":0"
|
||||||
|
<<(varp->lsb()>=0 ? ""
|
||||||
|
:" (adjusted +"+cvtToStr(-varp->lsb())+" to account for negative lsb)"));
|
||||||
|
// Don't replace with zero, we'll do it later
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; // Not a transform, so NOP
|
return false; // Not a transform, so NOP
|
||||||
@@ -365,7 +376,9 @@ private:
|
|||||||
void replaceNum (AstNode* oldp, const V3Number& num) {
|
void replaceNum (AstNode* oldp, const V3Number& num) {
|
||||||
// Replace oldp node with a constant set to specified value
|
// Replace oldp node with a constant set to specified value
|
||||||
UASSERT (oldp, "Null old\n");
|
UASSERT (oldp, "Null old\n");
|
||||||
if (oldp->castConst()) oldp->v3fatalSrc("Already constant??\n");
|
if (oldp->castConst() && !oldp->castConst()->num().isFourState()) {
|
||||||
|
oldp->v3fatalSrc("Already constant??\n");
|
||||||
|
}
|
||||||
AstNode* newp = new AstConst(oldp->fileline(), num);
|
AstNode* newp = new AstConst(oldp->fileline(), num);
|
||||||
newp->widthSignedFrom(oldp);
|
newp->widthSignedFrom(oldp);
|
||||||
if (debug()>5) oldp->dumpTree(cout," const_old: ");
|
if (debug()>5) oldp->dumpTree(cout," const_old: ");
|
||||||
@@ -826,6 +839,26 @@ private:
|
|||||||
if (debug()>=9) newp->dumpTree(cout," _new: ");
|
if (debug()>=9) newp->dumpTree(cout," _new: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void replaceWithSimulation(AstNode* nodep) {
|
||||||
|
SimulateVisitor simvis;
|
||||||
|
// Run it - may be unoptimizable due to large for loop, etc
|
||||||
|
simvis.mainParamEmulate(nodep);
|
||||||
|
if (!simvis.optimizable()) {
|
||||||
|
AstNode* errorp = simvis.whyNotNodep(); if (!errorp) errorp = nodep;
|
||||||
|
nodep->v3error("Expecting expression to be constant, but can't determine constant for "
|
||||||
|
<<nodep->prettyTypeName()<<endl
|
||||||
|
<<V3Error::msgPrefix()<<errorp->fileline()<<"... Location of non-constant "
|
||||||
|
<<errorp->prettyTypeName()<<": "<<simvis.whyNotMessage());
|
||||||
|
replaceZero(nodep); nodep=NULL;
|
||||||
|
} else {
|
||||||
|
// Fetch the result
|
||||||
|
V3Number* outnump = simvis.fetchNumberNull(nodep);
|
||||||
|
if (!outnump) nodep->v3fatalSrc("No number returned from simulation");
|
||||||
|
// Replace it
|
||||||
|
replaceNum(nodep,*outnump); nodep=NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
|
|
||||||
// VISITORS
|
// VISITORS
|
||||||
@@ -1041,8 +1074,7 @@ private:
|
|||||||
}
|
}
|
||||||
virtual void visit(AstAttrOf* nodep, AstNUser*) {
|
virtual void visit(AstAttrOf* nodep, AstNUser*) {
|
||||||
// Don't iterate children, don't want to loose VarRef.
|
// Don't iterate children, don't want to loose VarRef.
|
||||||
if (nodep->attrType()==AstAttrType::SCOPE_TEXT) {
|
if (nodep->attrType()==AstAttrType::BITS) {
|
||||||
} else if (nodep->attrType()==AstAttrType::BITS) {
|
|
||||||
if (!nodep->fromp() || !nodep->fromp()->widthMin()) nodep->v3fatalSrc("Unsized expression");
|
if (!nodep->fromp() || !nodep->fromp()->widthMin()) nodep->v3fatalSrc("Unsized expression");
|
||||||
V3Number num (nodep->fileline(), 32, nodep->fromp()->widthMin());
|
V3Number num (nodep->fileline(), 32, nodep->fromp()->widthMin());
|
||||||
replaceNum(nodep, num); nodep=NULL;
|
replaceNum(nodep, num); nodep=NULL;
|
||||||
@@ -1420,6 +1452,13 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void visit(AstFuncRef* nodep, AstNUser*) {
|
||||||
|
nodep->iterateChildren(*this);
|
||||||
|
if (m_params) { // Only parameters force us to do constant function call propagation
|
||||||
|
replaceWithSimulation(nodep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void visit(AstWhile* nodep, AstNUser*) {
|
virtual void visit(AstWhile* nodep, AstNUser*) {
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
if (nodep->condp()->isZero()) {
|
if (nodep->condp()->isZero()) {
|
||||||
@@ -1674,7 +1713,7 @@ private:
|
|||||||
// Default: Just iterate
|
// Default: Just iterate
|
||||||
if (m_required) {
|
if (m_required) {
|
||||||
nodep->v3error("Expecting expression to be constant, but can't convert a "
|
nodep->v3error("Expecting expression to be constant, but can't convert a "
|
||||||
<<nodep->typeName()<<" to constant.");
|
<<nodep->prettyTypeName()<<" to constant.");
|
||||||
} else {
|
} else {
|
||||||
// Calculate the width of this operation
|
// Calculate the width of this operation
|
||||||
if (m_params && !nodep->width()) {
|
if (m_params && !nodep->width()) {
|
||||||
@@ -1708,12 +1747,16 @@ public:
|
|||||||
|
|
||||||
void V3Const::constifyParam(AstNode* nodep) {
|
void V3Const::constifyParam(AstNode* nodep) {
|
||||||
//if (debug()>0) nodep->dumpTree(cout," forceConPRE : ");
|
//if (debug()>0) nodep->dumpTree(cout," forceConPRE : ");
|
||||||
if (!nodep->width()) {
|
V3Width::widthSignedIfNotAlready(nodep); // Make sure we've sized everything first
|
||||||
V3Width::widthParams(nodep);
|
|
||||||
V3Signed::signedParams(nodep);
|
|
||||||
}
|
|
||||||
ConstVisitor visitor (true,false,false,false);
|
ConstVisitor visitor (true,false,false,false);
|
||||||
visitor.main(nodep);
|
if (AstVar* varp=nodep->castVar()) {
|
||||||
|
// If a var wants to be constified, it's really a param, and
|
||||||
|
// we want the value to be constant. We aren't passed just the
|
||||||
|
// init value because we need widthing above to handle the var's type.
|
||||||
|
if (varp->initp()) visitor.main(varp->initp());
|
||||||
|
} else {
|
||||||
|
visitor.main(nodep);
|
||||||
|
}
|
||||||
// Because we do edits, nodep links may get trashed and core dump this.
|
// Because we do edits, nodep links may get trashed and core dump this.
|
||||||
//if (debug()>0) nodep->dumpTree(cout," forceConDONE: ");
|
//if (debug()>0) nodep->dumpTree(cout," forceConDONE: ");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+3
-2
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -334,7 +335,7 @@ private:
|
|||||||
&& nodep->lhsp()->castSel()->fromp()->castArraySel())) {
|
&& nodep->lhsp()->castSel()->fromp()->castArraySel())) {
|
||||||
AstNode* lhsp = nodep->lhsp()->unlinkFrBack();
|
AstNode* lhsp = nodep->lhsp()->unlinkFrBack();
|
||||||
AstNode* newlhsp = createDlyArray(nodep, lhsp);
|
AstNode* newlhsp = createDlyArray(nodep, lhsp);
|
||||||
if (m_inLoop) nodep->v3error("Unsupported: Delayed assignment to array inside for loops (non-delayed is ok - see docs)");
|
if (m_inLoop) nodep->v3warn(BLKLOOPINIT,"Unsupported: Delayed assignment to array inside for loops (non-delayed is ok - see docs)");
|
||||||
if (newlhsp) {
|
if (newlhsp) {
|
||||||
nodep->lhsp(newlhsp);
|
nodep->lhsp(newlhsp);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+33
-21
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -206,12 +207,12 @@ public:
|
|||||||
// hiearchies itself, and if SystemPerl also did it, you'd end up
|
// hiearchies itself, and if SystemPerl also did it, you'd end up
|
||||||
// with (number-of-instant) times too many counts in this bin.
|
// with (number-of-instant) times too many counts in this bin.
|
||||||
puts(", first"); // Enable, passed from __Vconfigure parameter
|
puts(", first"); // Enable, passed from __Vconfigure parameter
|
||||||
puts(", \""); puts(nodep->fileline()->filename()); puts("\"");
|
puts(", "); putsQuoted(nodep->fileline()->filename());
|
||||||
puts(", "); puts(cvtToStr(nodep->fileline()->lineno()));
|
puts(", "); puts(cvtToStr(nodep->fileline()->lineno()));
|
||||||
puts(", "); puts(cvtToStr(nodep->column()));
|
puts(", "); puts(cvtToStr(nodep->column()));
|
||||||
puts(", \""); puts((nodep->hier()!=""?".":"")+nodep->hier()); puts("\"");
|
puts(", "); putsQuoted((nodep->hier()!=""?".":"")+nodep->hier());
|
||||||
puts(", \""); puts(nodep->page()); puts("\"");
|
puts(", "); putsQuoted(nodep->page());
|
||||||
puts(", \""); puts(nodep->comment()); puts("\"");
|
puts(", "); putsQuoted(nodep->comment());
|
||||||
puts(");\n");
|
puts(");\n");
|
||||||
}
|
}
|
||||||
virtual void visit(AstCoverInc* nodep, AstNUser*) {
|
virtual void visit(AstCoverInc* nodep, AstNUser*) {
|
||||||
@@ -338,16 +339,16 @@ public:
|
|||||||
puts("}\n");
|
puts("}\n");
|
||||||
}
|
}
|
||||||
virtual void visit(AstStop* nodep, AstNUser*) {
|
virtual void visit(AstStop* nodep, AstNUser*) {
|
||||||
puts("vl_stop(\"");
|
puts("vl_stop(");
|
||||||
puts(nodep->fileline()->filename());
|
putsQuoted(nodep->fileline()->filename());
|
||||||
puts("\",");
|
puts(",");
|
||||||
puts(cvtToStr(nodep->fileline()->lineno()));
|
puts(cvtToStr(nodep->fileline()->lineno()));
|
||||||
puts(",\"\");\n");
|
puts(",\"\");\n");
|
||||||
}
|
}
|
||||||
virtual void visit(AstFinish* nodep, AstNUser*) {
|
virtual void visit(AstFinish* nodep, AstNUser*) {
|
||||||
puts("vl_finish(\"");
|
puts("vl_finish(");
|
||||||
puts(nodep->fileline()->filename());
|
putsQuoted(nodep->fileline()->filename());
|
||||||
puts("\",");
|
puts(",");
|
||||||
puts(cvtToStr(nodep->fileline()->lineno()));
|
puts(cvtToStr(nodep->fileline()->lineno()));
|
||||||
puts(",\"\");\n");
|
puts(",\"\");\n");
|
||||||
}
|
}
|
||||||
@@ -527,9 +528,9 @@ public:
|
|||||||
virtual void visit(AstTraceInc*, AstNUser*) {} // Handled outside the Visit class
|
virtual void visit(AstTraceInc*, AstNUser*) {} // Handled outside the Visit class
|
||||||
// Default
|
// Default
|
||||||
virtual void visit(AstNode* nodep, AstNUser*) {
|
virtual void visit(AstNode* nodep, AstNUser*) {
|
||||||
puts((string)"\n???? // "+nodep->typeName()+"\n");
|
puts((string)"\n???? // "+nodep->prettyTypeName()+"\n");
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
nodep->v3fatalSrc("Unknown node type reached emitter: "<<nodep->typeName());
|
nodep->v3fatalSrc("Unknown node type reached emitter: "<<nodep->prettyTypeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -829,8 +830,8 @@ void EmitCStmts::emitVarCtors() {
|
|||||||
}
|
}
|
||||||
else puts(", ");
|
else puts(", ");
|
||||||
if (ofp()->exceededWidth()) puts("\n ");
|
if (ofp()->exceededWidth()) puts("\n ");
|
||||||
puts((*it)->name()); puts("(\"");
|
puts((*it)->name());
|
||||||
puts((*it)->name()); puts("\")");
|
puts("("); putsQuoted((*it)->name()); puts(")");
|
||||||
}
|
}
|
||||||
if (!first) puts ("\n#endif\n");
|
if (!first) puts ("\n#endif\n");
|
||||||
ofp()->indentDec();
|
ofp()->indentDec();
|
||||||
@@ -994,7 +995,7 @@ void EmitCStmts::displayEmit(AstNode* nodep, bool isScan) {
|
|||||||
nodep->v3fatalSrc("Unknown displayEmit node type");
|
nodep->v3fatalSrc("Unknown displayEmit node type");
|
||||||
}
|
}
|
||||||
puts("\"");
|
puts("\"");
|
||||||
ofp()->putsNoTracking(emitDispState.m_format);
|
ofp()->putsNoTracking(emitDispState.m_format); // Not putsQuoted - already contains \s
|
||||||
puts("\"");
|
puts("\"");
|
||||||
// Arguments
|
// Arguments
|
||||||
for (unsigned i=0; i < emitDispState.m_argsp.size(); i++) {
|
for (unsigned i=0; i < emitDispState.m_argsp.size(); i++) {
|
||||||
@@ -1298,7 +1299,9 @@ void EmitCImp::emitTextSection(AstType type) {
|
|||||||
puts("\n//*** Below code from `systemc in Verilog file\n");
|
puts("\n//*** Below code from `systemc in Verilog file\n");
|
||||||
}
|
}
|
||||||
ofp()->putsNoTracking("//#line "+cvtToStr(nodep->fileline()->lineno())
|
ofp()->putsNoTracking("//#line "+cvtToStr(nodep->fileline()->lineno())
|
||||||
+" \""+nodep->fileline()->filename()+"\"\n");
|
+" ");
|
||||||
|
ofp()->putsQuoted(nodep->fileline()->filename());
|
||||||
|
ofp()->putsNoTracking("\n");
|
||||||
last_line = nodep->fileline()->lineno();
|
last_line = nodep->fileline()->lineno();
|
||||||
}
|
}
|
||||||
ofp()->putsNoTracking(textp->text());
|
ofp()->putsNoTracking(textp->text());
|
||||||
@@ -1407,7 +1410,7 @@ void EmitCStmts::emitVarList(AstNode* firstp, EisWhich which, const string& pref
|
|||||||
case EVL_ALL: doit = true; break;
|
case EVL_ALL: doit = true; break;
|
||||||
case EVL_IO: doit = varp->isIO(); break;
|
case EVL_IO: doit = varp->isIO(); break;
|
||||||
case EVL_SIG: doit = (varp->isSignal() && !varp->isIO()); break;
|
case EVL_SIG: doit = (varp->isSignal() && !varp->isIO()); break;
|
||||||
case EVL_TEMP: doit = varp->isTemp(); break;
|
case EVL_TEMP: doit = (varp->isTemp() && !varp->isIO()); break;
|
||||||
default: v3fatalSrc("Bad Case");
|
default: v3fatalSrc("Bad Case");
|
||||||
}
|
}
|
||||||
if (varp->isStatic() ? !isstatic : isstatic) doit=false;
|
if (varp->isStatic() ? !isstatic : isstatic) doit=false;
|
||||||
@@ -1791,7 +1794,15 @@ class EmitCTrace : EmitCStmts {
|
|||||||
puts(topClassName()+"* t=("+topClassName()+"*)userthis;\n");
|
puts(topClassName()+"* t=("+topClassName()+"*)userthis;\n");
|
||||||
puts(EmitCBaseVisitor::symClassVar()+" = t->__VlSymsp; // Setup global symbol table\n");
|
puts(EmitCBaseVisitor::symClassVar()+" = t->__VlSymsp; // Setup global symbol table\n");
|
||||||
puts("if (!Verilated::calcUnusedSigs()) vl_fatal(__FILE__,__LINE__,__FILE__,\"Turning on wave traces requires Verilated::traceEverOn(true) call before time 0.\");\n");
|
puts("if (!Verilated::calcUnusedSigs()) vl_fatal(__FILE__,__LINE__,__FILE__,\"Turning on wave traces requires Verilated::traceEverOn(true) call before time 0.\");\n");
|
||||||
|
|
||||||
|
//Future; need to wait to estabilish backwards compatibility
|
||||||
|
puts("#if defined(SPTRACEVCDC_VERSION) && SPTRACEVCDC_VERSION >= 1330\n");
|
||||||
|
puts("vcdp->scopeEscape(' ');\n");
|
||||||
puts("t->traceInitThis (vlSymsp, vcdp, code);\n");
|
puts("t->traceInitThis (vlSymsp, vcdp, code);\n");
|
||||||
|
puts("vcdp->scopeEscape('.');\n"); // Restore so SystemPerl traced files won't break
|
||||||
|
puts("#else\n");
|
||||||
|
puts("t->traceInitThis (vlSymsp, vcdp, code);\n");
|
||||||
|
puts("#endif\n");
|
||||||
puts("}\n");
|
puts("}\n");
|
||||||
|
|
||||||
puts("void "+topClassName()+"::traceFull(SpTraceVcd* vcdp, void* userthis, uint32_t code) {\n");
|
puts("void "+topClassName()+"::traceFull(SpTraceVcd* vcdp, void* userthis, uint32_t code) {\n");
|
||||||
@@ -1837,7 +1848,8 @@ class EmitCTrace : EmitCStmts {
|
|||||||
}
|
}
|
||||||
puts("(c+"+cvtToStr(nodep->code()));
|
puts("(c+"+cvtToStr(nodep->code()));
|
||||||
if (nodep->arrayWidth()) puts("+i*"+cvtToStr(nodep->widthWords()));
|
if (nodep->arrayWidth()) puts("+i*"+cvtToStr(nodep->widthWords()));
|
||||||
puts(",\""+nodep->showname()+"\"");
|
puts(",");
|
||||||
|
putsQuoted(nodep->showname());
|
||||||
if (nodep->arrayWidth()) {
|
if (nodep->arrayWidth()) {
|
||||||
puts(",(i+"+cvtToStr(nodep->arrayLsb())+")");
|
puts(",(i+"+cvtToStr(nodep->arrayLsb())+")");
|
||||||
} else {
|
} else {
|
||||||
@@ -1876,8 +1888,8 @@ class EmitCTrace : EmitCStmts {
|
|||||||
if (nodep->valuep()->castVarRef()) {
|
if (nodep->valuep()->castVarRef()) {
|
||||||
AstVarRef* varrefp = nodep->valuep()->castVarRef();
|
AstVarRef* varrefp = nodep->valuep()->castVarRef();
|
||||||
AstVar* varp = varrefp->varp();
|
AstVar* varp = varrefp->varp();
|
||||||
if (emitTraceIsScBv(nodep)) puts("(uint32_t*)");
|
|
||||||
puts("(");
|
puts("(");
|
||||||
|
if (emitTraceIsScBv(nodep)) puts("VL_SC_BV_DATAP(");
|
||||||
varrefp->iterate(*this); // Put var name out
|
varrefp->iterate(*this); // Put var name out
|
||||||
if (varp->arraysp()) {
|
if (varp->arraysp()) {
|
||||||
if (arrayindex==-2) puts("[i]");
|
if (arrayindex==-2) puts("[i]");
|
||||||
@@ -1885,7 +1897,7 @@ class EmitCTrace : EmitCStmts {
|
|||||||
else puts("["+cvtToStr(arrayindex)+"]");
|
else puts("["+cvtToStr(arrayindex)+"]");
|
||||||
}
|
}
|
||||||
if (varp->isSc()) puts(".read()");
|
if (varp->isSc()) puts(".read()");
|
||||||
if (emitTraceIsScBv(nodep)) puts(".get_datap()");
|
if (emitTraceIsScBv(nodep)) puts(")");
|
||||||
puts(")");
|
puts(")");
|
||||||
} else {
|
} else {
|
||||||
puts("(");
|
puts("(");
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+17
-9
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -42,7 +43,7 @@ public:
|
|||||||
V3OutCFile(const string& filename) : V3OutFile(filename) {
|
V3OutCFile(const string& filename) : V3OutFile(filename) {
|
||||||
resetPrivate();
|
resetPrivate();
|
||||||
}
|
}
|
||||||
virtual ~V3OutCFile() {};
|
virtual ~V3OutCFile() {}
|
||||||
virtual void putsCellDecl(const string& classname, const string& cellname) {
|
virtual void putsCellDecl(const string& classname, const string& cellname) {
|
||||||
this->printf("%-19s\t%s;\n",
|
this->printf("%-19s\t%s;\n",
|
||||||
(classname + "*").c_str(),cellname.c_str());
|
(classname + "*").c_str(),cellname.c_str());
|
||||||
@@ -65,30 +66,36 @@ public:
|
|||||||
class V3OutScFile : public V3OutCFile {
|
class V3OutScFile : public V3OutCFile {
|
||||||
public:
|
public:
|
||||||
V3OutScFile(const string& filename) : V3OutCFile(filename) {}
|
V3OutScFile(const string& filename) : V3OutCFile(filename) {}
|
||||||
virtual ~V3OutScFile() {};
|
virtual ~V3OutScFile() {}
|
||||||
virtual void putsHeader() { puts("// Verilated -*- SystemC -*-\n"); }
|
virtual void putsHeader() { puts("// Verilated -*- SystemC -*-\n"); }
|
||||||
virtual void putsIntTopInclude() { puts("#include \"systemc.h\"\n"); }
|
virtual void putsIntTopInclude() {
|
||||||
|
puts("#include \"systemc.h\"\n");
|
||||||
|
puts("#include \"verilatedsc.h\"\n");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class V3OutSpFile : public V3OutCFile {
|
class V3OutSpFile : public V3OutCFile {
|
||||||
public:
|
public:
|
||||||
V3OutSpFile(const string& filename) : V3OutCFile(filename) {}
|
V3OutSpFile(const string& filename) : V3OutCFile(filename) {}
|
||||||
virtual ~V3OutSpFile() {};
|
virtual ~V3OutSpFile() {}
|
||||||
virtual void putsHeader() { puts("// Verilated -*- SystemC -*-\n"); }
|
virtual void putsHeader() { puts("// Verilated -*- SystemC -*-\n"); }
|
||||||
virtual void putsIntTopInclude() { puts("#include \"systemperl.h\"\n"); }
|
virtual void putsIntTopInclude() {
|
||||||
|
puts("#include \"systemperl.h\"\n");
|
||||||
|
puts("#include \"verilatedsc.h\"\n");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class V3OutVFile : public V3OutFile {
|
class V3OutVFile : public V3OutFile {
|
||||||
public:
|
public:
|
||||||
V3OutVFile(const string& filename) : V3OutFile(filename) {}
|
V3OutVFile(const string& filename) : V3OutFile(filename) {}
|
||||||
virtual ~V3OutVFile() {};
|
virtual ~V3OutVFile() {}
|
||||||
virtual void putsHeader() { puts("// Verilated -*- Verilog -*-\n"); }
|
virtual void putsHeader() { puts("// Verilated -*- Verilog -*-\n"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class V3OutMkFile : public V3OutFile {
|
class V3OutMkFile : public V3OutFile {
|
||||||
public:
|
public:
|
||||||
V3OutMkFile(const string& filename) : V3OutFile(filename) {}
|
V3OutMkFile(const string& filename) : V3OutFile(filename) {}
|
||||||
virtual ~V3OutMkFile() {};
|
virtual ~V3OutMkFile() {}
|
||||||
virtual void putsHeader() { puts("# Verilated -*- Makefile -*-\n"); }
|
virtual void putsHeader() { puts("# Verilated -*- Makefile -*-\n"); }
|
||||||
// No automatic indentation yet.
|
// No automatic indentation yet.
|
||||||
void puts(const char* strg) { putsNoTracking(strg); }
|
void puts(const char* strg) { putsNoTracking(strg); }
|
||||||
@@ -103,9 +110,10 @@ public:
|
|||||||
// STATE
|
// STATE
|
||||||
V3OutCFile* m_ofp;
|
V3OutCFile* m_ofp;
|
||||||
// METHODS
|
// METHODS
|
||||||
V3OutCFile* ofp() const { return m_ofp; };
|
V3OutCFile* ofp() const { return m_ofp; }
|
||||||
void puts(const string& str) { ofp()->puts(str); }
|
void puts(const string& str) { ofp()->puts(str); }
|
||||||
void putbs(const string& str) { ofp()->putbs(str); }
|
void putbs(const string& str) { ofp()->putbs(str); }
|
||||||
|
void putsQuoted(const string& str) { ofp()->putsQuoted(str); }
|
||||||
bool optSystemC() { return v3Global.opt.systemC(); }
|
bool optSystemC() { return v3Global.opt.systemC(); }
|
||||||
bool optSystemPerl() { return v3Global.opt.systemPerl(); }
|
bool optSystemPerl() { return v3Global.opt.systemPerl(); }
|
||||||
static string symClassName() { return v3Global.opt.prefix()+"__Syms"; }
|
static string symClassName() { return v3Global.opt.prefix()+"__Syms"; }
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+8
-5
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -64,7 +65,9 @@ class EmitCSyms : EmitCBaseVisitor {
|
|||||||
if (nodep->name() != "") {
|
if (nodep->name() != "") {
|
||||||
string rsvd = m_words.isKeyword(nodep->name());
|
string rsvd = m_words.isKeyword(nodep->name());
|
||||||
if (rsvd != "") {
|
if (rsvd != "") {
|
||||||
nodep->v3error("Unsupported: "+rsvd+": "<<nodep->name());
|
// Generally V3Name should find all of these and throw SYMRSVDWORD.
|
||||||
|
// We'll still check here because the compiler errors resulting if we miss this warning are SO nasty
|
||||||
|
nodep->v3error("Symbol matching "+rsvd+" reserved word reached emitter, should have hit SYMRSVDWORD: '"<<nodep->name()<<"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,9 +211,9 @@ void EmitCSyms::emitImp() {
|
|||||||
if (modp->isTop()) {
|
if (modp->isTop()) {
|
||||||
} else {
|
} else {
|
||||||
ofp()->printf("\t%c %-30s ", comma, scopep->nameDotless().c_str());
|
ofp()->printf("\t%c %-30s ", comma, scopep->nameDotless().c_str());
|
||||||
puts("(Verilated::catName(topp->name(),\"");
|
puts("(Verilated::catName(topp->name(),");
|
||||||
puts("."+scopep->prettyName());
|
putsQuoted("."+scopep->prettyName());
|
||||||
puts("\"))\n");
|
puts("))\n");
|
||||||
comma=',';
|
comma=',';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+6
-5
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -176,7 +177,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||||||
putbs(" (");
|
putbs(" (");
|
||||||
if (filep) { filep->iterateAndNext(*this); putbs(","); }
|
if (filep) { filep->iterateAndNext(*this); putbs(","); }
|
||||||
puts("\"");
|
puts("\"");
|
||||||
putsNoTracking(text);
|
putsNoTracking(text); // Not putsQuoted, as display text contains \ already
|
||||||
puts("\"");
|
puts("\"");
|
||||||
for (AstNode* expp=exprsp; expp; expp = expp->nextp()) {
|
for (AstNode* expp=exprsp; expp; expp = expp->nextp()) {
|
||||||
puts(",");
|
puts(",");
|
||||||
@@ -441,9 +442,9 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||||||
virtual void visit(AstCell*, AstNUser*) {} // Handled outside the Visit class
|
virtual void visit(AstCell*, AstNUser*) {} // Handled outside the Visit class
|
||||||
// Default
|
// Default
|
||||||
virtual void visit(AstNode* nodep, AstNUser*) {
|
virtual void visit(AstNode* nodep, AstNUser*) {
|
||||||
puts((string)"\n???? // "+nodep->typeName()+"\n");
|
puts((string)"\n???? // "+nodep->prettyTypeName()+"\n");
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
nodep->v3fatalSrc("Unknown node type reached emitter: "<<nodep->typeName());
|
nodep->v3fatalSrc("Unknown node type reached emitter: "<<nodep->prettyTypeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -460,7 +461,7 @@ class EmitVFileVisitor : public EmitVBaseVisitor {
|
|||||||
// MEMBERS
|
// MEMBERS
|
||||||
V3OutFile* m_ofp;
|
V3OutFile* m_ofp;
|
||||||
// METHODS
|
// METHODS
|
||||||
V3OutFile* ofp() const { return m_ofp; };
|
V3OutFile* ofp() const { return m_ofp; }
|
||||||
void puts(const string& str) { ofp()->puts(str); }
|
void puts(const string& str) { ofp()->puts(str); }
|
||||||
void putbs(const string& str) { ofp()->putbs(str); }
|
void putbs(const string& str) { ofp()->putbs(str); }
|
||||||
void putsNoTracking(const string& str) { ofp()->putsNoTracking(str); }
|
void putsNoTracking(const string& str) { ofp()->putsNoTracking(str); }
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+22
-3
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -37,6 +38,7 @@ FileLine FileLine::s_defaultFileLine = FileLine(EmptySecret());
|
|||||||
int V3Error::s_errCount = 0;
|
int V3Error::s_errCount = 0;
|
||||||
int V3Error::s_warnCount = 0;
|
int V3Error::s_warnCount = 0;
|
||||||
int V3Error::s_debugDefault = 0;
|
int V3Error::s_debugDefault = 0;
|
||||||
|
int V3Error::s_tellManual = 0;
|
||||||
ostringstream V3Error::s_errorStr; // Error string being formed
|
ostringstream V3Error::s_errorStr; // Error string being formed
|
||||||
V3ErrorCode V3Error::s_errorCode = V3ErrorCode::FATAL;
|
V3ErrorCode V3Error::s_errorCode = V3ErrorCode::FATAL;
|
||||||
bool V3Error::s_describedEachWarn[V3ErrorCode::MAX];
|
bool V3Error::s_describedEachWarn[V3ErrorCode::MAX];
|
||||||
@@ -44,7 +46,7 @@ bool V3Error::s_describedWarnings = false;
|
|||||||
bool V3Error::s_pretendError[V3ErrorCode::MAX];
|
bool V3Error::s_pretendError[V3ErrorCode::MAX];
|
||||||
|
|
||||||
struct v3errorIniter {
|
struct v3errorIniter {
|
||||||
v3errorIniter() { V3Error::init(); };
|
v3errorIniter() { V3Error::init(); }
|
||||||
};
|
};
|
||||||
v3errorIniter v3errorInit;
|
v3errorIniter v3errorInit;
|
||||||
|
|
||||||
@@ -284,6 +286,7 @@ bool V3Error::isError(V3ErrorCode code) {
|
|||||||
if (code==V3ErrorCode::SUPPRESS) return false;
|
if (code==V3ErrorCode::SUPPRESS) return false;
|
||||||
else if (code==V3ErrorCode::INFO) return false;
|
else if (code==V3ErrorCode::INFO) return false;
|
||||||
else if (code==V3ErrorCode::FATAL) return true;
|
else if (code==V3ErrorCode::FATAL) return true;
|
||||||
|
else if (code==V3ErrorCode::FATALSRC) return true;
|
||||||
else if (code==V3ErrorCode::ERROR) return true;
|
else if (code==V3ErrorCode::ERROR) return true;
|
||||||
else if (code<V3ErrorCode::FIRST_WARN
|
else if (code<V3ErrorCode::FIRST_WARN
|
||||||
|| s_pretendError[code]) return true;
|
|| s_pretendError[code]) return true;
|
||||||
@@ -294,6 +297,7 @@ string V3Error::msgPrefix(V3ErrorCode code) {
|
|||||||
if (code==V3ErrorCode::SUPPRESS) return "-arning-suppressed: ";
|
if (code==V3ErrorCode::SUPPRESS) return "-arning-suppressed: ";
|
||||||
else if (code==V3ErrorCode::INFO) return "-Info: ";
|
else if (code==V3ErrorCode::INFO) return "-Info: ";
|
||||||
else if (code==V3ErrorCode::FATAL) return "%Error: ";
|
else if (code==V3ErrorCode::FATAL) return "%Error: ";
|
||||||
|
else if (code==V3ErrorCode::FATALSRC) return "%Error: Internal Error: ";
|
||||||
else if (code==V3ErrorCode::ERROR) return "%Error: ";
|
else if (code==V3ErrorCode::ERROR) return "%Error: ";
|
||||||
else if (isError(code)) return "%Error-"+(string)code.ascii()+": ";
|
else if (isError(code)) return "%Error-"+(string)code.ascii()+": ";
|
||||||
else return "%Warning-"+(string)code.ascii()+": ";
|
else return "%Warning-"+(string)code.ascii()+": ";
|
||||||
@@ -351,12 +355,27 @@ void V3Error::v3errorEnd (ostringstream& sstr) {
|
|||||||
cerr<<msgPrefix()<<"else you may end up with different sim results."<<endl;
|
cerr<<msgPrefix()<<"else you may end up with different sim results."<<endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If first warning is not the user's fault (internal/unsupported) then give the website
|
||||||
|
// Not later warnings, as a internal may be caused by an earlier problem
|
||||||
|
if (s_tellManual == 0) {
|
||||||
|
if (s_errorCode.mentionManual()
|
||||||
|
|| sstr.str().find("Unsupported") != string::npos) {
|
||||||
|
s_tellManual = 1;
|
||||||
|
} else {
|
||||||
|
s_tellManual = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isError(s_errorCode)) incErrors();
|
if (isError(s_errorCode)) incErrors();
|
||||||
else incWarnings();
|
else incWarnings();
|
||||||
if (s_errorCode==V3ErrorCode::FATAL) {
|
if (s_errorCode==V3ErrorCode::FATAL
|
||||||
|
|| s_errorCode==V3ErrorCode::FATALSRC) {
|
||||||
static bool inFatal = false;
|
static bool inFatal = false;
|
||||||
if (!inFatal) {
|
if (!inFatal) {
|
||||||
inFatal = true;
|
inFatal = true;
|
||||||
|
if (s_tellManual==1) {
|
||||||
|
cerr<<msgPrefix()<<"See the manual and http://www.veripool.org/verilator for more assistance."<<endl;
|
||||||
|
s_tellManual = 2;
|
||||||
|
}
|
||||||
#ifndef _V3ERROR_NO_GLOBAL_
|
#ifndef _V3ERROR_NO_GLOBAL_
|
||||||
if (debug()) {
|
if (debug()) {
|
||||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree",99));
|
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree",99));
|
||||||
|
|||||||
+25
-17
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -38,6 +39,7 @@ public:
|
|||||||
SUPPRESS, // Warning suppressed by user
|
SUPPRESS, // Warning suppressed by user
|
||||||
INFO, // General information out
|
INFO, // General information out
|
||||||
FATAL, // Kill the program
|
FATAL, // Kill the program
|
||||||
|
FATALSRC, // Kill the program, for internal source errors
|
||||||
ERROR, // General error out, can't suppress
|
ERROR, // General error out, can't suppress
|
||||||
// Boolean information we track per-line, but aren't errors
|
// Boolean information we track per-line, but aren't errors
|
||||||
I_COVERAGE, // Coverage is on/off from /*verilator coverage_on/off*/
|
I_COVERAGE, // Coverage is on/off from /*verilator coverage_on/off*/
|
||||||
@@ -45,6 +47,7 @@ public:
|
|||||||
// Error codes:
|
// Error codes:
|
||||||
MULTITOP, // Error: Multiple top level modules
|
MULTITOP, // Error: Multiple top level modules
|
||||||
TASKNSVAR, // Error: Task I/O not simple
|
TASKNSVAR, // Error: Task I/O not simple
|
||||||
|
BLKLOOPINIT, // Error: Delayed assignment to array inside for loops
|
||||||
// Warning codes:
|
// Warning codes:
|
||||||
FIRST_WARN, // Just a code so the program knows where to start warnings
|
FIRST_WARN, // Just a code so the program knows where to start warnings
|
||||||
//
|
//
|
||||||
@@ -56,6 +59,7 @@ public:
|
|||||||
CMPCONST, // Comparison is constant due to limited range
|
CMPCONST, // Comparison is constant due to limited range
|
||||||
COMBDLY, // Combinatorial delayed assignment
|
COMBDLY, // Combinatorial delayed assignment
|
||||||
STMTDLY, // Delayed statement
|
STMTDLY, // Delayed statement
|
||||||
|
SYMRSVDWORD, // Symbol is Reserved Word
|
||||||
GENCLK, // Generated Clock
|
GENCLK, // Generated Clock
|
||||||
IMPERFECTSCH, // Imperfect schedule (disabled by default)
|
IMPERFECTSCH, // Imperfect schedule (disabled by default)
|
||||||
IMPLICIT, // Implicit wire
|
IMPLICIT, // Implicit wire
|
||||||
@@ -74,38 +78,41 @@ public:
|
|||||||
// ***Add new elements below also***
|
// ***Add new elements below also***
|
||||||
};
|
};
|
||||||
enum en m_e;
|
enum en m_e;
|
||||||
inline V3ErrorCode () {};
|
inline V3ErrorCode () {}
|
||||||
inline V3ErrorCode (en _e) : m_e(_e) {};
|
inline V3ErrorCode (en _e) : m_e(_e) {}
|
||||||
V3ErrorCode (const char* msgp); // Matching code or ERROR
|
V3ErrorCode (const char* msgp); // Matching code or ERROR
|
||||||
explicit inline V3ErrorCode (int _e) : m_e(static_cast<en>(_e)) {};
|
explicit inline V3ErrorCode (int _e) : m_e(static_cast<en>(_e)) {}
|
||||||
operator en () const { return m_e; };
|
operator en () const { return m_e; }
|
||||||
const char* ascii() const {
|
const char* ascii() const {
|
||||||
const char* names[] = {
|
const char* names[] = {
|
||||||
// Leading spaces indicate it can't be disabled.
|
// Leading spaces indicate it can't be disabled.
|
||||||
" MIN", " SUPPRESS", " INFO", " FATAL", " ERROR",
|
" MIN", " SUPPRESS", " INFO", " FATAL", " FATALSRC", " ERROR",
|
||||||
// Boolean
|
// Boolean
|
||||||
" I_COVERAGE", " I_TRACING",
|
" I_COVERAGE", " I_TRACING",
|
||||||
// Errors
|
// Errors
|
||||||
"MULTITOP", "TASKNSVAR",
|
"MULTITOP", "TASKNSVAR", "BLKLOOPINIT",
|
||||||
// Warnings
|
// Warnings
|
||||||
" FIRST_WARN",
|
" FIRST_WARN",
|
||||||
"BLKANDNBLK",
|
"BLKANDNBLK",
|
||||||
"CASEINCOMPLETE", "CASEOVERLAP", "CASEWITHX", "CASEX", "CMPCONST",
|
"CASEINCOMPLETE", "CASEOVERLAP", "CASEWITHX", "CASEX", "CMPCONST",
|
||||||
"COMBDLY", "STMTDLY", "GENCLK", "IMPERFECTSCH", "IMPLICIT", "IMPURE",
|
"COMBDLY", "STMTDLY", "SYMRSVDWORD", "GENCLK", "IMPERFECTSCH", "IMPLICIT", "IMPURE",
|
||||||
"MULTIDRIVEN", "REDEFMACRO",
|
"MULTIDRIVEN", "REDEFMACRO",
|
||||||
"UNDRIVEN", "UNOPT", "UNOPTFLAT", "UNSIGNED", "UNUSED",
|
"UNDRIVEN", "UNOPT", "UNOPTFLAT", "UNSIGNED", "UNUSED",
|
||||||
"VARHIDDEN", "WIDTH", "WIDTHCONCAT",
|
"VARHIDDEN", "WIDTH", "WIDTHCONCAT",
|
||||||
" MAX"
|
" MAX"
|
||||||
};
|
};
|
||||||
return names[m_e];
|
return names[m_e];
|
||||||
};
|
}
|
||||||
// Warnings that default to off
|
// Warnings that default to off
|
||||||
bool defaultsOff() const { return ( m_e==IMPERFECTSCH );};
|
bool defaultsOff() const { return ( m_e==IMPERFECTSCH ); }
|
||||||
// Warnings that warn about nasty side effects
|
// Warnings that warn about nasty side effects
|
||||||
bool dangerous() const { return ( m_e==COMBDLY );};
|
bool dangerous() const { return ( m_e==COMBDLY ); }
|
||||||
// Warnings we'll present to the user as errors
|
// Warnings we'll present to the user as errors
|
||||||
// Later -Werror- options may make more of these.
|
// Later -Werror- options may make more of these.
|
||||||
bool pretendError() const { return ( m_e==BLKANDNBLK || m_e==IMPURE); };
|
bool pretendError() const { return ( m_e==BLKANDNBLK || m_e==IMPURE || m_e==SYMRSVDWORD); }
|
||||||
|
// Warnings to mention manual
|
||||||
|
bool mentionManual() const { return ( m_e==FATALSRC || pretendError() ); }
|
||||||
|
|
||||||
// Warnings that are lint only
|
// Warnings that are lint only
|
||||||
bool lintError() const { return ( m_e==CASEINCOMPLETE || m_e==CASEOVERLAP
|
bool lintError() const { return ( m_e==CASEINCOMPLETE || m_e==CASEOVERLAP
|
||||||
|| m_e==CASEWITHX || m_e==CASEX
|
|| m_e==CASEWITHX || m_e==CASEX
|
||||||
@@ -113,7 +120,7 @@ public:
|
|||||||
|| m_e==IMPLICIT
|
|| m_e==IMPLICIT
|
||||||
|| m_e==UNDRIVEN || m_e==UNSIGNED
|
|| m_e==UNDRIVEN || m_e==UNSIGNED
|
||||||
|| m_e==UNUSED || m_e==VARHIDDEN
|
|| m_e==UNUSED || m_e==VARHIDDEN
|
||||||
|| m_e==WIDTH); };
|
|| m_e==WIDTH); }
|
||||||
};
|
};
|
||||||
inline bool operator== (V3ErrorCode lhs, V3ErrorCode rhs) { return (lhs.m_e == rhs.m_e); }
|
inline bool operator== (V3ErrorCode lhs, V3ErrorCode rhs) { return (lhs.m_e == rhs.m_e); }
|
||||||
inline bool operator== (V3ErrorCode lhs, V3ErrorCode::en rhs) { return (lhs.m_e == rhs); }
|
inline bool operator== (V3ErrorCode lhs, V3ErrorCode::en rhs) { return (lhs.m_e == rhs); }
|
||||||
@@ -131,6 +138,7 @@ class V3Error {
|
|||||||
static int s_debugDefault; // Default debugging level
|
static int s_debugDefault; // Default debugging level
|
||||||
static int s_errCount; // Error count
|
static int s_errCount; // Error count
|
||||||
static int s_warnCount; // Error count
|
static int s_warnCount; // Error count
|
||||||
|
static int s_tellManual; // Tell user to see manual, 0=not yet, 1=doit, 2=disable
|
||||||
static ostringstream s_errorStr; // Error string being formed
|
static ostringstream s_errorStr; // Error string being formed
|
||||||
static V3ErrorCode s_errorCode; // Error string being formed will abort
|
static V3ErrorCode s_errorCode; // Error string being formed will abort
|
||||||
enum MaxErrors { MAX_ERRORS = 50 }; // Fatal after this may errors
|
enum MaxErrors { MAX_ERRORS = 50 }; // Fatal after this may errors
|
||||||
@@ -174,12 +182,12 @@ inline void v3errorEnd(ostringstream& sstr) { V3Error::v3errorEnd(sstr); }
|
|||||||
|
|
||||||
// These allow errors using << operators: v3error("foo"<<"bar");
|
// These allow errors using << operators: v3error("foo"<<"bar");
|
||||||
// Careful, you can't put () around msg, as you would in most macro definitions
|
// Careful, you can't put () around msg, as you would in most macro definitions
|
||||||
#define v3info(msg) v3errorEnd(((V3Error::v3errorPrep(V3ErrorCode::INFO)<<msg),V3Error::v3errorStr()));
|
|
||||||
#define v3fatal(msg) v3errorEnd(((V3Error::v3errorPrep(V3ErrorCode::FATAL)<<msg),V3Error::v3errorStr()));
|
|
||||||
#define v3error(msg) v3errorEnd(((V3Error::v3errorPrep(V3ErrorCode::ERROR)<<msg),V3Error::v3errorStr()));
|
|
||||||
#define v3warn(code,msg) v3errorEnd(((V3Error::v3errorPrep(V3ErrorCode::code)<<msg),V3Error::v3errorStr()));
|
#define v3warn(code,msg) v3errorEnd(((V3Error::v3errorPrep(V3ErrorCode::code)<<msg),V3Error::v3errorStr()));
|
||||||
|
#define v3info(msg) v3warn(INFO,msg)
|
||||||
|
#define v3fatal(msg) v3warn(FATAL,msg)
|
||||||
|
#define v3error(msg) v3warn(ERROR,msg)
|
||||||
// Use this instead of fatal() to mention the source code line.
|
// Use this instead of fatal() to mention the source code line.
|
||||||
#define v3fatalSrc(msg) v3fatal("Internal Error: "<<__FILE__<<":"<<dec<<__LINE__<<": "<<msg)
|
#define v3fatalSrc(msg) v3warn(FATALSRC,__FILE__<<":"<<dec<<__LINE__<<": "<<msg)
|
||||||
|
|
||||||
#define UINFO(level,stmsg) {if(debug()>=(level)) { cout<<"- "<<V3Error::lineStr(__FILE__,__LINE__)<<stmsg; }}
|
#define UINFO(level,stmsg) {if(debug()>=(level)) { cout<<"- "<<V3Error::lineStr(__FILE__,__LINE__)<<stmsg; }}
|
||||||
#define UINFONL(level,stmsg) {if(debug()>=(level)) { cout<<stmsg; } }
|
#define UINFONL(level,stmsg) {if(debug()>=(level)) { cout<<stmsg; } }
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2004-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+20
-2
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -61,7 +62,7 @@ class V3FileDependImp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool operator<(const DependFile& rhs) const { return filename()<rhs.filename(); };
|
bool operator<(const DependFile& rhs) const { return filename()<rhs.filename(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// MEMBERS
|
// MEMBERS
|
||||||
@@ -430,6 +431,23 @@ void V3OutFile::putBreak () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void V3OutFile::putsQuoted(const char* strg) {
|
||||||
|
// Quote \ and " for use inside C programs
|
||||||
|
// Don't use to quote a filename for #include - #include doesn't \ escape.
|
||||||
|
putcNoTracking('"');
|
||||||
|
for (const char* cp=strg; *cp; cp++) {
|
||||||
|
if (*cp == '\\') {
|
||||||
|
putcNoTracking('\\');
|
||||||
|
putcNoTracking('\\');
|
||||||
|
} else if (*cp == '"') {
|
||||||
|
putcNoTracking('\\');
|
||||||
|
putcNoTracking('"');
|
||||||
|
} else {
|
||||||
|
putcNoTracking (*cp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
putcNoTracking('"');
|
||||||
|
}
|
||||||
void V3OutFile::putsNoTracking (const char *strg) {
|
void V3OutFile::putsNoTracking (const char *strg) {
|
||||||
// Don't track {}'s, probably because it's a $display format string
|
// Don't track {}'s, probably because it's a $display format string
|
||||||
for (const char* cp=strg; *cp; cp++) {
|
for (const char* cp=strg; *cp; cp++) {
|
||||||
|
|||||||
+5
-2
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -112,6 +113,8 @@ public:
|
|||||||
void puts(const string& strg) { puts(strg.c_str()); }
|
void puts(const string& strg) { puts(strg.c_str()); }
|
||||||
void putsNoTracking(const char* strg);
|
void putsNoTracking(const char* strg);
|
||||||
void putsNoTracking(const string& strg) { putsNoTracking(strg.c_str()); }
|
void putsNoTracking(const string& strg) { putsNoTracking(strg.c_str()); }
|
||||||
|
void putsQuoted(const char* strg);
|
||||||
|
void putsQuoted(const string& strg) { putsQuoted(strg.c_str()); }
|
||||||
void putBreak(); // Print linebreak if line is too wide
|
void putBreak(); // Print linebreak if line is too wide
|
||||||
void putBreakExpr(); // Print linebreak in expression if line is too wide
|
void putBreakExpr(); // Print linebreak in expression if line is too wide
|
||||||
void putAlign(bool isstatic/*AlignClass*/, int align, int size=0/*=align*/, const char* prefix=""); // Declare a variable, with natural alignment
|
void putAlign(bool isstatic/*AlignClass*/, int align, int size=0/*=align*/, const char* prefix=""); // Declare a variable, with natural alignment
|
||||||
@@ -120,7 +123,7 @@ public:
|
|||||||
bool exceededWidth() const { return m_column > WIDTH; }
|
bool exceededWidth() const { return m_column > WIDTH; }
|
||||||
bool tokenStart(const char* cp, const char* cmp);
|
bool tokenStart(const char* cp, const char* cmp);
|
||||||
bool tokenEnd(const char* cp);
|
bool tokenEnd(const char* cp);
|
||||||
void indentInc() { m_indentLevel += INDBLK; };
|
void indentInc() { m_indentLevel += INDBLK; }
|
||||||
void indentDec() {
|
void indentDec() {
|
||||||
m_indentLevel -= INDBLK;
|
m_indentLevel -= INDBLK;
|
||||||
UASSERT(m_indentLevel>=0, ": "<<m_filename<<": Underflow of indentation\n");
|
UASSERT(m_indentLevel>=0, ": "<<m_filename<<": Underflow of indentation\n");
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// General Public License or the Perl Artistic License.
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
// Version 2.0.
|
||||||
//
|
//
|
||||||
// Verilator is distributed in the hope that it will be useful,
|
// Verilator is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user