Commit Graph

1384 Commits

Author SHA1 Message Date
Geza Lore 99d3f600c0 Support #0 delays with IEEE-1800 compliant semantics
This patch adds IEEE-1800 compliant scheduling support for the Inactive
scheduling region used for #0 delays.

Implementing this requires that **all** IEEE-1800 active region events
are placed in the internal 'act' section. This has simulation
performance implications. It prevents some optimizations (e.g.
V3LifePost), which reduces single threaded performance. It also reduces
the available work and parallelism in the internal 'nba' section, which
reduced the effectiveness of multi-threading severely.

Performance impact on RTLMeter when using scheduling adjusted to support
proper #0 delays is ~10-20% slowdown in single-threaded mode, and ~100%
(2x slower) with --threads 4.

To avoid paying this performance penalty unconditionally, the scheduling
is only adjusted if either:
1. The input contains a statically known #0 delay
2. The input contains a variable #x delay unknown at compile time

If no #0 is present, but #x variable delays are, a ZERODLY warning is
issued advising the use of '--no-runtime-zero-delay' which is a promise
by the user that none of the variable delays will evaluate to a zero
delay at run-time. This warning is turned off if '--runtime-zero-delay'
is explicitly given. This is similar to the '--timing' option.

If '--no-runtime-zero-delay' was used at compile time, then executing
a zero delay will fail at runtime.

A ZERODLY warning is also issued if a static #0 if found, but the user
specified '--no-runtime-zero-delay'. In this case the scheduling is not
adjusted to support #0, so executing it will fail at runtime. Presumably
the user knows it won't be executed.

The intended behaviour with all this is the following:

No #0, no #var in the design (#constant is OK)
-> Same as current behaviour, scheduling not adjusted,
   same code generated as before

Has static #0 and '--no-runtime-zero-delay' is NOT given:
-> No warnings, scheduling adjusted so it just works, runs slow

Has static #0 and '--no-runtime-zero-delay' is given:
-> ZERODLY on the #0, scheduling not adjusted, fails at runtime if hit

No static #0, but has #var and no option is given:
-> ZERODLY on the #var advising use of '--no-runtime-zero-delay' or
   '--runtime-zero-delay' (similar to '--timing'), scheduling adjusted
   assuming it can be a zero delay and it just works

No static #0, but has #var and '--no-runtime-zero-delay' is given:
-> No warning, scheduling not adjusted, fails at runtime if zero delay

