Commit Graph

9843 Commits

Author SHA1 Message Date
Geza Lore e1f1a50327 Fix assertion when loop unrolling failed (#7810)
Partial fix for #7810
2026-06-21 10:28:23 +01:00
Igor Zaworski e269b914b2
Support NBAs in initial blocks (#7754) 2026-06-20 17:23:05 -04:00
Wilson Snyder 047d6e03d9 Tests: Add t_sys_file_scan_delay (#4811) 2026-06-20 07:47:44 -04:00
Wilson Snyder 78d96d23ee Commentary (#7809) 2026-06-20 06:45:51 -04:00
Wilson Snyder d66f96e246 Commentary: Changes update 2026-06-20 06:45:04 -04:00
Geza Lore 9a231d254d
Optimize Dfg cycle breaking to do less work (#7210)
When a vertex is made acyclic, conservatively update the SCC map to
propagate and mark connected vertices as acyclic as much as possible.
This way we can stop early if the graph becomes acyclic after some
fixups. This can significantly reduce the number of fixups needing to be
applied, avoiding introducing redundancy.
2026-06-19 22:28:50 +01:00
Geza Lore a37e2ee94b
Optimize wide decoder case statements into decoder expressions (#7804)
Extend the decoder-pattern case optimization to selectors that are too
wide for a full 2^width lookup table. A decoder-pattern case (where
every case item assigns constants to a fixed set of LHSs) is lowered to
a new AstMachMasked expression. AstMachMasked is emitted as a run-time
VL_MATCHMASKEd_* function call. It contains a packed constant pool table,
'matchp', which is a list of '(mask, bits)' pairs. At runtime, the index of the 
first matching entry is returned, and is used to index a value table. This single
(albeit complicated) expression can replace large if-else trees whole, resulting
in much more compact code with fewer static hard to predict branches. It
is worth about 10% speed and 30% code size in some designs.

Example:

```systemverilog
    logic [39:0] sel;
    always_comb
      casez (sel)
        40'b???????????????????????????????????????1: out = 8'h01;
        40'b??????????????????????????????????????1?: out = 8'h02;
        40'b?????????????????????????????????????1??: out = 8'h03;
        default:                                      out = 8'hff;
      endcase
```

is compiled to:

```c++
    out = TABLE_value[VL_MATCHMASKED_Q(sel, CONST_match)];
```

Where 'CONST_match' contains 4 entries, of a 40-bit mask and 40-bit bit
pattern each, and 'TABLE_value' contains 4 entries of the corresponding
8-bit results. (Entries are aligned to word boundaries to avoid runtime
bit swizzling)
2026-06-19 19:46:13 +01:00
Yilou Wang 59fba72cb6
Support method calls on a sub-interface via a virtual interface (#7800) 2026-06-19 08:41:48 -04:00
Wilson Snyder 749b93e405 Commentary: Use standard multiline rst comments, other cleanups 2026-06-18 21:58:01 -04:00
Wilson Snyder 50c15f3705 Commentary: Changes update 2026-06-18 21:56:02 -04:00
Yilou Wang 129cfc19c0
Fix cross-hierarchy tristate drivers of interface nets (#7339) (#7801)
Closes #7339.
2026-06-18 19:07:37 -04:00
Artur Bieniek 51022d6152
Tests: Fix unstable --vltmt test (#7803)
Fixes #7803.
2026-06-18 14:40:54 -04:00
Yilou Wang a5a16cfbfd
Support unbounded always [m:$] and strong s_always liveness (#7798) 2026-06-18 11:17:09 -04:00
Yilou Wang 22b45f0fd7
Fix randomize() with skipping derived pre/post_randomize (#7799) 2026-06-18 11:04:57 -04:00
Geza Lore 5712f9b614
Optimize decoder case statements into lookup tables (#7795)
Recognize "decoder" case statements (where every case item only assigns
constants to a fixed set of left-hand sides) and replace them with a
single packed constant lookup table indexed by the case expression.
Small tables are materialized inline in the generated code, and are
always optimized. Larger ones are placed in the constant pool and only
optimized if deemed beneficial over branches.

While this slightly conflicts with V3Table, and is not worth that much
on it's own, there will be a follow up patch that converts more cases of
this form which will be much more valuable. This patch does the
necessary analysis and the simple table conversion when possible.

Split -fcase into -fcase-table (this new conversion) and -fcase-tree (the
existing bitwise branch-tree conversion); -fno-case is now an alias for
both.

Default branches, assignments preceding the case (used as default values),
casez wildcards, multiple and partial left-hand sides, and both blocking and
non-blocking assignments are handled. Cases that cannot be safely tabled (e.g.
non-exhaustive with no default, overlapping writes to one variable, or mixed
blocking/non-blocking assignments) fall back to the existing if/else lowering.

Consequently disabled re-inlining of constant pool variables in V3Const,
and rebuild the constant pool hash in V3Dead (previously we didn't
create constant pool entries early enough for this to matter)
2026-06-18 09:30:50 +01:00
Yilou Wang 3a4377d39e
Support clocking event on a sequence declaration body (#7598) (#7793)
Fixes #7598.
2026-06-17 17:57:18 -04:00
Nick Brereton 26c85d4495
Fix `$bits` on unpacked structs (#4521) (#7796)
Fixes #4521.
2026-06-17 17:56:48 -04:00
Tracy Narine 4c5e104825
Internals: Remove bad cmake file reference (#7794) 2026-06-17 12:12:25 -04:00
Geza Lore f11c4084d1 Internals: Minor cleanup of case statement lowering
- Factor out match mask construction
- Rename V3Number method to reflect behaviour
2026-06-17 14:39:06 +01:00
Yilou Wang b581f73843
Support $assertcontrol control_type from lock to kill (#7788) 2026-06-17 07:17:39 -04:00
em2machine a534a1d1bc
Fix parameter pollution when using class parameters (#7711) (#7763)
Fixes #7711.
2026-06-16 14:03:28 -04:00
Ryszard Rozak 792008514b
Fix randomization of dynamic arrs of objects (#7790) 2026-06-16 12:19:00 -04:00
Yilou Wang bec45125bd
Fix `cover property` of an implication counting vacuous matches (#7789) 2026-06-16 11:52:35 -04:00
Jakub Michalski 38fd99b37b
Fix out-of-bounds read value for 2-state types (#7785)
Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2026-06-16 09:21:11 +01:00
Nikolai Kumar a5fad9882f
Fix force unpacked bitselect (#7744) (#7745)
Fixes #7744.
2026-06-15 21:57:59 -04:00
Wilson Snyder 0e4a3a92b0 CI: Autoformat markdown files 2026-06-15 17:44:50 -04:00
Wilson Snyder c86816476c Commentary: Changes update 2026-06-15 17:37:49 -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 0233e5044c
Tests: Restore Antmicro copyright on test files accidentally overwritten (#7786) 2026-06-15 08:56:34 -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
Wilson Snyder c6a5255ea0 Tests: Disable unstable --vltmt tests (#7779) (#7780) (#7781) 2026-06-13 22:07:18 -04:00
Wilson Snyder 44bd8a0c14 Commentary: Changes update 2026-06-13 22:07:14 -04: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
Wilson Snyder 64d680c9ba
CI: Ubuntu 26.04 (#7776) 2026-06-13 08:40:36 -04: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