Commit Graph

2188 Commits

Author SHA1 Message Date
Wilson Snyder
820df28ad9 Internals: V3CUse state refactoring. No functional change intended. 2020-02-01 19:11:19 -05:00
Wilson Snyder
119162912a Internals: Determine emit forward declaraions in new pass, towards classes. 2020-02-01 16:51:05 -05:00
Wilson Snyder
80d94891e1 Internals: Allow const & non-member CFuncs for class branch. No functional change. 2020-02-01 10:57:55 -05:00
Geza Lore
f00ff61559 Link Verilator binary partially statically, Closes #2146.
The build is now by default configured to link performance critical
libraries (libgcc, libstdc++, libtcmalloc) statically. This improves
Verilation speed by between 4.5-7% based on my measurements as it
eliminates approx 20% of the mispredicted branches from the execution.
With partial static linking, the size of the .text section in
verilator_bin is increased by about 14%, and the binary is itself only
about 800KB bigger on disk, so hopefully this is not a big issue in
exchange for the faster compilation speed. A configure option
"--disable-partial-static" is provided to restore the old behaviour of
linking everything dynamically.

Note: This patch also changes to use libtcmalloc_minimal, which is all
we really need and itself has fewer dependencies.
2020-01-31 19:13:55 -05:00
Wilson Snyder
2d195ebae5 Cleanup IEEE references. 2020-01-30 20:23:57 -05:00
Wilson Snyder
d218f1746c Add warning on genvar in normal for loop, #2143. 2020-01-29 21:16:44 -05:00
Wilson Snyder
d4614c290e Fix WIDTH warning on </<= of narrower value, #2141. 2020-01-28 20:10:10 -05:00
Tobias Rosenkranz
027cce35c0 Support enum.next(k) with constant k > 1, #2125. 2020-01-27 17:25:25 -05:00
Wilson Snyder
9fd81b2c6b Support string character access via indexing. 2020-01-26 16:38:22 -05:00
Wilson Snyder
5430e4ac9b Cleanup more errors showing data types. 2020-01-26 15:54:57 -05:00
Wilson Snyder
619214b48f Support $sampled. 2020-01-26 13:38:15 -05:00
Wilson Snyder
68fa82fb14 Support $typename, and use to cleanup error messages. 2020-01-26 13:21:25 -05:00
Wilson Snyder
cac50282eb Fix pattern replication without key. 2020-01-26 11:38:34 -05:00
Wilson Snyder
8a8f1135b7 Support type(expression) operator, #1650. 2020-01-26 10:28:13 -05:00
Wilson Snyder
f0b2336345 Internals: Fix cell recursion with future module-in-module. 2020-01-25 18:15:55 -05:00
Wilson Snyder
52907e7b02 astgen: Preserve #line, #2138. 2020-01-25 15:36:37 -05:00
Geza Lore
ef5250f0ca Internals: Further performance improvement of AstNode type tests, #2138. No functional change intended.
Replace the virtual type() method on AstNode with a non-virtual, inlined
accessor to a const member variable m_type.  This means that in order to be
able to use this for type testing, it needs to be initialized based on the
final type of the node. This is achieved by passing the relevant AstType
value back through the constructor call chain. Most of the boilerplate
involved is auto generated by first feeding V3AstNodes.h through astgen to
get V3AstNodes__gen.h, which is then included in V3Ast.h. No client code
needs to be aware and there is no functional change intended.

Eliminating the virtual function call to fetch the node type identifier
results in measured compilation speed improvement of 5-10% as it
eliminates up to 20% of all mispredicted branches from the execution.
2020-01-25 15:29:44 -05:00
Wilson Snyder
eafed88a6e Internals: Add assertions. No functional change intended. 2020-01-25 10:19:59 -05:00
Wilson Snyder
d64e6b3f9c Internals: Refactoring towards classes. No functional change intended. 2020-01-25 09:33:43 -05:00
Wilson Snyder
d68ffba8cd Internals: Rename to prefixNameProtect. No functional change intended. 2020-01-25 09:16:00 -05:00
Wilson Snyder
f0f370490f Internals: Style cleanups. 2020-01-25 07:59:25 -05:00
Wilson Snyder
a4e8d39932 Spelling fixes 2020-01-24 20:10:44 -05:00
Wilson Snyder
8f0e8e0696 Fix FST tracing of enums inside structs. 2020-01-24 19:46:46 -05:00
Geza Lore
7ab2bdb6bb Support libgoogle-perftools-dev's libtcmalloc if available. #2137.
As Verilator continuously allocates and releases small objects (e.g.:
AstNode, V3GraphVertex, V3GraphEdge), it spends a significant amount of
time in malloc/free and friends. This patch adds the --enable-tcmalloc
configure option to link Verilator against the high performance malloc
implementation library libtcmalloc. The default is to use libtcmalloc if
available on the system. Note that there are no source code change, we
are simply replacing the standard library memory allocation functions.

