Constrained-Random Stimulus Generation
TechniqueConstrained-random stimulus generation is a verification technique for creating randomized but legally constrained test stimuli, such as microcode instruction sequences. In the provided AMD/Synopsys example, SystemVerilog constraints and the Synopsys VCS constraint solver are used to control instruction-field distributions, bias stimulus toward corner cases, and improve performance through hierarchical, multi-class generator architecture.
WIKI
Overview
Constrained-random stimulus generation creates automated random test stimuli while applying constraints that keep generated items legal and useful for verification. In the provided microprocessor verification example, random generators create microcode test sequences and emphasize distribution across meaningful opcode values and other instruction attributes, replacing a diminishing reliance on hand-written directed tests as design complexity grows. [C1]
The technique contrasts with sequential randomization of instruction fields, which the source describes as producing verbose, redundant code and offering limited control over distributions. SystemVerilog constraint constructs provide a concise way to describe possible combinations of microcode-instruction attributes and to control the distribution of values for individual fields. [C2]