verilator/docs/guide
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
..
figures Verilator_gantt now shows the predicted mtask times, eval times, and additional statistics. 2021-09-23 22:59:36 -04:00
changes.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
conf.py Commentary: Changes update 2026-04-23 00:44:50 -04:00
connecting.rst Commentary (#7532) (#7533) 2026-05-04 18:01:55 -04:00
contributing.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
contributors.rst Commentary 2026-02-04 18:09:51 +00:00
control.rst Deprecate isolate_assignments attribute (#7774) 2026-06-13 19:40:29 +01:00
copyright.rst Commentary 2026-04-25 11:41:30 -04:00
deprecations.rst Deprecate `--structs-packed` (#7222). 2026-03-21 10:59:27 -04:00
environment.rst Commentary: Changes update 2026-06-05 18:36:55 -04:00
example_binary.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
example_cc.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
example_common_install.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
example_dist.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
example_sc.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
examples.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
exe_sim.rst Add `+verilator+log+file` (#4505) (#7645) 2026-05-27 14:33:19 -04:00
exe_verilator.rst Optimize decoder case statements into lookup tables (#7795) 2026-06-18 09:30:50 +01:00
exe_verilator_coverage.rst Commentary: Changes update 2026-06-05 18:36:55 -04:00
exe_verilator_gantt.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
exe_verilator_profcfunc.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
executables.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
extensions.rst Deprecate isolate_assignments attribute (#7774) 2026-06-13 19:40:29 +01:00
faq.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
files.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
index.rst Docs: Split control.rst from exe_verilator.rst. 2026-02-24 21:11:39 -05:00
install-cmake.rst Commentary (#7428) (#7432) 2026-04-15 17:45:48 -04:00
install.rst Commentary: Changes update 2026-05-30 15:16:41 -04:00
languages.rst Commentary: Changes update 2026-06-05 18:36:55 -04:00
overview.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
simulating.rst Support covergroups, coverpoints, and bins (#784) (#7117) 2026-06-05 09:35:01 -04:00
verilating.rst Commentary 2026-04-25 11:41:30 -04:00
warnings.rst Deprecate isolate_assignments attribute (#7774) 2026-06-13 19:40:29 +01:00