verilator/docs/guide
Rahul Behl 893589f444 Support array reduction methods with 'with' clause in constraints
Fixes #6455

This commit adds support for array reduction methods (sum, product, and, or, xor)
with 'with' clauses in randomization constraints. Previously, expressions like
'array.sum() with (int'(item == value))' were not supported in constraints.

Implementation details:
- Added handler in ConstraintExprVisitor::visit(AstCMethodHard*) for
  ARRAY_R_SUM, ARRAY_R_PRODUCT, ARRAY_R_AND, ARRAY_R_OR, ARRAY_R_XOR
- Substitutes lambda argument references (item/index) in the with expression
- Generates appropriate SMT operations (bvadd, bvmul, bvand, bvor, bvxor)
- Uses correct identity elements for each reduction operation
- Marks non-constant nodes with user1() flag to ensure proper SMT code generation

The implementation follows the same pattern as the existing ARRAY_INSIDE handler,
generating SMT expressions at Verilator compile time that are evaluated by the
constraint solver at runtime.
2026-03-02 21:45:42 +05:30
..
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 Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
connecting.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05: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 Docs: Split control.rst from exe_verilator.rst. 2026-02-24 21:11:39 -05:00
copyright.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
deprecations.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
environment.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05: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 SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
exe_verilator.rst Support array reduction methods with 'with' clause in constraints 2026-03-02 21:45:42 +05:30
exe_verilator_coverage.rst Commentary: Add coverage type to example (#7148) 2026-02-25 01:26:51 -05: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 Support `$get_initial_random_seed` (#7056) (#7069). 2026-02-16 05:57:44 -05: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 Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
install.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
languages.rst Support #0 delays with IEEE-1800 compliant semantics (#7079) 2026-02-16 03:55:55 +00:00
overview.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
simulating.rst Commentary: Add coverage type to example (#7148) 2026-02-25 01:26:51 -05:00
verilating.rst Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
warnings.rst Support proper automatic/static initialization, and remove STATICVAR warning (#6405). (#7086) 2026-02-24 14:04:43 -05:00