verilator/include
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
..
fstcpp Support new FST writer API (#6871) (#6992) 2026-05-12 07:39:43 -04:00
vltstd Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
.gitignore Support VPI product info, warning calls, etc, bug588. 2013-01-17 21:40:37 -05:00
AGENTS.md CI: Autoformat markdown files 2026-06-15 17:44:50 -04:00
verilated.cpp Support $assertcontrol control_type from lock to kill (#7788) 2026-06-17 07:17:39 -04:00
verilated.h Support $assertcontrol control_type from lock to kill (#7788) 2026-06-17 07:17:39 -04:00
verilated.mk.in Support new FST writer API (#6871) (#6992) 2026-05-12 07:39:43 -04:00
verilated.v Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_config.h.in Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_cov.cpp Support native FSM state and arc coverage (#7412) 2026-04-22 15:18:59 -04:00
verilated_cov.h Support native FSM state and arc coverage (#7412) 2026-04-22 15:18:59 -04:00
verilated_cov_key.h Support covergroups, coverpoints, and bins (#784) (#7117) 2026-06-05 09:35:01 -04:00
verilated_cov_model.h Support covergroup runtime model Phase A1 (#7728) 2026-06-12 11:40:48 -04:00
verilated_covergroup.cpp Support covergroup runtime model Phase A1 (#7728) 2026-06-12 11:40:48 -04:00
verilated_covergroup.h Support covergroup runtime model Phase A1 (#7728) 2026-06-12 11:40:48 -04:00
verilated_dpi.cpp Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_dpi.h Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_force.h Fix force unpacked bitselect (#7744) (#7745) 2026-06-15 21:57:59 -04:00
verilated_fst_c.cpp Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_fst_c.h Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_fst_sc.cpp Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_fst_sc.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_funcs.h Optimize wide decoder case statements into decoder expressions (#7804) 2026-06-19 19:46:13 +01:00
verilated_imp.h Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
verilated_intrinsics.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_probdist.cpp Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
verilated_profiler.cpp Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
verilated_profiler.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_random.cpp Fix biased bit distribution under value < (1 << N) constraints (#7563) (#7684) 2026-05-30 13:00:35 -04:00
verilated_random.h Fix biased bit distribution under value < (1 << N) constraints (#7563) (#7684) 2026-05-30 13:00:35 -04:00
verilated_saif_c.cpp Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_saif_c.h Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_saif_sc.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_save.cpp Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
verilated_save.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_sc.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_sc_trace.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_std.sv IEEE-compliant, fair `std::semaphore` (#7435) (#7605) 2026-05-18 11:11:42 +02:00
verilated_std_waiver.vlt Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_sym_props.h Fix std::unique_ptr with incomplete type for clang (#7501) (#7526) 2026-05-02 12:14:54 -04:00
verilated_syms.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_threads.cpp Fix cpu pinning when no 'core id' present in /proc/cpuinfo (#7599) 2026-05-15 14:45:39 -04:00
verilated_threads.h Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
verilated_timing.cpp Support per-process RNG for process::srandom() and object seeding (#7408) (#7415) 2026-04-13 13:58:53 -04:00
verilated_timing.h Fix `$finish` to immediately stop executing code from non-final blocks (#7213 partial) (#7390). 2026-04-09 17:49:57 -04:00
verilated_trace.h Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_trace_imp.h Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_types.h Support assoc array methods with wide value types (#7680) 2026-06-10 09:39:43 -04:00
verilated_vcd_c.cpp Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_vcd_c.h Fix erroneous implicit conversions of VlWide (#7642) 2026-05-22 20:05:08 +01:00
verilated_vcd_sc.cpp Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_vcd_sc.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilated_vpi.cpp Fix uvm_hdl_release_and_read not reading release value or checking for success (#7425) 2026-04-19 08:24:07 -04:00
verilated_vpi.h Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
verilatedos.h Support printing enum names for %p and %s (#5523) (#7338 repair) (#7521) (#7527) 2026-06-03 14:55:00 -04:00
verilatedos_c.h Support TERMUX (#7559). [Laurent CHARRIER] 2026-05-10 08:20:32 -04:00