Constrained-Random Stimulus Generation
ConceptConstrained-random stimulus generation is a directed-random verification technique in which a solver automatically selects values for randomized fields of a data object subject to Boolean constraints, producing legal stimuli with controlled distributions. It is realized concretely as (a) the SystemVerilog class/constraint mechanism underlying directed-random verification; (b) a hierarchical, knob-driven opcode generator used in industrial microprocessor work (the AMD/Synopsys microcode flow); (c) the open-source RISCV-DV ISA-level flow integrated with the Synopsys VCS/Verdi tool chain and the Spike golden reference; and (d) the Python `constrainedrandom` library, in which randomizable variables and constraints are added programmatically to a `RandObj` subclass and a `randomize()` step produces one valid instance at a time.[^2119d9e0][^6fa7d584][^5204399e][^4de14aa6][^78097f25][^a47aa5b1][^ef1eb457]
WIKI
Constrained-Random Stimulus Generation
Constrained-random stimulus generation is a directed-random verification technique in which a constraint solver automatically selects values for randomized fields of a data object subject to a set of Boolean constraints, producing legal stimuli with controlled distributions. In SystemVerilog it is the central mechanism of the directed-random verification methodology, in industrial microprocessor work (such as the AMD/Synopsys microcode flow) it is realized as a hierarchical, knob-driven opcode generator, in RISC-V processor verification it is implemented by the open-source RISCV-DV flow (which provides instruction-, sequence-, and program-level randomization integrated with UVM functional coverage), and in software-only flows it is implemented by the Python constrainedrandom library, where randomized variables and Boolean constraints are registered programmatically and the solver is invoked by randomize().[1][2][3][4][5][6][7]