No static #0, but has #var and '--runtime-zero-delay' is given:
-> No warning, scheduling adjusted so it just works
2026-02-14 16:42:38 +00:00
Geza Lore 3dd2b762e7
Fix scope tree in traces in hierarchical mode (#7042) 2026-02-12 20:54:03 -05:00
Yilou Wang 9b1b9a5b3b
Fix randc cyclic behavior broken with constraints (#7029) (#7035) 2026-02-12 10:58:04 -05:00
Igor Zaworski 446bec3d1a
Fix event triggering (#6932) 2026-02-11 10:35:59 -08:00
Yilou Wang 22dc437dbb
Support std::randomize() for queue, dynamic array, and associative array variables (#7044) 2026-02-10 18:24:25 -08:00
Geza Lore 6100c39764
Internals: Assign trace codes starting from zero (#7007)
Use uint32_t max value instead of zero as sentinel value for a trace
code being unassigned. Prep for follow on patch.

Note the actual trace file will still start codes from one, the codes
in the model are just an offset from the base code.
2026-02-07 14:01:53 +00:00
Wilson Snyder 1dd80996cd Fix some error capitalization 2026-02-03 19:57:23 -05:00
Christian Hecken a778870e69
Internals: Optimize VerilatedVpioVarBase::m_fullname (#6993) 2026-02-03 17:36:00 -05:00
Wilson Snyder f9c76e84a6 Fix purity of backtrace, from bb979a00 2026-02-02 22:47:24 -05:00
Wilson Snyder 0fcc68e4b8 Fix MSVC backtrace, from bb979a00 2026-02-02 21:00:56 -05:00
Wilson Snyder bb979a00c8 Fix `$stacktrace` to decode through internal-c++filt (#6985). 2026-02-02 19:01:24 -05:00
Rodrigo Batista de Moraes c1e343d9cf
Fix variable randomization to better differ by seed (#6945) (#6956) 2026-02-01 14:53:33 -05:00
Geza Lore 5e5dcdbdbd
Optimize right shifts as clean (#6981) 2026-02-01 08:12:18 -05:00
Geza Lore f0afcede10
Internals: Use pure expressions in V3Randomize (#6974) 2026-02-01 05:09:19 +00:00
Yangyu Chen 5b84635bde
Add VerilatedContext::useNumaAssign and set on threads() call (#6954) 2026-01-27 11:05:28 -05:00
Wilson Snyder 7c6c6a684b Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
Vikash Patel ea9752ab43
Fix typo in Verilator report output ("alloced" → "allocated") (#6937) 2026-01-19 08:31:22 -05:00
Wilson Snyder 50b6954cfc Internals: cppcheck cleanups 2026-01-17 23:18:09 -05:00
Srinivasan Venkataramanan 6fc9089a77
Support `unique` constraints (on 1D static arrays) (#6810) (#6878) 2026-01-16 08:42:09 -05:00
Christian Hecken 8b2144a9db Fix memory leak in vpi_put_value and vpi_get_value
PR #6704 introduced the getForceControlSignals function to
verilated_vpi.cpp. It returns a pair of vpiHandles. These handles were
not released, causing a memory leak. This commit fixes this, in addition
to other minor changes for speed and readability that did not make it
into #6704.

No functional change intended.
2026-01-15 01:08:27 +01:00
Wilson Snyder 823c53fb15 Fix assignment of queue from unpacked array (#6906).
Fixes #6906.
2026-01-12 18:32:24 -05:00
Yilou Wang 31f8be0b85
Support detailed failure info for constraint violations (#6617) (#6883)
* logging for the unsatisfied constraints

* Apply 'make format'

* fix teh quote error in the array indexing

* Apply 'make format'

* Len change for the hash for randomity when named assertion is used

* seperate name assertion and satisfied case

* Apply 'make format'

* simply comments and display info

* refine code and fix protect case

* format

* update display in test and .out file

* add an enable flag and warning type, add a protect_id version test and update out files

* Apply 'make format'

* simplify some comments

* update out file, ready to be merged.

* update .py file to set the hash key solid

* rename and reformate the warning message to follow the verilator style

* add a nowarn test

* Apply 'make format'

* ordering

---------

Co-authored-by: Udaya Raj Subedi <075bei047.udaya@pcampus.edu.np>
Co-authored-by: github action <action@example.com>
2026-01-12 15:53:49 +01:00
Christian Hecken 338afff23c Support vpi_put/vpi_get forcing of signals (#5933) (#6704). 2026-01-10 03:48:46 -05:00
Wilson Snyder c75fb4cdae Improve format of runtime errors, especially DIDNOTCONVERGE 2026-01-08 01:01:54 -05:00
Yangyu Chen 2ba96536e6
Add VERILATOR_NUMA_STRATEGY environment variable (#6826) (#6880)
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
2026-01-06 10:20:57 -05:00
Wilson Snyder 13327fa9c0 Copyright year update. 2026-01-01 07:22:09 -05:00
Kaleb Barrett aa94219531
Support vpiSigned (#6868) (#6870) 2025-12-29 20:12:19 -05:00
apocelipes c35dde7c9c
Fix missing include on FreeBSD (#6864) 2025-12-27 10:17:03 -05:00
Aliaksei Chapyzhenka 3b0db630c1
Support SystemC time resolution with step 10/100 (#6633) (#6715) 2025-12-09 19:34:29 -05:00
Christian Hecken 9a23711ff9
Fix stale pointers in VerilatedImpData::m_hierMap (#6726) 2025-12-07 15:42:29 -05:00
Wilson Snyder 040484cc3f Fix extern function that returns parametrized class (#4924). 2025-12-06 16:16:06 -05:00
Wilson Snyder 2f4b178957 Support parsing only of covergroup.option.option_name 2025-12-04 21:55:55 -05:00
Geza Lore 60fe2c873c
Optimize trace initialization code size (#6749) 2025-12-02 07:19:45 -05:00
Yilou Wang f4654a451b
Support array reference arguments into 'std::randomize()' (#6384) (#6719) 2025-11-26 15:50:24 +03:00
Geza Lore 6a83112380 Internals: Fix minor macOS issues 2025-11-23 11:04:51 +00:00
Geza Lore ea9cc0e4c1
Set runtime worker thread stack sizes on macOS (#6721)
The default stack size of secondary thread on macOS is 512k, which is
too small even to run some of the tests. Unfortunately changing the
thread size must happen via `pthred_create` attributes, which are not
available via the c++ threading APIs. Use pthreads directly on macOS,
and set the worker thread sizes to the same as the main thread stack.
2025-11-22 20:13:46 -05:00
Jakub Wasilewski 0b8c369740
Add `sc_biguint` pragma (#6712) 2025-11-20 17:08:59 -05:00
Wilson Snyder 382d90e03e Makefile: Hide deplist echo 2025-11-16 17:16:14 -05:00
Yilou Wang 048c97f0ae
Support `std::randomize(){...}` (#4706) (#6573) 2025-11-14 14:32:01 -05:00
Wilson Snyder 5c0ad5bd1f
Internals: cppcheck fixes. No functional change. (#6687) 2025-11-12 18:54:22 -05:00
Geza Lore 107776f324
Optimize repeated function call during symbol table init (#6665) 2025-11-08 16:48:00 -05: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 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 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
Geza Lore 0b0e103fde Fix ccache-report with PCH files 2025-11-07 09:41:23 +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
Krzysztof Bieganski 0eaa9ed144
Fix `--timing` with `--x-initial-edge` (#6603) (#6631)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-11-03 09:39:23 -05:00
Geza Lore d3ca79368c
Internals: Replace AstMTaskBody with AstCFunc(#6280) (#6628)
AstMTaskBody is somewhat redundant and is problematic for #6280. We used
to wrap all MTasks in a CFunc before emit anyway. Now we create that
CFunc when we create the ExecMTask in V3OrderParallel, and subsequently
use the CFunc to represent the contents of the MTask. Final output and
optimizations are the same, but internals are simplified to move
towards #6280.

No functional change.
2025-11-03 06:32:03 +00:00
Wilson Snyder 1d69c18e33 Internals: Fix verilated.mk duplicate rule 2025-11-01 23:22:08 -04:00
Wilson Snyder 8750cdac73 Update UVM 1800.2 2017-1.1 waivers 2025-11-01 16:34:31 -04:00