Commit Graph

8794 Commits

Author SHA1 Message Date
Wilson Snyder 19d5adcbdf Commentary: Changes update 2025-11-16 17:13:49 -05:00
Wilson Snyder 03e5c3b2ff Tests: Reindent some tests. No functional change. 2025-11-16 17:13:01 -05:00
github action 59bc4cf66b Apply 'make format' 2025-11-16 03:53:48 +00:00
Jean-Nicolas Strauss 6454a8802e
Fix stream operator widening (#6693) (#6697) 2025-11-15 22:52:52 -05:00
Yilou Wang 048c97f0ae
Support `std::randomize(){...}` (#4706) (#6573) 2025-11-14 14:32:01 -05:00
Ryszard Rozak f32095dd17
Support constexpr cycle delay in sequences (#6691) 2025-11-14 13:48:46 +01:00
Pawel Kojma 0dce8feead
Support parsing of dotted bins_expression (#6683) 2025-11-14 06:41:46 -05:00
Geza Lore 43975bcbdd
Optimize $past delayed variable reuse (#6689)
As the TODO in the original code suggested, we can re-use delayed values
of expressions if they appear in multiple $past calls.
2025-11-13 17:04:50 +00:00
Geza Lore a1056c6ae9
Add `-param`/`-port` options to `public_flat*` control directives (#6685) 2025-11-13 06:59:02 -05:00
Wilson Snyder 5c0ad5bd1f
Internals: cppcheck fixes. No functional change. (#6687) 2025-11-12 18:54:22 -05:00
Wilson Snyder 67094f6a88 Tests: Disable t_udp_sequential until fix (#6056 workaround) 2025-11-12 18:52:17 -05:00
Wilson Snyder 7db8bc84aa Tests: Add more 'config' unsupported tests (#5891 partial) 2025-11-12 18:37:09 -05:00
Geza Lore 158f51fb54
Optimize functions reading external parameters as pure (#6684) 2025-11-12 08:27:42 -05:00
Geza Lore 0dc9f779f8
Add `-fno-inline-funcs-eager` option to disable excessive inlining (#6682) 2025-11-11 21:46:19 +00:00
Geza Lore c5f8656aa0
Fix bounds checking in non-inlined function (#6677) 2025-11-11 06:47:49 -05:00
Wilson Snyder eb40c24b78 Tests: Rename tests to proper categories 2025-11-10 20:56:38 -05:00
Todd Strader 34f63396cb
Fix `free` collision (#6675) 2025-11-10 16:44:41 -05:00
Geza Lore 8e35c81399
Fix --expand-limit not respected for expressions (#6670) 2025-11-10 17:18:33 +00:00
Pawel Kojma 0062a422a4
Support `#1step` delay as statement (#6671) 2025-11-10 09:39:33 -05:00
Artur Bieniek 19bbeb24a6
Fix large array initialization (#6669) 2025-11-10 09:19:08 -05:00
Geza Lore 6e05361318 Tests: Add case for `bind` into parametrised hier_block
Using `bind` into a parametrized hier_block used to be broken due to name
mangling, but was 'unintentionally' fixed by
916a89761e. Adding test to avoid
regressions.
2025-11-10 12:32:10 +00:00
Wilson Snyder fbb195e054 Tests: Add UVM 2020-3.1 hello world 2025-11-09 15:02:22 -05:00
Wilson Snyder c87a3e92fc Commentary: Changes update 2025-11-09 14:50:31 -05:00
Geza Lore c7ff73a083
Add --unroll-limit option (#6654) (#6668) 2025-11-09 12:46:25 -05:00
Geza Lore f4086496cb
Internals: Refactor file handling in EmitC* (#6667)
Combined the 3 various APIs used in EmitC* passes to handle file
opening/splitting into a single one. This removes a lot of copy paste
and makes everything consistent.

All C++ file handling goes through `EmitCBaseVisitor` using the
`openNewOutputHeaderFile`, `openNewOutputSourceFile` and
`closOutputFile` methods.

To emit a new kind of file, always derive a new class from
`EmitCBaseVisitor`, and use the above APIs, they will take care of
everything else in a consistent matter.

Subsequently also removed V3OutSCFile, and instead included
verilated_sc.h (which included the systemc header itself) in the two
files that need it (the primary model header, and the root module
header).

Functional changes:
- The PCH header did not use to have a corresponding AstCFile. Now it
  does, though this makes no difference in the output
- All 'slow' sources now have '__Slow' in the name automatically (the
  only one missing was for the ConstPool files)

Rest of the output is identical except for the header line now being
present in all generated C++ files.
2025-11-09 17:41:13 +00:00
Paul Swirhun aaafa6e8df
Fix local interface parameter hierarchical access (#6661) (#6666)
Co-authored-by: Paul Swirhun <paulswirhun@gmail.com>
2025-11-09 10:48:55 -05:00
Geza Lore 107776f324
Optimize repeated function call during symbol table init (#6665) 2025-11-08 16:48:00 -05:00
Wilson Snyder c493982511 Spelling fixes 2025-11-08 16:09:45 -05:00
Wilson Snyder 234b15a3e6 Commentary: Changes update 2025-11-08 16:09:24 -05:00
Wilson Snyder 78d27842cf Internals: Recogize "fixes" strings in `log-changes` 2025-11-08 13:56:21 -05:00
github action c3cd379fd5 Apply 'make format' 2025-11-08 15:57:16 +00:00
Geza Lore 8ad8d4f807
Fix long C++ compilation due to VerilatedScope constructors (#6664)
The Syms class can contain a very large number of VeriltedScope
instances if `--vpi` is used, all of which need a call to the default
constructor in the constructor of the Syms class. This can lead to very
long compilation times, even without optimization on some compilers.

To avoid the constructor calls, hold VeriltedScope via pointers in the
Syms class, and explicitly new and delete them in the Syms
constructor/destructor. These explicit new/delte can then be
automatically split up into sub functions when the Syms
constructor/destructor become large.

Regarding run-time performance, this should have no significant effect,
most interactions are either during construction/destruction of the Syms
object, or are via pointers already. The one place where we used to
refer to VerilatedScope instances is when emitting an AstScopeName for
things like $display %m. For those there will be an extra load
instruction at run-time, which should not make a big difference.

Patch 3 of 3 to fix long compile times of the Syms module in some
scenarios.
2025-11-08 15:56:15 +00:00
Geza Lore ec3c9832de Fix crash on Dfg driver lookup
Fixes #6649
2025-11-08 13:55:56 +00:00
Geza Lore 3b7ddce207
Optimize run-time symbol table construction of public variables (#6663)
Follow up from #6662 `VerilatedScope::varInsert` can do its work in one
pass, no need to emit it twice.
2025-11-08 13:29:44 +00:00
Geza Lore 71dcf30c1f Do not include redundant headers in Syms implementation files
These are all available through the PCH
2025-11-08 10:36:41 +00:00
Geza Lore 0f96bd0f4d
Fix splitting of Syms constructor/destructor bodies (#6662)
Splitting of the Syms constructor/destructor were a bit arbitrarily
enforced with some parts splitable, while others not. There was also an
issue that even if the constructor and destructor bodies were split, we
would still end up with both in the same file that was double the size of
the intended split limit.

To fix, first all statements required in the Syms constructor and
destructor are gathered into a vector, then if the total number of
statements required for both is bigger than the split limit, the
implementations are split into sub-functions, one per file, as before,
ensuring that none of the functions are bigger than the split limit.

Also add __Slow suffix to the names of the files.

Patch 2 of 3 to fix long compile times of the Syms module in some
scenarios.
2025-11-08 10:36:12 +00:00
Geza Lore 2fabf50801
Use explicit ctor/dtor functions for VerilatedModules (#6660)
In order to avoid long compile times of the Syms constructor due to
having a very large number of member constructor sto call, move to using
explicit ctor/dtor functions for all but the root VerilatedModule. The
root module needs a constructor as it has non-default-constructible
members. The other modules don't.

This is only part of the fix, as in order to avoid having a default
constructor call the VerilatedModule needs to be default constructible.
I think this is now true for modules that do not contain strings or
other non trivially constructible/destructible variables.

Patch 1 of 3 to fix long compile times of the Syms module in some
scenarios.
2025-11-07 19:57:10 +00:00
github action eafad9742a Apply 'make format' 2025-11-07 13:14:00 +00:00
Geza Lore 0b0e103fde Fix ccache-report with PCH files 2025-11-07 09:41:23 +00:00
Geza Lore 9d74984163 Fix non-deterministic output when splitting Syms file 2025-11-06 15:46:14 +00:00
Bartłomiej Chmiel 5adecb9fa3
Support multi-expression sequences (#6639) 2025-11-06 08:42:27 -05:00
Geza Lore f7e12e9219
Fix slow compilation of generated sampled value code (#6652)
For handling $past and similar functions, we used to collect sampled
values of variables at the beginning of the main _eval function. If we
have many of these, this can grow _eval very large which can make C++
compilation very slow. Apply usual fix of emitting the necessary code in
a separate function and then splitting it based on size.
2025-11-06 13:31:40 +00:00
Todd Strader 47b52800bf
Fix expression coverage of system calls (#6592) 2025-11-06 08:23:35 -05:00
Christian Hecken 100c831474
Tests: Fix Icarus vvp execution with use_libvpi (#6648) 2025-11-05 13:41:53 -05:00
Geza Lore cb5f038060
Internals: Optimzie unlinking rest of list after head (tail) (#6643)
AstNode::unlinkFrBackWithNext is O(n) if the subject node is not the
head of the list. We sometimes want to unlink the rest of the list
starting at the node after the head (e.g.: in
V3Sched::util::splitCheck), this patch makes that O(1) as well.
2025-11-05 15:55:30 +00:00
Geza Lore a35d4a4b4b
Add memory usage statistics on macOS (#6644)
Add memory usage statistics on macOS
2025-11-05 15:45:35 +00:00
Ryszard Rozak 96ece751fa
Internals: Simplify release handling. No functional change intended (#6647) 2025-11-05 10:20:18 -05:00
Geza Lore 4404978765
Fix command line statistics with --stats (#6645) (#6646)
Fixes #6645
2025-11-05 14:59:25 +00:00
Yilou Wang 0853aa7515
Support basic global constraints (#6551) (#6552) 2025-11-05 07:14:03 -05:00
github action 574c69c092 Apply 'make format' 2025-11-05 10:50:31 +00:00