Commit Graph

226 Commits

Author SHA1 Message Date
Wilson Snyder c507dcf610 Internals: Enforce types on C++ enums. No functional change intended. 2026-05-22 17:59:57 -04:00
Geza Lore c99aa8ede5
Fix erroneous implicit conversions of VlWide (#7642)
Change WDataInP/WDataOutP to be opaque handles types instead of aliases
to raw pointers. This subsequently eliminates needing an implicit cast
operator in VlWide, which is replaced with implicit constructors of
WDataInP/WDataOutP that can create a handle from a VlWide. This
eliminates some unsafe conversions that the previous implicit cast
operator unintentionally enabled (e.g. #7618). It also eliminates
having to insert ".data()" in various places int he generated code, which
simplifies internals (the only place ".data()" should be needed is in
calls to variadic functions where the expected type of the argument is
not WDataInP/WDataOutP).

The handles otherwise behave like pointers, implementing the minimal
amount of operators required to code the runtime. The handle is still
only a single pointer, and will be passed in registers as before, so
this patch should be performance neutral.

As part of this removed WData, which used to be an alias for EData.
All uses are now either EData*, WDataInP, WDataOutP, or VlWide directly.
2026-05-22 20:05:08 +01:00
Yilou Wang f9427c6d5f
Support property abort operators (accept_on, reject_on) (#7578) 2026-05-15 08:38:38 -04:00
Wilson Snyder 18e06b1e7d Fix display of %m in non-first argument (#7574).
Fixes #7574.
2026-05-11 08:18:34 -04:00
Yilou Wang b0d58bbcef
Support SVA goto repetition with range `[->M:N]` (#7569) 2026-05-11 07:07:51 -04:00
Yilou Wang 8eca6b8fe7
Fix regression rejecting boolean `!x` inside sequence expressions (#7549) (#7551)
Fixes #7549.
2026-05-08 18:34:28 -04:00
Yogish Sekhar 22db9d2c66
Add mnemonic to parameter constants in JSON for FSM Coverage (#7531) 2026-05-06 07:25:03 -04:00
Bartłomiej Chmiel 4e349971d3
Support `s_eventually` (#7291) (#7508) 2026-05-04 09:57:03 -04:00
Yilou Wang bc1acc8aa3
Support followed-by operators `#-#` and `#=#` in properties (#7523) 2026-05-04 08:10:37 -04:00
Kamil Danecki 659274e45d
Fix array indexing side effects in compound assignments (#7519) 2026-05-01 20:35:51 -04:00
Igor Zaworski 25d4827bd5
Internals: Four state pre-pull (types) (#7520) 2026-04-30 16:56:15 -04:00
Yilou Wang 327fc4ffbe
Support randomize() with (identifier_list) {constraint_block} (#7486) (#7507)
Fixes #7486.
2026-04-28 06:10:53 -04:00
Yilou Wang c8893b64de
Support `always` / `always[m:n]` / `s_always[m:n]` property operators (#7482) 2026-04-27 08:20:34 -04:00
Geza Lore 3149f43372
Internals: Add special Dfg vertex for replication (#7471) 2026-04-23 10:14:27 +01:00
Yilou Wang 51eb5346c8
Support sequence within operator (#7461) 2026-04-23 05:47:24 +02:00
Geza Lore 496665800d
Internals: Annotate AstNode classes to generate matching DfgVertex (#7469)
Explicitly annotate those AstNodeExpr subclasses that should have a
corresponding DfgVertex subclass generated by astgen. This avoids having
to tweak things in Dfg when adding new AstNode subclasses, which can
then be handled separately.
2026-04-22 16:35:07 +01:00
Yilou Wang 935b2564eb
Use NFA in SVA pass (V3AssertNfa: NFA-based multi-lcycle SVA evaluation engine) (#7430) 2026-04-20 07:43:18 +02:00
Ryszard Rozak ba508c00d2
Support `until_with` property (#7290 partial) (#7436) 2026-04-17 06:33:36 -04:00
Todd Strader 7f571971ca
Optimize trace code for faster compiles on repeated types (#6707) (#6832) 2026-04-14 19:16:21 -04:00
Ryszard Rozak 4da31b0418
Support 'until' property (partial #7290) (#7399) 2026-04-10 08:17:54 -04:00
Yilou Wang 854e80c3c2
Support nonconsecutive repetition [=N] in sequence expressions (#7397) 2026-04-09 18:28:28 -04:00
Yilou Wang e63c4f563e
Support consecutive repetition [*N:M], [+], and [*] in sequence expressions (#7379) 2026-04-08 10:26:03 -04:00
Yilou Wang 141fe8bdad
Support sequence intersect operator (#7374) 2026-04-08 09:31:54 +02:00
Yilou Wang dfb7b034a5
Support sequence 'throughout' operator (#7378) 2026-04-06 17:12:22 -04:00
em2machine e7a644a3fc
Fix functions in generate block resulting in "Broken link in node" (#7236) (#7367)
Fixes #7236
2026-04-03 11:19:17 -04:00
Yilou Wang bf453361f6
Support consecutive repetition [*N] in SVA properties (#7311) 2026-03-30 07:01:33 -04:00
Wilson Snyder 31757df229
Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
Yilou Wang 55e5f01758
Support SVA goto repetition [->N] in concurrent assertions (#7310) 2026-03-27 10:31:15 -04:00
Yilou Wang 0b2bf991a6
Support boolean and/or in sequence expressions (#7285) 2026-03-24 08:56:14 -04:00
Igor Zaworski 331cac2054
Internals: Four-state pre-pull cleanup (#7281) 2026-03-20 12:11:22 -04:00
Wilson Snyder 602ee384de
Support $sformat with runtime format string (#7212). (#7257)
Fixes #7212.
2026-03-14 22:43:56 -04:00
Wilson Snyder 08c6d5bde5 Improve some display error handling (#7212 prep) 2026-03-12 07:49:21 -04:00
Yilou Wang 3bc73cc768
Support constraint imperfect distributions (#6811) (#7168) 2026-03-03 11:23:14 -05:00
em2machine 5821d0697c
Fix interface localparam dependencies and arbitrary nesting (#6936) (#7128) 2026-03-03 06:55:59 -05:00
Geza Lore 77ce9cec1e
Optimize conditional merging across some impure statements (#7159)
- Allow reordering pure statements with DPI import calls iff no public
  variables (including those read via a DPI export) are involved. This
  ensures the DPI import can't observe the reordering
- Allow reordering of pure statements with AstDisplay and AstStop. This
  requires an assumption that AstDisplay and AstStop will not read or
  write model state other than via a VarRef explicitly present int the
  Ast.
Overall this allows eliminating a lot of conditionals around assertions,
which were previously not possible.
2026-03-01 05:47:05 -05:00
Geza Lore 098fe96643
Add V3LiftExpr pass to lower impure expressions and calls (#7141)
Introduce new pass that converts impure expressions, or those with
function and method calls into simple assignment statements. Please see
the blurb at the top of the file why this is useful and how it works.
In particular currently it enables more Dfg optimization as functions
will be inlined without AstExprStmt.

Ideally we should enforce this lowering is applied to every procedural
statement (there are still a handful of exceptions). With that, long
term with this pass + #6820, there should be no need to ever use an
AstExprStmt past this new lowering pass, which should enable more easier
optimization down the line.

Also ideally this should be run earlier. Currently it's after V3Tristate
as that calls pinReconnectSimple so we don't have to touch Cell ports.

Currently disabled when code coverage is enabled due to #7119.
2026-02-28 22:20:09 +00:00
Geza Lore f7c5454d91
Internals: Strengthen AstNodeExpr operand types (#7138) 2026-02-23 20:55:08 +00:00
Geza Lore 1e5a6901c8
Internals: Make AstWith explicit in AstCMethodHard (#7129)
This makes it consistent with other usage in NodeFTaskRef. Also AstWith
is no longer a NodeExpr.
2026-02-22 15:38:28 -05:00
Geza Lore da51021b0a
Internals: Simplify AstForeach header handling (#7126)
Rename AstSelLoopVars to AstForeachHeader, and make it a non-NodeExpr.
Tweak parser to always create an AstForeachHeader, so no need to fix it
up later.
2026-02-22 18:57:12 +00:00
Geza Lore 350966de6b
Internals: Remove all AstClassOrPackageRef in V3Width (#7125) 2026-02-22 11:26:44 -05:00
Geza Lore 579acced99
Internals: Make AstArg into an AstNode, not Expr (#7122) 2026-02-22 14:40:51 +00:00
Geza Lore 78ee787bb1
Internals: Clean up AstArg usage in AstNodeFTaskRef (#7121)
- Strengthen type of AstNodeFTaskRef::pinsp to be List[AstArg]
- Rename 'pinsp' to 'argsp'
- Add default constructor arguments
2026-02-22 10:38:37 +00:00
Geza Lore e023113b79
Internals: Carry 'with' clause as op4 on AstNodeFTaskRef (#7114)
op4 is now available to carry the 'with' clause explicitly instead of
being part of the argument lit. Will strengthen 'pinsp' to be
List[AstArg] next.
2026-02-22 09:15:28 +00:00
Geza Lore 52a6de29cb
Internals: Remove unused AstNodeFTaskRef::namep() (#7110) 2026-02-20 10:52:54 -05:00
Wilson Snyder 0d2fcfd49d Fix circular class reference %p-printing causing infinite recursion (#7106).
Fixes #7106.
2026-02-19 20:15:37 -05:00
Srinivasan Venkataramanan 7c1b348b41 Support `$get_initial_random_seed` (#7056) (#7069).
Fixes #7056.
2026-02-16 05:57:44 -05:00
Geza Lore a0b89dde8e
Internals: Make AstCAwait an AstNodeStmt (#6280) (#7078)
AstCAwait is only ever uses in statement position, so model it as a
statement. We should never ever have a coroutine that returns a value.
There is no need for it in SV, nor should we rely on it for internals.

Also reworks the fix for V3Life incorrectly constant propagating the
beforeTrig functions (#7072). The property that upsets V3Life is that
a function:
1. Is called from multiple static call sites (multiple AstCCall)
2. Reads model state directly (AstVarRef to non-locals/arguments)

Such function can only be created internally after scheduling (V3Task
throws an unsupported error on a non-inlined function that reads model
state), so added a flag to AstCFunc to mark the dangerous ones for
V3Life.
2026-02-14 20:15:32 +00:00
Igor Zaworski 7d71c3bb76
Fix of event triggering with V3Life (#6932 effect) (#7068 partial) (#7072) 2026-02-13 11:01:19 -05:00
Wilson Snyder bbb231dfe2 Internals: Minor cleanups preparing for initialization fixes. No functional change. 2026-02-07 14:16:12 -05:00
Pawel Kojma 9a8538fafa
Support signed multiplication in constraints (#7008) 2026-02-06 10:14:54 -05:00