Skip to content
STIMSMITH

Wrapper Class

CodeArtifact WIKI v1 · 5/25/2026

A wrapper class is described as a likely architectural requirement in a multi-class constrained-random instruction generator when the test layer directly controls lower-level subclass variables. In that flow, the wrapper constrains test-controlled variables, is randomized first, and is followed by allocation and randomization of the appropriate subclass object.

Overview

In the cited multi-class randomization architecture for an instruction generator, a wrapper class is presented as a likely solution for cases where the test layer directly controls items in lower-level subclasses. The architecture otherwise uses knobs or switches at the upper layer to choose an opcode category first, allowing the generator to allocate the correct subclass object before randomization.

Role in multi-class randomization

The instruction generator described in the evidence was split from a single large opcode class into multiple smaller opcode-category classes to reduce the size of the randomization problem. A base instruction class held data members, common constraints, and shared methods, while each child class contained constraints specific to its opcode category.

A wrapper class becomes relevant when the test layer directly constrains lower-level subclass variables. In that situation, the evidence states that decisions about which subclass to randomize must be made first. The wrapper class would constrain all variables controlled by the tests, be randomized first, and then the correct subclass object would be allocated and randomized in a second generation phase.

Generation sequence

The wrapper-class flow described by the source is:

  1. The test-controlled variables are constrained in the wrapper class.
  2. The wrapper class is randomized first.
  3. The appropriate subclass object is selected or allocated based on the wrapper-level result.
  4. The selected subclass object is randomized in a second phase.

Design implication

The wrapper class is therefore not described as part of the default multi-class generator when only upper-layer knobs select opcode categories. Instead, it is described as a likely requirement when test-layer constraints reach into lower-level subclass-specific data, because subclass-selection decisions must precede subclass randomization.

CITATIONS

5 sources
5 citations
[1] The multi-class architecture split a large opcode class into smaller opcode-category classes to reduce the size of the randomization problem. Generating AMD microcode stimuli using VCS constraint solver
[2] The base instruction class contained common data members, common constraints, and shared methods, while child classes contained opcode-category-specific constraints. Generating AMD microcode stimuli using VCS constraint solver
[3] When upper-layer generation is controlled only by knobs, the opcode category can be selected first so the correct subclass object can be allocated. Generating AMD microcode stimuli using VCS constraint solver
[4] If the test layer directly controls lower-level subclass items, a wrapper class would likely be required to constrain test-controlled variables. Generating AMD microcode stimuli using VCS constraint solver
[5] In the wrapper-class flow, the wrapper is randomized first, after which the correct subclass object is allocated and randomized in a second phase. Generating AMD microcode stimuli using VCS constraint solver