Commit Graph

6512 Commits

Author SHA1 Message Date
Wilson Snyder 0e4a3a92b0 CI: Autoformat markdown files 2026-06-15 17:44:50 -04:00
Artur Bieniek 7061c1f04d
Fix not failing assertion when RHS of a range window rejects once (#7773) 2026-06-15 15:32:11 -04:00
Yilou Wang 709c444df3
Internals: Add AGENTS files to guide AI contributions (#7562) (#7765)
Fixes #7562.
2026-06-15 08:42:34 -04:00
Yilou Wang 077558a9b0
Support cover sequence statement (#7764) 2026-06-15 08:36:21 -04:00
Yilou Wang 969a775ae5
Support assertion control system tasks in classes and interfaces (#7761) 2026-06-15 07:33:55 -04:00
Geza Lore a07a980b73 Internals: Do not overload AstVar::isPrimaryIO() for sampled value vars 2026-06-15 09:17:41 +01:00
Geza Lore 5ab2bf1ec4
Optimize input combinational logic by change detection (#7784)
When a lot of combinational logic is driven from top level inputs,
work can be wasted evaluating that logic if the top level inputs don't
change.

This change adds an optimization by performing a change detect on the
top level inputs, and evaluate 'ico' logic only if the top level input
actually changed. This especially helps with --hierarchical/--lib-create
which runs the 'ico' of each sub-model in the eval settle loop.

This was observed to yield 40%+ run-time speedup on some partitioned
designs.

The added change detection is cheap, so it is emitted even if the 'ico'
region is small, and is on by default.

The optimization is only sound if the model itself does not write to the
top level inputs (otherwise the 'previous value' variables would be out
of sync, which are not updated by internal writes.). If we can detect a
top level input is written within the design, then for that input, we
fall back on always running the relevant logic. With --vpi we cannot
prove safety statically, so --vpi will disable this optimisation unless
explicitly enabled. (In which case it's the user's responsibility to not
write to top level inputs via the VPI.)
2026-06-15 05:42:00 +01:00
Wilson Snyder df78db0e73 Fix $fflush and autoflush with --threads (#7782).
Fixes #7782.
2026-06-14 13:36:49 -04:00
Wilson Snyder 12bcf85d33 Internals: Misc V3Life cleanups. No functional change intended. 2026-06-14 13:36:49 -04:00
Geza Lore 77e6a21224 Internals: Inline AstVar::isToggleCoverable()
Inline into the single call site, remove unnecessary isSc() and
isPrimaryIO() guards (these flags are set only in a later pass).

No functional change.
2026-06-14 16:41:13 +01:00
Geza Lore 9a0cd289e8 Fix memory leak in previous patch 2026-06-14 14:53:40 +01:00
Geza Lore b973b1df5a Fix hang in assertion optimization (#7707 repair) 2026-06-14 13:31:59 +01:00
Geza Lore df1b1577d9
Deprecate isolate_assignments attribute (#7774)
As per discussion. Remove the unsound V3SplitAs pass. The
isolate_assignments attribute/directive is now parsed and ignored in the
frontend for compatibility but otherwise have no effect.

Fixes #7144
2026-06-13 19:40:29 +01:00
Geza Lore 7af22422c7
Optimize table lookups in Dfg (#7772) 2026-06-13 08:45:46 +01:00
Geza Lore ba624d7ce1
Optimize away proven redundant case statement assertions (#7771)
This is still mostly refactoring of V3Case, but with functional changes.
Decouple the exhaustiveness/overlap analysis from the decision to
convert the case using the fast bitwise testing method. This enables
dropping the 'notParallel' assertions for those we can prove exhaustive
and unique, even if we decide to convert them using the generic if/else
ladder scheme.
2026-06-13 08:45:26 +01:00
Nick Brereton 87d2610674
Support unpacked struct stream (#7767) 2026-06-12 17:32:01 -04:00
Matthew Ballance e03fa6c783
Support covergroup runtime model Phase A1 (#7728) 2026-06-12 11:40:48 -04:00
Marco Bartoli 5831cc8d46
Fix timed nested fork block with disable (#6720) (#7743)
Fixes #6720.
2026-06-12 10:42:32 -04:00
Nick Brereton 748e48f881
Fix s_eventually in parameterized interfaces (#7741) 2026-06-12 10:41:56 -04:00
Artur Bieniek dab6889f1e
Support assert property 'default disable iff` (#4848) (#7723) 2026-06-12 10:40:38 -04:00
Geza Lore e0c4c995b9 Fix crash on overlapping priority case 2026-06-12 14:37:05 +01:00
Geza Lore 279b425a57
Internals: Cleanup V3Case (#7769) 2026-06-12 14:15:41 +01:00
Ryszard Rozak e6ee6dd106
Fix bounds checks in expressions with read/write references (#7694) 2026-06-12 06:55:06 -04:00
Geza Lore 60f729639b
Fix 'case (_) inside' with x wildcards (#7766)
Found by inspection, case inside used to threat 'x' as a value, not as a
wildcard. Per the standard it should behave as '==?' which treats both
'x' and 'z' as wildcards.
2026-06-12 07:48:36 +01:00
Geza Lore 4555c8b23c
Internals: Cleanup case condition lifting (#7768)
V3Begin used to lift impure case expressions. With V3LiftExpr, this is
now redundant.
2026-06-12 06:38:21 +01:00
Geza Lore 0ee25038ac
Optimize V3Gate inlining heuristic (#7716)
V3Gate used to inline too many expensive operations. One particularly
bad example is inlining `{<<{wide}}` (bit-reverse of a wide signal),
which is a single input node, but is quite expensive to compute, which
we always used to inline.

Change the heuristic to only inline single input nodes if they are not
wide, or a cheap wide operation, otherwise treat them the same as
multi-input ops and inline them only if they are used no more than once.
2026-06-11 20:59:18 +01:00
Geza Lore c7a262b05d
Optimize bit select removal earlier in Dfg (#7762)
Add a simple Dfg pass that removes redundant bit selects early. This
can significantly cut down on downstream work and remove some temporary
variables introduced during synthesis.
2026-06-11 16:00:30 +01:00
Kornel Uriasz 4c92c035e7
Support reduction XOR/AND operations in constraints (#7753) 2026-06-11 09:43:18 -04:00
Yilou Wang c6caa94fe0
Fix no-scope internal error on virtual interface method calls (#7759) 2026-06-11 09:04:06 -04:00
Adam Kostrzewski 394c9bc9b2
Fix FSM detect unchecked casts and variable redeclaration (#7758) 2026-06-11 08:37:23 -04:00
Geza Lore 901909d3c7
Optimize conditional patterns sharing common MBSs/LSBs in DfgPeephole (#7760)
Replace 3 DfgCond patterns with 2 more general ones that convert DfgCond
with common MSBs/LSBs in both branches into a DfgConcat with a narrower
DfgCond. This pattern arises frequently with Dfg synthesis.
2026-06-11 10:52:43 +01:00
Shashvat e2e1bfe8dd
Internals: Remove unused V3TSP (#7194) (#7757) 2026-06-10 18:48:38 +01:00
github action 48008a2fc9 Apply 'make format' [ci skip] 2026-06-10 16:19:51 +00:00
Tracy Narine dc1e9a8ec6
Internals: Fix gcc bison warnings (#7719) (#7756)
Fixes #7719.
2026-06-10 09:18:48 -07:00
Geza Lore d84af81a11
Optimize Dfg with relaxed live variable analysis (#7739)
Relax the live variable analysis performed by Dfg to bail on fewer
cases. This analysis was already conservative (meaning it might think
variables are live when they are not), which is good enough for Dfg use.
This change in particular enables synthesizing more complex logic
involving arrays, e.g. those introduce by V3Table creating lookup
tables.
2026-06-10 15:59:44 +01:00
pawelktk 75993ca9ea
Support assoc array methods with wide value types (#7680) 2026-06-10 09:39:43 -04:00
Yilin Li d1319cf81e
Fix dpi export pointers (#7742) (#7751)
Fixes #7742.
2026-06-10 09:38:41 -04:00
Artur Bieniek 1d29f65eae
Support property case (#7721) 2026-06-08 15:16:30 -07:00
Artur Bieniek a3827182c0
Support `s_until` and `s_until_with` (IEEE1800-2023 16.12.12) (#7722)
Signed-off-by: Artur Bieniek <abieniek@antmicro.com>
2026-06-08 14:08:04 -04:00
Geza Lore 96336395d6 Internals: Simplify V3CfgLiveVariables to work only in scoped mode
No functional change
2026-06-08 17:06:45 +01:00
Geza Lore ece4d71e5b
Optimize CReset in Dfg (#7737)
Teach DFG about CReset. This is not so much to optimize CReset itself, but to enable synthesizing logic involving CReset, which does appear with automatic variables used only in certain branches
2026-06-08 17:01:50 +01:00
Marco Bartoli 2db34818b3
Fix parameter values in coverage bins widths (#7732) (#7734)
Fixes #7732.
2026-06-07 20:47:43 -04:00
Marco Bartoli 4d556dfcc7
Fix s_eventually on interface (#7731) (#7733)
Fixes #7731.
2026-06-07 20:46:00 -04:00
em2machine 680ef8dda9
Fix for HIERPARAM - relax checking (#7570) (#7690) 2026-06-06 11:55:47 -04:00
Geza Lore e35b2429ff Optimize $countones constant in Dfg 2026-06-06 06:11:13 +01:00
Geza Lore ca376d681a Optimize $onehot in Dfg 2026-06-06 06:11:13 +01:00
Geza Lore e53d6d9006 Improve procedural loop unrolling
- Enable unrolling of nested loops when the inner loop updates the
  outer loop condition
- Enable unrolling 'for' loops with break statements
2026-06-06 06:11:13 +01:00
github action e9274be247 Apply 'make format' 2026-06-06 00:44:02 +00:00
Nikolai Kumar bc86701bec
Support forceable on unpacked array variables (#7677) (#7678)
Fixes #7677.
2026-06-05 20:43:06 -04:00
Ryszard Rozak 0851d1fbe5
Fix optimizations of assignments with timing controls (#7718) 2026-06-05 12:21:21 -04:00
Matthew Ballance 2886291eba
Support covergroups, coverpoints, and bins (#784) (#7117)
Fixes #784.
2026-06-05 09:35:01 -04:00
Mateusz Gancarz 7e2fe64ae2
Fix splitting functions containing fork logic (#7717) 2026-06-05 09:32:52 -04:00
Yogish Sekhar 947a08965e
Add hierarchy-aware reporting to `verilator_coverage` (#7657) 2026-06-04 09:32:19 -04:00
Geza Lore 14cf611c72 Internals: Factor out inlining predicate in V3Gate
No functional change.
2026-06-04 09:33:24 +01:00
Nick Brereton 81282c3d57
Fix (const) ref default task argument handling (#7698) 2026-06-03 22:31:21 -04:00
Nick Brereton 4d5393c191
Fix tristate lowering for interface inout ports (#7134 repair) (#7708) (#7710)
Fixes #7708.
2026-06-03 19:51:49 -04:00
Todd Strader 7bd41bfbb9
Fix MULTIDRIVEN in generates (#7709) 2026-06-03 19:50:56 -04:00
Artur Bieniek 72db0b575e
Support if/if-else in properties (#7692) 2026-06-03 15:54:15 -04:00
Nick Brereton bbd8d927ee
Support printing enum names for %p and %s (#5523) (#7338 repair) (#7521) (#7527) 2026-06-03 14:55:00 -04:00
Geza Lore 41811d436f
Optimize runtime assertOn() checks (#7707)
Combine consecutive assertOn() checks into one, and hoist past enclosing
'if' statements if possible. This enables combining a lot of them, which
can be worth 10% performance on some assertion heavy designs depending
on how the assertions are written.
2026-06-03 18:09:49 +01:00
Nick Brereton 1af9c39759
Fix ref-arg type check for packed arrays with differing range directions (#7700) 2026-06-03 12:49:14 -04:00
Igor Zaworski bbf8471c2a
Fix of ignoring not found pruned modules with encoded names (#7706) 2026-06-03 12:19:33 -04:00
Geza Lore 715f5f0c13
Optimize $sformatf into $sformat (#7701)
Turn `x = $sformatf(...)` into `$sformat(x, ...)`. The former requires
checking and running a destructor for `x` at the call site, the later
does it in the callee VL_SFORMAT. This reduces the size of the call
site, which can be significant e.g. in the presence of many assertions.

Also added a rewrite of `$sformat(x, "const-string")` back into `x =
"const-string"` for the cases where the `$sformatf` would have been
folded into a constant string.
2026-06-03 08:43:05 +01:00
Geza Lore efb83c55de
Optimize VL_SFORMAT when result is string (#7702)
Omit unused bit width parameter. Emit rule is simple enough to change
and the unused parameter just bloats code size.
2026-06-03 08:42:48 +01:00
Geza Lore 970e7983d3
Optimize $sformat in V3Life (#7703)
Treat AstSFormat as a special form of assignment in V3Life. This allows
eliminating earlier redundant assignments to strings when an $sformat
later sets the string. UVM has lot of these.
2026-06-03 08:41:58 +01:00
Geza Lore 0026a73ca0
Optimize DPI import argument passing (#7704)
Pass inputs to DPI import wrappers by reference (unless fits in a
register). This eliminates a lot of temporary constructors/destructors.
2026-06-03 08:41:33 +01:00
Krzysztof Bieganski 7664bbb3ef
Support generic interface arrays (#7604) 2026-06-02 22:28:50 -04:00
Igor Zaworski fe4adfe273
Support process::self().srand() (#7695) 2026-06-02 12:00:27 -04:00
Kamil Danecki 802efd579a
Fix t_class_param type invalid array access (#7615 repair) (#7653) (#7693) 2026-06-02 09:01:05 -04:00
Geza Lore c079aa0b17
Optimize wide conditional expansion in V3Premit (#7691)
V3Premit extracts wide sub-expressions via temporaries, which is needed
for emitting wide operations to C++ (calls to `VL_*_W`). The previous
version used to extract both branches of an AstCond unconditionally,
meaning both branches were fully evaluated. Rewriting the AstCond into
an AstIf instead enables evaluating only the required branch. While
this does limit V3Subst, overall the resulting code is ~3% faster,
and contains ~25% fewer branches on a large design.
2026-06-01 20:25:41 +01:00
Yilou Wang 39b9901032
Support weak `until` / `until_with` property operators (#7290) (#7548) (#7685)
Fixes #7290. Fixes #7685.
2026-06-01 14:50:13 -04:00
Wilson Snyder 72ed55b180 Support strength on buf/not 2026-05-31 08:54:29 -04:00
github action e2063e7ac0 Apply 'make format' 2026-05-30 19:36:22 +00:00
Muzaffer Kal 57fa98e52c
Fix TSP variable ordering for mtasks (#5342) (#7610)
Fixes #5342
2026-05-30 15:35:12 -04:00
Wilson Snyder 2ccaae77ae Fix CONTASSINIT false positive on wire inside two different instantiations
Fixes #7640.
2026-05-30 15:23:02 -04:00
Nick Brereton 125bdb45f5
Support pre/post increment/decrement inside && and || (#7683) 2026-05-29 19:51:27 -04:00
Geza Lore 9455dddab4
Optimize if branches with same trailing statements (#7674)
If the same statements appears in both branches of an 'if', put a single
copy after the 'if', apply recursively. This also has the effect of
getting rid of conditionals with identical branches, but is more widely
applicable.
2026-05-29 11:26:07 +01:00
Nick Brereton 5d344ab8ff
Fix parameter read through locally-declared interface instance (#7679) 2026-05-28 21:20:49 -04:00
em2machine 3d126b77cd
Fix for access to parameters via class::localparam (#7609) (#7671) 2026-05-28 17:40:18 -04:00
Zubin Jain 77f0883b06
Fix forceable signal with a procedural continuous assign (#7638) (#7639) 2026-05-28 16:03:27 -04:00
Geza Lore 557dda3396
Fix AstNodeFTaskRef equivalence check (#7673) 2026-05-28 20:33:41 +01:00
Artur Bieniek 45fae00064
Fix width of unsized literal in property expression (#7668) 2026-05-28 15:10:25 -04:00
Geza Lore 55d78b225d
Fix signing off new MULTIDRIVEN warnigns on variable (#7672) 2026-05-28 13:34:36 -04:00
Artur Bieniek 3a91b333c3
Fix loss of events due to bit shift (#7670) 2026-05-28 12:45:18 -04:00
Pawel Kojma 70045433c9
Fix reserved keywords reaching emitter (#7666) 2026-05-28 10:04:14 -04:00
github action 3bc7021211 Apply 'make format' 2026-05-28 11:21:07 +00:00
Cookie b5555a032e
Internals: clean up for redundant m_alwCombFileLinep and m_nodeFileLinep variables (#7665) 2026-05-28 07:20:06 -04:00
em2machine 29d2f522bf
Fix internal error when handling typedefs containing parameterized class type members (#7635) (#7661)
Fixes #7635.
2026-05-27 12:17:49 -07:00
github action 62f475709f Apply 'make format' 2026-05-27 12:35:09 +00:00
Cookie 8ae0e48103
Fix false MULTIDRIVEN warning on always_ff variables (#7351) (#7621) 2026-05-27 08:34:11 -04:00
Nikolai Kumar cd532e0e79
Fix dropped iff guard on clocking inside task (#7658) (#7659)
Fixes #7658
2026-05-27 00:24:54 -07:00
github action 99a35fee83 Apply 'make format' 2026-05-26 16:21:12 +00:00
Cookie 9460501221
Add NOTREDOP error on reduction and negation operators (#7417) (#7623) (#7624) 2026-05-26 12:20:15 -04:00
Cookie 9e2fedee6f
Fix ALWCOMBORDER on variable ordering (#7350) (#7608) 2026-05-26 06:40:55 -04:00
em2machine a2d4b90b52
Fix dearray varref scope error (#7530) (#7602)
Fixes #7530.
2026-05-25 17:48:31 -04:00
Yilou Wang 86799ace5d
Fix wrong false assert for property local variables with cycle-delayed consequents (#7587) (#7651)
* Fix wrong false assert in property local variable with cycle-delayed consequent

* factor helper for 100 line cov

* add return, should be 100 line cov now
2026-05-25 20:13:27 +08:00
Yogish Sekhar cf8713aebc
Add `--coverage-per-instance` 2026-05-24 18:08:55 -04:00
Yogish Sekhar 4fbb8bf43b
Fix hierarchical coverage counts for duplicate no-inline module instances (#7649) 2026-05-24 11:42:42 -04:00
Yilou Wang 6c96ce4b40
Fix inherited rand array with .size + foreach constraint (#7650)
Fixes #7558.
2026-05-24 09:02:01 -04:00
Geza Lore f93b4bbd05
Internals: Remove 'VlWide::operator bool()' (#7652)
This was a fudge to work around using VlWide in `if` conditions without
a `_ != 0` check. That check is actually inserted by V3Width (or an
equivalent reduction), so the offending code was only generated
internally. Hopefully fixed the single instance where this really
happened. (If not, C++ will fail to compile with "cannot convert VlWide
to bool in 'if (__HERE__)'" errors, still better than the old version
which used to silently not do the right test due to incorrect implicit
conversions.)
2026-05-24 13:09:31 +01:00