Measured major compilation speed improvement of 27% when running
Verilator with -O3 on a large design.
2020-01-23 17:32:19 -05:00
Geza Lore
c5d04631d1 Internals: More performance efficient AstNode casting. Closes #2133.
dynamic_cast can have large run-time cost, so here we implement type
tests for AstNode instances by checking the unique type() property, which
in turn is a constant generated by astgen. For leaf types in the AstNode
type hierarchy, this is a simple equality check. To handle intermediate
types, we generate the type ids of leaf types in a pre-order traversal of
the type hierarchy. This yields contiguous ranges of ids for sub-type
trees, which means we can check membership of a non-leaf type via 2
comparisons against a low and high id. This single patch makes Verilator
itself 6-13% faster (depending on which optimizations are enabled) on a
large design of over 250k lines of Verilog.
2020-01-22 19:07:48 -05:00
Pieter Kapsenberg
957c1d606b Add detailed XML location to cell elements, #2134, #2122.
This was accidentally omitted from the previous PR #2122.
2020-01-22 07:18:50 -05:00
Wilson Snyder
48dd358c03 Fix clang warnings from override. 2020-01-21 20:22:32 -05:00
Geza Lore
220daa5f33 Internals: Restore AstNode naming property. #2133.
The intention was that all subclasses of AstNode which are
intermediate must be abstract as well and called AstNode*. This was
violated recently by 28b9db1903. This
patch restores that property by:
- Renaming AstFile to AstNodeFile
- Introducing AstNodeSimpleText as the common base of AstText and
  AstTextBlock, rather than AstTextBlock deriving from AstText.
2020-01-21 19:54:14 -05:00
Wilson Snyder
d76b5b7823 Fix C++11 intrusion. 2020-01-21 19:45:44 -05:00
Yutetsu TAKATSUKASA
fbdf5f2dad Internals: Mark all visit() with VL_OVERRIDE. Closes #2132.
* Add VL_OVERRIDE macro so that compiler can tell my typo when trying to override a function.

* Mark visit() with VL_OVERRIDE. No functional change intended.
2020-01-21 17:35:56 -05:00
Stefan Wallentowitz
8e26bdd098
Fix vpi scope naming (#2130)
Dedot and shorten the name so that public modules and interface cells
are accessible too via VPI.

Fixes #2109
2020-01-21 17:03:21 +01:00
Stefan Wallentowitz
22088c907f
Set maximum number width (#2128)
Adjust the maximum number width to 64K. Add --max-num-width option to
adjust this setting.

Closes #2082
2020-01-21 12:17:31 +01:00
Wilson Snyder
abf3850d08 Internals: Misc cleanups for classes. 2020-01-20 16:53:27 -05:00
Pieter Kapsenberg
4a122fd0f2 Add detailed location to XML output (#2122)
* Add detailed location to XML output

* Fixing build failures

* less cryptic regulary expressions

* correcting typo in test

* Adding file letter to the location attribute, and cleaning up the regular expression in the tests.

* Add remaining test expected output files for XML changes

* spacing fix, adding documentation on changes
2020-01-20 14:08:13 -05:00
Wilson Snyder
0352ceea44 Internals: Refactor some emit code towards classes. No functional change intended. 2020-01-20 14:07:03 -05:00
Wilson Snyder
e8ff191a17 Internals: Prepare for hierarchical NodeModule's. No functional change intended. 2020-01-20 13:27:27 -05:00
Wilson Snyder
5ae09daf5b Internals: Style cleanup. No functional change. 2020-01-20 11:56:08 -05:00
Pieter Kapsenberg
1dd9a74b6c Internals: Move V3Global function definitions to their own files. No functional change intended. Closes #2120. 2020-01-19 07:23:26 -05:00
Wilson Snyder
18e837336a Internals: Rename MethodCall. No functional change. 2020-01-18 14:11:05 -05:00
Wilson Snyder
835f668aaa Internals: Refactor statement tracking. No functional change intended. 2020-01-18 13:02:42 -05:00
Wilson Snyder
09199f79a6 Internals: Add VL_DO_CLEAR delete protections. No functional change intended. 2020-01-18 10:29:49 -05:00
Wilson Snyder
7024ea8cb6 Cleaner tristate error. #2117. 2020-01-18 07:56:50 -05:00
Wilson Snyder
623c4ec103 Internals: Create VL_DO_DANGLING. No functional change intended. 2020-01-16 20:17:11 -05:00
Wilson Snyder
023526ad4b Internals: Minor refactoring from class branch. 2020-01-15 20:18:12 -05:00
Pieter Kapsenberg
4443ab34fd Support left justified . Closes #2101. 2020-01-15 07:32:45 -05:00
Wilson Snyder
81e8127168 Add parameter values in XML. #2110. 2020-01-14 18:51:20 -05:00
Wilson Snyder
af38e8d387 Improve error on > 127 char modnames. #2106. 2020-01-14 07:33:12 -05:00
Wilson Snyder
67bb0c78c8 Codacity fix. 2020-01-14 07:13:35 -05:00
Wilson Snyder
918df2e618 Support / with assoc arrarys. Closes #2100. 2020-01-14 07:01:17 -05:00
Stefan Wallentowitz
fad465abf1
Add lint_off -match waivers (#2102)
* Add more directives to configuration files

Allow to set the same directives in configuration files that can also
be set by comment attributes (such as /* verilator public */ etc).

* Add support for lint messsage waivers

Add configuration file switch '-match' for lint_off. It takes a string
with wildcards allowed and warnings will be matched against it (if
rule and file also match). If it matches, the warning is waived.

Fixes #1649 and #1514 
Closes #2072
2020-01-12 10:03:17 +01:00