Overview
Directed Test Generation, in the context of the provided evidence, is represented by the use of hand-written directed tests for verification. The evidence states that as microprocessor designs have grown considerably in complexity, the use of such hand-written directed tests has dwindled, with automated random test generators emerging in their place to cover the stimulus space more efficiently.[1]
Role in processor verification
The cited verification context is microcode stimulus generation for microprocessor designs. Automated random test generators create microcode test sequences and emphasize distribution of stimuli across meaningful opcode values and other instruction attributes.[2]
The evidence contrasts this with traditional sequential randomization methods, which randomize instruction fields sequentially and can produce verbose, redundant code with limited control over distributions.[3]
Relationship to constrained-random generation
The article describes a hierarchical constrained-random approach using the Synopsys VCS constraint solver. This approach was used to accelerate generation, reduce memory consumption, and provide distribution control and biasing to hit corner cases.[4]
SystemVerilog constraint-language constructs are described as a way to concisely specify possible combinations of microcode-instruction attributes while precisely controlling value distributions for individual fields.[5]
Generator architecture described in the evidence
The described opcode generator uses two layers:
- an upper layer implemented with a SystemVerilog random sequence construct and weighted knobs to control high-level item distribution; and
- a lower layer consisting of an opcode class randomized with additional constraints and weights provided by the upper layer.[6]
The tests are sets of weighted values that direct the generator toward the required mix of instructions, and the constraint solver applies these weights to control distributions of opcode types.[7]
Implementation considerations
The evidence describes an initial single-class generator prototype in which constraints for all opcodes were defined. This design overcame flaws of sequential randomization methods, but a single-class approach can be slow because the solver must handle many random variables and a large constraint set.[8]
A later object-oriented design used a base class for global opcode constraints and subclasses for related opcode groups. Partitioning constraints hierarchically into smaller opcode groups reduced memory requirements and improved performance.[9]
Notes
The provided evidence does not give a standalone formal definition of Directed Test Generation beyond its reference to hand-written directed tests. Therefore, this article limits the description to the supported verification context and contrasts shown in the source.
[1]: Directed tests in verification; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [2]: Automated random microcode test generation; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [3]: Limitations of sequential randomization; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [4]: Hierarchical constrained-random approach and VCS constraint solver; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [5]: SystemVerilog constraint-language constructs; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [6]: Two-layer opcode-generator architecture; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [7]: Weighted tests direct generator distributions; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [8]: Single-class randomization trade-off; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc. [9]: Hierarchical partitioning into base class and subclasses; chunk 4de14aa6-a0c6-4115-8dcd-2be6148018dc.