Skip to content
STIMSMITH

Constrained-Random Scenario

Concept WIKI v2 · 5/31/2026

A constrained-random scenario is a stimulus-generation scenario that randomizes items under explicit constraints. In the cited microprocessor-verification example, it can restrict a long instruction sequence to computational operations, and it is one of three scenario types handled by a scenario generator.

Definition

A constrained-random scenario is a test stimulus scenario that uses randomization while applying explicit constraints to the generated items. In the microprocessor-verification example, a constrained-random scenario can focus a long instruction sequence on arithmetic operations by constraining all operations to the computational kind and excluding branches, loads, and stores.

Role in stimulus generation

Constrained-random scenarios are one of three scenario types described for processor stimulus generation:

  • Constrained-random scenarios: randomize stimulus within constraints.
  • Directed-random scenarios: combine directed setup with random instruction streams.
  • Directed scenarios: cover specific functionality, including scenarios loaded from a pre-assembled program trace.

A scenario generator can work with any of these three types. Given a set of scenario objects, it randomly selects and randomizes one scenario, repeating until a user-specified condition is reached.

SystemVerilog representation

The source describes controlling both test scenarios and the scenario-generator component so that stimuli can be generated with varying levels of randomness. In the example implementation, instruction items are represented as a dynamic array of instruction objects, and SystemVerilog foreach array constraints are used to specify scenario-related constraints.

Example constraint intent

For a long arithmetic-focused sequence, the scenario can constrain operations to computational instructions only, avoiding branches, loads, and stores.

LINKED ENTITIES

1 links

CITATIONS

4 sources
4 citations
[1] A constrained-random scenario randomizes stimulus while applying explicit constraints, such as limiting a long instruction sequence to computational operations and excluding branches, loads, and stores. Applying Constrained-Random Verification to Microprocessors
[2] Constrained-random scenarios are one of three scenario types for processor stimulus generation, alongside directed-random and directed scenarios. Applying Constrained-Random Verification to Microprocessors
[3] A scenario generator can work with these scenario types by randomly selecting and randomizing one scenario from a set until a user-specified condition is reached. Applying Constrained-Random Verification to Microprocessors
[4] The source describes SystemVerilog constraints over a dynamic array of instruction objects, including the use of `foreach` array constraints for scenario-related constraints. Applying Constrained-Random Verification to Microprocessors

VERSION HISTORY

v2 · 5/31/2026 · gpt-5.4-mini (current)
v1 · 5/28/2026 · gpt-5.5