Commit Graph

3078 Commits

Author SHA1 Message Date
Geza Lore
30fa5e41be Don't emit trace files with --lint-only 2021-07-19 17:48:38 +01:00
Geza Lore
cf39331d1f Emit: Factor out visitor that can emit constant initializers
This is needed both by the V3EmitCConstPool emitter and the
V3EmitCHeaders emitter.
2021-07-14 13:56:04 +01:00
Geza Lore
bac84726e1 Emit: Clean up some code coverage holes 2021-07-14 12:27:33 +01:00
Geza Lore
ddef61d62e Internals: Move AstNodeCCall::m_selfPointer to AstCCall
Other sub-classes of AstNodeCCall do not need the self pointer. Moving
it into the specific sub-class that needs it clarifies V3Descope and
Emit. No functional change intended.
2021-07-13 17:47:42 +01:00
Geza Lore
4081a1a539 Internals: Separate emitting of C++ headers and implementation
Internal AstNodeModule headers (.h) and implementation (.cpp) files are
now emitted separately in V3EmitC::emitcHeaders() and
V3EmitC::emitcImp() respectively. No functional change intended
2021-07-13 17:43:44 +01:00
Geza Lore
1691bbfe25 Remove unnecesasry and incorrect trace class CUse. 2021-07-13 14:20:57 +01:00
Geza Lore
17cc452f79 Add V3VariableOrder pass
A separate V3VariableOrder pass is now used to order module variables
before Emit. All variables are now ordered together, without
consideration for whether they are ports, signals form the design, or
additional internal variables added by Verilator (which used to be
ordered and emitted as separate groups in Emit). For single threaded
models, this is performance neutral. For multi-threaded models, the
MTask affinity based sorting was slightly modified, so variables with no
MTask affinity are emitted last, otherwise the MTask affinity sets are
sorted using the TSP sorter as before, but again, ports, signals, and
internal variables are not differentiated. This yields a 2%+ speedup for
the multithreaded model on OpenTitan.
2021-07-12 14:53:40 +01:00
Wilson Snyder
8ecdc85cf7 Internals: C++11 style cleanups. No functional change. 2021-07-11 18:42:01 -04:00
Geza Lore
5ad3c4e499 Internals: Speed up and improve V3Broken
This patch makes OpenTitan verilation with --debug-check 22% faster, and
the same with --debug --no-dump-tree 91% faster. Functionality is the
same (including when VL_LEAK_CHECKS is defined), except V3Broken can now
always find duplicate references via child/next pointers if the target
node is not `maybePointedTo()` (previously this only happened when
compiled with VL_LEAK_CHECKS). The main change relates to storing the
v3Broken traversal state in the AstNode by stealing a byte from what
used to be unused flags. We retain an unordered_set only for marking
pointers as valid to be referenced via a non-child/non-next member
pointer.
2021-07-11 21:03:17 +01:00
Geza Lore
8a9d6d225b Internals: Add source file/line info to BROKEN_RTN messages 2021-07-11 16:50:05 +01:00
Wilson Snyder
c7499133b2 Internals: C++11 for bool. No functional change. 2021-07-11 10:42:32 -04:00
Geza Lore
896b18e024 Emit function locals in the place they appear in the tree
Do not sort and hoist function local variables to the top of the
function definition. The stack layout of automatic variables is not
defined by C so the compilers can lay these out optimally. Simplifies
internals for follow on work. Effect on model performance is neutral to
very slight improvement, so we do not seem to be loosing anything.
2021-07-10 15:20:19 +01:00
Geza Lore
766ad14ae0 Check function locals are referenced only when in scope
V3Broken now checks that AstVar nodes referenced in an AstCFunc are
either external, or appear in the tree before the reference, and are in
scope.

