Commit Graph

4947 Commits

Author SHA1 Message Date
Julie Schwartz
f5b1a5cd58 Fix make support for BSD ar (#2999) (#3256). [Julie Schwartz]
While GNU 'ar' supports '@' to specify a file, BSD 'ar' does not.
The max line length can be handled by 'xargs' instead, which will know
to break up the command.  In case there are multiple calls, only build
the index (specified with '-s') once in a later call.
2022-01-17 14:04:43 -05:00
Wilson Snyder
48a098b041 Tests: Fix some force/release coverage holes. 2022-01-16 16:53:06 -05:00
Geza Lore
f8c0169e82 Implement 'forceable' attribute
Using the 'forceable' directive in a configuration file, or the /*
verilator forceable */ metacomment on a variable declaration will
generate additional public signals that allow the specified signals to
be forced/released from the C++ code.
2022-01-16 15:31:37 +00:00
Geza Lore
539c9d4c63 Merge alternate 'force'/'release' implementation
- Add more tests, including for tracing.
- Apply some cleaner, more generic abstractions in the implementation.
- Use clearer AstRelease which is not an assignment.
2022-01-16 15:31:37 +00:00
Geza Lore
b4d8220cbb
Deprecate --cdc (#3279) 2022-01-16 15:30:44 +00:00
Wilson Snyder
5eded789aa Fix test 2022-01-09 19:29:30 -05:00
Wilson Snyder
e931c6230a Run EmitV test after all stages, and fix resulting fallout 2022-01-09 18:11:24 -05:00
Geza Lore
64a6e1ac8b
Add AstNode::foreach method for simple pre-order traversal (#3276) 2022-01-09 22:34:10 +00:00
Wilson Snyder
50094ca296 Internals: Add cpplint control file and related cleanups 2022-01-09 16:49:38 -05:00
Wilson Snyder
15b32dc140 Internals: cpplint cleanups. No functional change. 2022-01-08 12:01:39 -05:00
Wilson Snyder
441ecfedc9 Internals: Make all .h files compilable 2022-01-08 11:18:23 -05:00
HungMingWu
78147ee8d7 Fix compile error at GCC11
Fixes #3273

Signed-off-by: HungMingWu <u9089000@gmail.com>
2022-01-08 10:40:51 +00:00
Geza Lore
8c58612a3b Improve V3Inline speed and memory consumption
Avoid cloning the module when inlining the last instance that references
that module. This saves a lot of memory because it saves cloning
singleton modules (those with a single instance), which we always
inline. The top few levels of the hierarchy are often simple wrappers,
including the one added by Verilator in V3LinkLevel::wrapTop. Cloning
these and putting off deleting the originals can be very expensive
because they often have a lot of contents inlined into them, so each
layer of wrapper that is inlined would essentially add a whole new clone
of the large top-level. Directly inlining the module for the last cell
without cloning saves us from all this duplicate memory consumption and
also from having to create the clones in the first place.

Also added minor traversal speedups

This reduces the memory consumption of V3Inline by 80% and peak memory
consumption of Verilator by about 66% on a large design, while speeding
up the V3Inline pass by ~3.5x and the whole of Verilator by ~8% while
producing identical output.
2022-01-07 12:11:10 +00:00
Geza Lore
56f9d244de Cleanup V3Inline. No functional change. 2022-01-07 12:08:17 +00:00
Geza Lore
2ba9eb4228 Speed up TSP sort implementation
- More efficient comparison by pre-computing sorting keys.
- Remove work items in algorithms known to be redundant earlier.
  This greatly reduces data structure sizes.
- Use V3GraphVertex->user() for state tracking instead of unordered_map
  while both of these are constant time, they do add up.
- In `makeMinSpanningTree`, instead of batch inserting outgoing edges of
  each visited vertex into an ordered set, keep an ordered set of sorted
  vectors of edges. This reduces the size of the ordered set
  significantly (it is now O(V) rather than O(E), and as the subject
  graph is a complete graph, V ~ sqrt(E), so this is a significant gain).
- Use a vector + sorting in `perfectMatching` instead of an ordered set.
  This is faster on large working sets.

This yields 3.8x speedup on the variable order pass and overall 14%
verilation speed gain on a large design.
2022-01-07 12:05:52 +00:00
Geza Lore
9a8c878f2d Avoid repeated traversal for SC text sections in emit when not needed
Repeatedly traversing whole modules in emit (due to file splitting)
looking for `systemc_* sections can add up to a lot of time on large
designs that have been flattened and need to be split into many files.
Assuming `systemc_* is a rarely used feature, just don't bother if we
don't need to. This gain 9% verilation speed improvement on a large
benchmark.
2022-01-07 12:05:50 +00:00
Wilson Snyder
41a563bdc8 Internal cleanups towards recursive functions (#3267) 2022-01-04 20:19:58 -05:00
Yutetsu TAKATSUKASA
4e5f30858b
Fix #3258 of internal error with inout port (#3268)
* Tests: Modify t_tri_inout to reproduce #3258

* Set direction of __en accorting to its main signal direction

* Update Changes
2022-01-05 08:37:20 +09:00
Wilson Snyder
b989ac6db5 Internals: Support linking recursive function calls (but not later stages) 2022-01-03 18:50:41 -05:00
Wilson Snyder
4d1f4bbf49 Backout last commit; is unstable. 2022-01-03 13:04:47 -05:00
Wilson Snyder
e9ad665d32 Internals: Support linking recursive function calls (but not later stages) 2022-01-03 12:25:50 -05:00
Wilson Snyder
78052f87bd Tests: Update recursive function tests 2022-01-03 12:02:53 -05:00
Wilson Snyder
ebf5c11e03 Internals: In astgen text output, pickup missing node references 2022-01-02 20:54:39 -05:00
Wilson Snyder
7e355e211c Fix dangling node on error 2022-01-02 20:54:13 -05:00
Wilson Snyder
f36461e696 Internals: Remove dead code 2022-01-02 18:38:07 -05:00
github action
88d7ca01b0 Apply 'make format' 2022-01-02 20:13:16 +00:00
Wilson Snyder
2e2b82c052 Support class static members (#2233). 2022-01-02 15:09:07 -05:00
Wilson Snyder
f1bb0544be Internals: Cleanups towards static class members. No functional change intended. 2022-01-02 15:03:57 -05:00
Wilson Snyder
3b1371124e Update bug template. 2022-01-02 14:03:20 -05:00
Wilson Snyder
e6857df5c6 Internals: Rename Ast on non-node classes (#3262). No functional change.
This commit has the following replacements applied:

	s/\bAstUserInUseBase\b/VNUserInUseBase/g;
        s/\bAstAttrType\b/VAttrType/g;
        s/\bAstBasicDTypeKwd\b/VBasicDTypeKwd/g;
        s/\bAstDisplayType\b/VDisplayType/g;
        s/\bAstNDeleter\b/VNDeleter/g;
        s/\bAstNRelinker\b/VNRelinker/g;
        s/\bAstNVisitor\b/VNVisitor/g;
        s/\bAstPragmaType\b/VPragmaType/g;
        s/\bAstType\b/VNType/g;
        s/\bAstUser1InUse\b/VNUser1InUse/g;
        s/\bAstUser2InUse\b/VNUser2InUse/g;
        s/\bAstUser3InUse\b/VNUser3InUse/g;
        s/\bAstUser4InUse\b/VNUser4InUse/g;
        s/\bAstUser5InUse\b/VNUser5InUse/g;
        s/\bAstVarType\b/VVarType/g;
2022-01-02 14:03:20 -05:00
github action
73374a0303 Apply 'make format' 2022-01-02 18:36:52 +00:00
Wilson Snyder
e334740dd6 Add AstInitialAutomatic as prep for static class members 2022-01-02 12:35:44 -05:00
Wilson Snyder
84ee833ea7 Ignore --x-initial unique inside classes. 2022-01-02 12:26:10 -05:00
Wilson Snyder
b7ad1e6d61 Internals: Rename some non-nodes to avoid Ast prefix. No functional change. 2022-01-02 10:37:20 -05:00
github action
340efe3a3a Apply 'make format' 2022-01-02 14:46:15 +00:00
Wilson Snyder
2342549caf Internals: V3Class cleanup. No functional change. 2022-01-02 09:43:37 -05:00
Wilson Snyder
028737cde8 Tests: Add unsupported t_class_static_member tests. 2022-01-02 09:43:26 -05:00
Wilson Snyder
bf972963f4 Misc internal and test work towards enum type checks (#726). 2022-01-01 22:16:58 -05:00
Wilson Snyder
9bda91b3bf Fix clang compile warning 2022-01-01 19:33:12 -05:00
Wilson Snyder
e4c5eb5e69 Fix spurious UNUSED by ignoring inout pin connections (#3242). 2022-01-01 18:37:34 -05:00
Wilson Snyder
2e8cc22c54 Copyright year update. 2022-01-01 18:34:15 -05:00
Wilson Snyder
655910d486 Fix associative array first method as statement (#3228). 2022-01-01 17:10:26 -05:00
github action
2a0ec88379 Apply 'make format' 2022-01-01 21:55:27 +00:00
Wilson Snyder
80859a609a Fix $fclose not accepting expressions (#3237). 2022-01-01 16:48:15 -05:00
Wilson Snyder
d679d50eca Fix $random not updating seed (#3238). [Julie Schwartz] 2022-01-01 16:43:06 -05:00
Wilson Snyder
65de118e51 Internals: Factor common V3Width function. 2022-01-01 16:15:53 -05:00
Wilson Snyder
4cd56b1fb9 Use C++11 standard types for MacOS portability (#3254) (#3257). 2022-01-01 16:04:20 -05:00
Wilson Snyder
f3945e7c02 Tests: Add t_class_param_pkg test. 2022-01-01 14:30:41 -05:00
Wilson Snyder
5ef982b4b5 Fix internal error on reference to typedef'ed class 2022-01-01 13:48:53 -05:00
Wilson Snyder
f96d336b97 Internals: Pre-elaboration progress towards class parameters. 2022-01-01 12:50:43 -05:00