Skip to content
STIMSMITH

Weighted Distribution

Concept WIKI v1 · 5/28/2026

Weighted distribution is a constrained-random test-generation technique in which weighted values or knobs bias the mix of generated stimulus, such as opcode types or instruction-field values, so verification can control coverage emphasis and target corner cases.

Overview

Weighted distribution is used in constrained-random verification to control how often different stimulus choices are generated. In the cited microcode-stimulus generator, tests provide a set of weighted values that direct the generator toward the required mix of instructions, and the constraint solver applies those weights to control the distribution of generated opcode types.

Role in constrained-random generation

SystemVerilog constraint-language constructs can describe legal combinations of microcode-instruction attributes while also giving precise control over the distribution of values for individual fields. This lets a generator bias stimulus rather than relying on purely uniform or sequential randomization.

In the described opcode-generator architecture, weighted distribution appears at two levels:

  • Upper generator layer: a SystemVerilog random-sequence construct uses weighted knobs to control the distribution of high-level items.
  • Lower opcode layer: the opcode class is randomized with additional constraints and weights supplied by the upper layer.

Together, these weights guide the generator toward the desired instruction mix and opcode-type distribution.

Purpose

Weighted distribution is used to shape generated stimulus across meaningful opcode and instruction-attribute values. In the AMD/Synopsys example, the approach supports distribution control and biasing intended to hit corner cases while using a hierarchical constrained-random method.

Relationship to opcode generators

An opcode generator can use weighted distribution to decide the relative frequency of opcode categories or instruction types. The cited architecture uses weighted knobs in the upper layer and passes constraints and weights into the randomized opcode class in the lower layer.

CITATIONS

4 sources
4 citations
[1] Weighted values direct the generator to the required mix of instructions and are applied by the constraint solver to control opcode-type distribution. Generating AMD microcode stimuli using VCS constraint solver
[2] SystemVerilog constraint-language constructs provide precise control over the distribution of values for individual instruction fields. Generating AMD microcode stimuli using VCS constraint solver
[3] The opcode-generator architecture uses an upper random-sequence layer with weighted knobs and a lower randomized opcode-class layer that receives additional constraints and weights. Generating AMD microcode stimuli using VCS constraint solver
[4] Weighted distribution and biasing are used in the hierarchical constrained-random approach to help hit corner cases. Generating AMD microcode stimuli using VCS constraint solver