Fix V3Begin to move lifted AstVars to beginning of FTask, rather than
end, which trips the above check.
2021-07-10 15:20:19 +01:00
Geza Lore
add3811f46 Internals: Fix debug prints racing with option parsing.
debug() declared by VL_DEGUB_FUNC used to cache the result of the debug
level lookup (which depends on options) in a static. This meant that if
the debug() function was called before option parsing, the default debug
level of 0 would be used for the rest of the program, even if a --debug
option was given. Fixed by not caching the debug level until after
option parsing is complete.
2021-07-10 12:57:40 +01:00
Wilson Snyder
bdceb08963 Internals: Fix off-by-one #line. 2021-07-10 07:11:34 -04:00
Geza Lore
825d6b87a8 Internals: Put AstNode flags in padding gap, initialize spare bits
The bool AstNode flags fit in a padding gap after m_type. This reduces
memory consumption by about 2% on OpenTitan. Initializing the unused
bits in the flags then avoids a read-modify-write in the constructor
(replacing it with a store constant). Overall verilation speed is about
1% faster.
2021-07-10 08:56:05 +01:00
Wilson Snyder
61e2e55ba5 Internals: Fix coverage holes. No functional change. 2021-07-09 18:11:59 -04:00
Geza Lore
a4f5d95648 Fix -G to treat simple integer literals as signed (#3060)
The -G option now correctly parses simple integer literals as signed
numbers, which is in line with the standard and is significant when
overriding parameters without a type specifier.

Fixes #3060
2021-07-08 13:42:25 +01:00
Geza Lore
686baaf2cf Internals: Streamline trace function generation
Remove magic code fragments form EmitCTrace, so Emit need not be aware
that a function is tracing related or not (apart from the purpose of
file name generation). All necessary code is now generated via text
nodes in V3TraceDecl and V3Trace. No functional change intended.
2021-07-08 02:08:09 +01:00
Geza Lore
76b3776fa3 Change generated tracing routines to use snake_case
For consistency with the rest of the generated code, generated methods
related to tracing now use snake_case instead of camelCase. No
functional change intended.
2021-07-08 02:08:09 +01:00
Wilson Snyder
3aa6332f25 Fix Codacy warnings. No functional change. 2021-07-07 19:42:49 -04:00
Wilson Snyder
36599133bf Add --prof-c to pass profiling to compiler (#3059). 2021-07-07 19:12:52 -04:00
Wilson Snyder
93578d64d2 Internals: Remove old needHeavy code. 2021-07-07 17:56:34 -04:00
Dan Petrisko
8c705ee145
Support middle-of-design nested topmodules (#3026) 2021-07-07 15:00:29 -04:00
Morten Borup Petersen
fd0446f481
Internals: Add .dot graph visualization of ThreadSchedule (#3048)
* Move MTaskState to ThreadSchedule

MTaskState does not concern itself with sandbagging, and thus solely contains information related to the finalized schedule, i.e., completion time, thread ID and next MTask on thread.

* Add .dot graph visualization of ThreadSchedule

Follow-up to #2779.

This commit adds the creation of .dot files - used by GraphViz - to visualize how mtasks are statically scheduled across the set of specified threads.
We visualize each thread as a row, with nodes of a row being the mtasks scheduled for the given thread. The width of the mtask nodes are proportional to their cost. MTask dependencies are shown using an edge between the source and sink mtasks.
2021-07-06 07:06:00 -04:00
Geza Lore
2ebed755e6 V3Simulate: Avoid copying while managing free list.
V3Simulate reuses allocated AstConst nodes for efficiency, however this
used to be implemented in a way that required a deep copy of a
std::unorderd_map<_, std::deque<_>>, which was quite inefficient when it
grew large. The free list is now managed without any copying. This takes
the V3Table pass from taking 12s to 0.2s on SweRV EH1.
2021-07-05 17:07:33 +01:00
Geza Lore
2a7aa28b20 V3Simulate/V3Table: change deques to vectors for performance
We can get away with only push_back and back on sequence containers, in
which case std::vector is significantly faster than std::deque.
2021-07-05 15:53:56 +01:00
Geza Lore
d5c9369103
Internals: Fix suspicious dtype clone relinking. (#3056) 2021-07-01 14:33:44 -04:00
Geza Lore
af27702188 Fix type parameter resolution with hash collision.
We incorrectly treated two different struct types the same when passed
as an actual parameter to a `parameter type` parameter in an instance,
if the actual parameter expression both hash to the same value and the
structs have the same struct name. This is now corrected.

Fixes #3055.
2021-07-01 16:52:29 +01:00
Geza Lore
708abe0dd1 Introduce model interface class, make $root part or Syms (#3036)
This patch implements #3032. Verilator creates a module representing the
SystemVerilog $root scope (V3LinkLevel::wrapTop). Until now, this was
called the "TOP" module, which also acted as the user instantiated model
class. Syms used to hold a pointer to this root module, but hold
instances of any submodule. This patch renames this root scope module
from "TOP" to "$root", and introduces a separate model class which is
now an interface class. As the root module is no longer the user
interface class, it can now be made an instance of Syms, just like any
other submodule. This allows absolute references into the root module to
avoid an additional pointer indirection resulting in a potential speedup
(about 1.5% on OpenTitan). The model class now also contains all non
design specific generated code (e.g.: eval loops, trace config, etc),
which additionally simplifies Verilator internals.

Please see the updated documentation for the model interface changes.
2021-06-30 16:35:40 +01:00
Yutetsu TAKATSUKASA
22e0f3edbe
Introduce small object optimization to V3Number (#3034) 2021-06-30 21:20:56 +09:00
Wilson Snyder
ee4a601c9e Internals: Use interface initialization for cleaner code. No functional change. 2021-06-28 22:40:39 -04:00
Morten Borup Petersen
e7b6a7ef6a Fix shadowing of vlSymsp member with argument (#3046).
This commit removes shadowing of the vlSymsp member of the emitted
modules, allowing models to compile when -Werror=shadow is set. This may
be useful when i.e., an external project which defines its own error
flags depends on the verilated model.
2021-06-28 20:37:09 +01:00
Geza Lore
2825940fad Fix dtype when simplifying masked shift.
Fixes #3044
2021-06-25 18:06:43 +01:00
Geza Lore
c6f6dab413 Emit: Factor out parts needed for emitting an AstCFunc
Factored out bits from V3EmitC.cpp that is required to emit a whole
(non-trace) AstCFunc. This is mostly what used to be the EmitCStmts
class plus relevant bits from EmitCImp. These now live in EmitCFunc,
which is reusable by anything that needs to emit a regular AstCFunc
(differences in tracing to be addressed later). EmitCImp now extends
EmitCFunc instead of EmitCStmts. No functional change intended.
2021-06-24 19:39:47 +01:00
Geza Lore
bbbee8b89e Make emitVarDecl and emitModCUse reusable via V3EmitCBase.
Moved these 2 function into V3EmitCBase so we can reuse them later.
emitVarDecl required minor alteration to move building of m_ctorVarsVec
back into V3EmitC (which is now done in V3EmitC::emitSortedVarList).
No functional change intended.
2021-06-24 18:15:47 +01:00
Geza Lore
5250408019 Add V3EmitCBase.cpp to hold implementations
No need to keep complex functions in the V3EmitCBase.h header (which is
included in a lot of compilation units). No functional change intended.
2021-06-24 18:04:54 +01:00
Wilson Snyder
f311a0a5a5 Internals: Add const. No functional change. 2021-06-22 08:43:54 -04:00
Geza Lore
ec1c112791
Remove deprecated --inhibit-sim (#3035) 2021-06-21 12:38:42 -04:00
Geza Lore
7ecc2d4df7 V3Hash: Add missing include.
Fixes #3029
2021-06-21 15:32:58 +01:00
Wilson Snyder
512fe0a2d1 Internals: Add const. No functional change. 2021-06-20 18:33:13 -04:00
Yutetsu TAKATSUKASA
ec4eb18846
Fiix incorrect result by bit tree opt (#3023) (#3030)
* Add a test to reproduce #3023. Also applied verilog-mode formatting.

* use unique_ptr. No functional change is intended.

* Introduce restorer that reverts changes during iterate() if failed.
2021-06-21 07:28:39 +09:00
Geza Lore
f064a94f1d Configure time unit/time precision in the Sym constructor.
This used to be done in the constructor of the top module, but there is
no reason to do it there. Internals are cleaner with this in the Sym
constructor. No functional change intended.
2021-06-19 20:42:38 +01:00
Geza Lore
19398efc4c Remove no-op VL_CELL. No functional change intended. 2021-06-19 20:42:38 +01:00
Geza Lore
fcb8bc22bd Internals: Remove m_classPrefix from AstNodeVarRef/AstNodeCCall
This is now redundant and can be reconstituted in V3EmitC without being
explicitly stored.
2021-06-19 20:42:38 +01:00
Wilson Snyder
c11cd18491 In XML, show pinIndex information (#2877). 2021-06-19 13:41:41 -04:00
Geza Lore
eebda248c7 Internals: Use AstUserAllocator in V3Order 2021-06-19 15:23:02 +01:00
Geza Lore
6c9c16c31d Simplify redundant masking of AstShiftR/AstShiftL
AND(CONST,SHIFTR(_,C)) appears often after V3Expand, with C a large
enough dense mask (i.e.: of the form  (1 << n) - 1) to make the masking
redundant. E.g.: 0xff & ((uint32_t)a >> 24). V3Const now replaces these
ANDs with the SHIFTR node.

Similarly, we also simplify the same with SHIFTL,
e.g.: 0xff000000 & ((uint32_t)a << 24)
2021-06-18 20:06:53 +01:00
Geza Lore
0c93c3844f Simplify AND(CONST,OR(_,_)) with redundant terms
V3Expand generates a lot of OR nodes that are under a clearing mask, and
have redundant terms, e.g.: 0xff & (a << 8 | b >> 24). The 'a << 8' term
in there is redundant as it's bottom bits are all zero where the mask is
non-zero. V3Const now removes these redundant terms.
2021-06-18 19:07:00 +01:00
Geza Lore
e5e5bc0fa3 Localize variables used in multiple functions
Teach V3Localize how to localize variables that are used in multiple
functions, if in all functions where they are used, they are always
written in whole before being consumed. This allows a lot more variables
to be localized (+20k variables on OpenTitan - when building without
--trace), and can cause significant performance improvement (OpenTitan
simulates 8.5% - build single threaded and withuot --trace).
2021-06-18 16:22:51 +01:00
Geza Lore
d6237e55b2 Internals: Add AstUserNAllocator utility classes.
These utility classes can be used to hang advanced data structures off
AstNode user*u() pointers, and they take care of memory management for
the client. Use via the call operator().
2021-06-18 16:22:51 +01:00
Geza Lore
3ec1e9eb07 Localize variables from other modules when possible
V3Localize can now localize variable references that reference variables
located in scopes different from the referencing function. This also
means V3Descope has now moved after V3Localize.
2021-06-18 16:22:51 +01:00
Geza Lore
d5bdd07c01 Fix out of bounds index into VlWide under AstSel
When part selecting bits via an AstSel in a VlWide, V3Expand used to do
something akin to:

word_index = lsb / 32;
bit_index = lsb % 32;
result =
  wide[word_index + 1] << (32 - bit_index) | wide[word_index] >> bit_index;

The unconditional "+ 1" can cause an out of bounds access into the
VlWide, when the whole of the select is into the most significant word
(i.e.: when word_index is already the most significant word).  We now
emit roughly this instead:

lo_word_index = lsb / 32;
bit_index = lsb % 32;
hi_word_index = (lsb + width - 1) / 32;
result =
  wide[hi_word_index] << (32 - bit_index) | wide[lo_word_index] >> bit_index;

i.e.: we explicitly calculate which word the MSB of the select falls
into, and address that word, rather than the unconditional + 1. The
shifts ensure we still yield the right result, even if lo_word_index and
hi_word_index are the same.

Note: The actual expression created by V3Expand can be a bit more
complicated as we might need to access 3 words when the result is a
QData, all 3 word indices are calculated explicitly.
2021-06-18 14:31:01 +01:00
Geza Lore
0a28fc8c63 Internals: minor cleanup to V3Descope 2021-06-17 14:30:15 +01:00
Geza Lore
9eafca5e28
Remove deprecated --no-relative-cfuncs (#3024) 2021-06-16 23:17:43 -04:00
Geza Lore
729bd268de Internals: make AstCFunc::m_isStatic a bool.
All functions are now known to be static or not static when they are
created, so turn the isStatic flag into a bool (from VBoolOrUnknown).
2021-06-16 14:24:28 +01:00
Geza Lore
6c332a2f8e Emit: Remove emitVarCmtChg
emitVarCmtChg used to emit MTask affinity of variables in comments in
the generated header. This causes unnecessary changes in the output when
scheduling changes slightly between compilation, hindering ccache reuse.
If needing this info for debugging Verilator, add a separate dump file
instead of emitting it in the generated code.
2021-06-16 14:24:25 +01:00
Geza Lore
a8f83d5758
Construct AstExecGraph implementation outside of V3EmitC. (#3022)
The goal of this patch is to move functionality related to constructing
the thread entry points and then invoking them out of V3EmitC (and into
V3Partition). The long term goal being enabling V3EmitC to emit
functions partitioned based on header dependencies. V3EmitC having to
deal with only AstCFunc instances and no other magic will facilitate
this.

In this patch:
- We construct AstCFuncs for each thread entry point in
V3Partition::finalize and move AstMTaskBody nodes under these functions.
- Add the invocation of the threads as text statements within the
AstExecGraph, so they are still invoked where the exec graph is located.
(the entry point functions are still referenced via AstCCall or
AstAddOrCFunc, so lazy declarations of referenced functions are created
automatically).
- Explicitly handle MTask state variables (VlMTaskVertex in
verilated_threads.h) within Verilator, so no need to text bash a lot of
these any more (some text refs still remain but they are all created
next to each other within V3Partition.cpp).

The effect of all this on the emitted code should be nothing but some
identifier/ordering changes. No functional change intended.
2021-06-16 12:18:56 +01:00
Geza Lore
c75a686081
Internals: Update to clang-format-11 (#3021) 2021-06-14 14:50:40 -04:00
Geza Lore
0c4d88bacc Fix V3Hash when building -m32 2021-06-13 23:19:25 +01:00
Wilson Snyder
13ddd0bc1c Fix error on unsupported recursive functions (#2957). 2021-06-13 12:38:31 -04:00
Wilson Snyder
9d3e800311 Commentary 2021-06-13 12:03:53 -04:00
Geza Lore
7280307a39 Implement DPI import/export as loose functions 2021-06-13 15:06:28 +01:00
Geza Lore
c207e98306
Implement a distinct constant pool (#3013)
What previously used to be per module static constants created in
V3Table and V3Prelim are now merged globally within the whole model and
emitted as part of a separate constant pool. Members of the constant
pool are global variables which are declared lazily when used (similar to
loose methods).
2021-06-13 15:05:55 +01:00
Geza Lore
60d5f0e86b
Emit model implementation as loose methods. (#3006)
This patch introduces the concept of 'loose' methods, which semantically
are methods, but are declared as global functions, and are passed an
explicit 'self' pointer. This enables these methods to be declared
outside the class, only when they are needed, therefore removing the
header dependency. The bulk of the emitted model implementation now uses
loose methods.
2021-06-13 14:33:11 +01:00
Geza Lore
e6e7bd8d83 Compile the debug build with -Og -ggdb -gz if supported.
Check the C++ compiler for -Og via configure and use it if available.

Per the GCC manual:
-Og should be the optimization level of choice for the standard
edit-compile-debug cycle, offering a reasonable level of optimization
while maintaining fast compilation and a good debugging experience. It
is a better choice than -O0 for producing debuggable code because some
compiler passes that collect debug information are disabled at -O0.

The debug exe is painfully slow on large designs, hopefully this is an
improvement.

Similarly, check for and use -gz to compress the debug info as it is
huge otherwise. This should help with distribution and caching on CI.

Also checks for -ggdb via configure for compatibility.
2021-06-12 23:25:58 +01:00
Geza Lore
b1c7de4ad5 Minor compiler compatibility fixes
- Initialize variable to avoid 'may be uninitialized' warning
- More reliable segfault (the previous version was compiled into an
undefined instruction by clang sometimes, thew new one is always a store
to zero).
2021-06-12 23:25:58 +01:00
Geza Lore
24b3816f5e Improve distribution of V3Hash/V3Hasher
- Better combining, without multiplication, which means a 0 hash value
is now allowed.
- Do not OR in bottom bits (this was used to avoid a 0 hash but had the
side effect of hashing 0 and 1 to the same value, which are actually
common inputs.
- Hash whole content of V3Number. This does not seem to be noticeable in
runtime, but quite often the bottom word can be a special value like
zero while the rest of the content varies.
2021-06-09 21:17:02 +01:00
Wilson Snyder
b976b8dac9 Fix slowdown in elaboration (#2911). 2021-06-06 22:09:30 -04:00
Wilson Snyder
8f2e4f6bb0 Fix clang warning. 2021-06-06 10:32:50 -04:00
Wilson Snyder
1e89392e76 Add --expand-limit argument (#3005). 2021-06-06 10:27:01 -04:00
Martin Schmidt
b0c1ac7ea2
Add support of --trace-structs parameter for CMake (#2986) 2021-06-06 09:27:44 -04:00
Geza Lore
258d9adfea
Aid IDE code linking in V3AstNodes.h (#3009) 2021-06-05 17:40:56 +01:00
Miodrag Milanović
fa063574d0
Fix Makefiles to support Windows EXEEXT usage (#3008). 2021-06-04 12:04:55 -04:00
Geza Lore
eea7e1bd2a
Do not emit leading spaces on blank lines (#3007) 2021-06-04 15:00:13 +01:00
Julien Margetts
1f331bd94f
Fix part select issues in LATCH warning. (#2948) (#2938) 2021-06-01 09:01:18 -04:00
Wilson Snyder
2143bcfad5 Fix constant function calls with uninit value (#2995). 2021-05-31 22:46:41 -04:00
Geza Lore
e1f9fffb42
Fix --protect-ids when using SV classes (#2994)
A few names were incorrectly mangled, which made --protect-ids produce
invalid output when certain SV class constructs were uses. Now fixed and
added a few extra tests to catch this.
2021-05-31 13:40:22 +01:00
Geza Lore
f4c1a7efeb
Emit: Fix indent tracking when // inside string literal (#2990)
// was so far unconditionally treated as comment.
c443e229ee introduced a string literal in
the output that contained a http:// url, which broke the indent
tracking. No functional change intended
2021-05-29 23:46:15 +01:00
Geza Lore
ef9f477df2
Make _ctror_var_reset and _configure_coverage static. (#2977)
Another step towards #2958/#2140. Make the mentioned generated functions
static for modules (but not for classes).
2021-05-22 18:50:55 +01:00
Geza Lore
2dd5ef5e8b
Internals: Move --coverage and --savable check out of V3EmitC (#2976) 2021-05-22 12:27:32 +01:00
github action
a43eba7011 Apply clang-format 2021-05-22 10:14:07 +00:00
Geza Lore
61c9866a1e
Internals: Generate ASTGEN_SUPER_* macros instead of expanding. (#2975)
astgen now generates ASTGEN_SUPER_* macros, instead of expanding the
ASTGEN_SUPER itself. This means that V3AstNodes.h itself can be included
in V3Ast.h, which helps IDEs (namely CLion) find definitions in
V3AstNodes.h a lot better. Albeit this is a little bit more boilerplate,
writing constructors of Ast nodes should be a lot rarer than trying to
find their definitions, so hopefully this is an improvement overall.
astgen will error if the developer calls the wrong superclass
constructor.
2021-05-22 11:13:02 +01:00
Geza Lore
8814111724
Rework Ast hashing to be stable (#2974)
Rework Ast hashing to be stable

Eliminated reliance on pointer values in AstNode hashes in order to make
them stable. This requires moving the sameHash functions into a visitor,
as nodes pointed to via members (and not child nodes) need to be hashed
themselves.

The hashes are now stable (as far as I could test them), and the impact
on verilation time is small enough not to be reliably measurable.
2021-05-21 14:34:27 +01:00
Geza Lore
fd35492226
Split V3Hashed to V3Hasher and V3DupFinder (#2967)
V3Hasher is responsible for computing AstNode hashes, while V3DupFinder
can be used to find duplicate trees based on hashes. Interface of
V3DupFinder simplified somewhat. No functional change intended at this
point, but hash computation might differ in minor details, this however
should have no perceivable effect on output/runtime.

Implements (#2964)
2021-05-21 01:41:46 +01:00
Geza Lore
9699192de8
Don't merge bit select assignments in C code (#2971) 2021-05-18 14:28:48 -04:00
Geza Lore
471f14d26a
Clean up V3Combine (#2965)
- Remove dead code
- Simplify what is left
- Minor improvements using C++11
- Remove special case AstNode constructors used only in one place in
  V3Combine (inlined instead).
2021-05-17 13:26:24 +01:00
Yutetsu TAKATSUKASA
31779b8b8b
Format time string using integer (#2940)
Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
2021-05-16 19:01:03 +09:00
Geza Lore
80d62adec7
Make all AstNode* base class constructors protected. (#2962)
No functional changes intended. Boring patch in the hope of being
helpful to new contributors. Although AstNode* base classes needing to
be abstract is described in the internals manual, this might provide a
bit of extra safety.
2021-05-15 21:10:16 +01:00
Geza Lore
38cab569ed
Add --reloop-limit argument (#2960)
Add --reloop-limit argument
2021-05-15 18:04:40 +01:00
Geza Lore
828f78ece4
Don't emit empty files with low split limits (#2961)
Attempt to split output files when we know a function will actually be
emitted, otherwise we might end up with empty files.
2021-05-15 16:05:24 +01:00
Geza Lore
5e95cc9280
Internals: Make AstAlwaysPost an AstNodeProcedure. (#2959)
This seems to belong there, eliminates some code duplication in V3Clock,
and also enables splitting AstAlwaysPost statements into different
functions in V3Order, but should otherwise have little effect.
2021-05-15 10:56:28 -04:00
Yutetsu TAKATSUKASA
9c85426e77
Internals: Fix build failure on older gcc such as 4.8.5 on CentOS7. No functional change is intended. (#2954) 2021-05-13 06:45:56 +09:00
Yutetsu TAKATSUKASA
f7c23c4ade
Internals: Set missing timescale though it is not referred yet. (#2946) 2021-05-11 22:38:13 +09:00
Geza Lore
1422c23434
Split procedures to better respect --output-split-cfuncs (#2942)
CFuncs only used to be split at procedure (always/initial/final block),
which on occasion can still yield huge output files if they have large
procedures. This patch make CFuncs split at statement boundaries within
procedures. This has the potential to help a lot, but still does not
help if there are huge statements within procedures.
2021-05-11 07:44:07 -04:00
Geza Lore
1a6378291a
Emit 'else if' without nesting. No functional change intended. (#2944)
Instead of:

if (a) {
  x;
} else {
  if (b) {
    y;
  } else {
    if (c) {
      z;
    } else {
      w;
    }
  }
}

Emit:

if (a) {
  x;
} else if (b) {
  y;
} else if (c) {
  z;
} else {
  w;
}
2021-05-10 22:15:12 +01:00
Geza Lore
267c6f6dce
Improve Reloop to accept constant index offsets. (#2939)
V3Reloop now can roll up indexed assignments between arrays if there is a
constant offset between indices on the left and right hand sides, e.g.:

a[0] = b[2];
a[1] = b[3];
...
a[x] = b[x + 2];
2021-05-10 18:01:11 +01:00
Yutetsu TAKATSUKASA
45fbd98ff1
Use V3OptionParser in verilator_coverage (#2935)
* Internals: Mark unused to avoid compilation failure. No functional change is intended.

* Use V3OptionParser in VlcMain.cpp
2021-05-09 07:04:22 +09:00
Geza Lore
f6c0108c86
Optimize large lookup tables to static data (#2926)
Implements #2925
2021-05-08 20:04:56 +01:00
Jonathan Drolet
37d68d39c8
Support --trace-fst for SystemC with CMake (#2927) 2021-05-08 08:42:00 -04:00