Skip to content
STIMSMITH

instruction generation algorithm

CodeArtifact

The instruction generation algorithm is a randomized RISC-V instruction-stream generator for cross-level processor testing. It starts from fully randomized 32-bit instruction words, biases them toward legal instructions by injecting valid opcodes with high probability, applies architecture-aware field mutation rules with lower probability, and occasionally delegates to instruction sequence generators.

First seen 5/26/2026
Last seen 5/30/2026
Evidence 2 chunks
Wiki v2

WIKI

Overview

The instruction generation algorithm is the instruction-stream generator described in Efficient Cross-Level Testing for Processor Verification: A RISC-V Case-Study. It is used in a co-simulation-based testing setup whose goal is to generate an endless, unrestricted instruction stream for comparing an RTL core with an instruction set simulator (ISS). The paper identifies fully randomized instruction generation as the baseline, then adds modifications that guide generation toward more interesting and more often legal RISC-V instructions. [C1]

A key motivation is that pure randomization tends to produce illegal instructions because the illegal-instruction state space is much larger than the legal-instruction state space. The algorithm therefore begins with a random 32-bit instruction word but often injects a valid opcode and sometimes applies field-level mutation rules derived from RISC-V instruction structure. [C2]

READ FULL ARTICLE →

NEIGHBORHOOD

No graph connections found for this entity yet. It may appear in future ingestion runs.

explore full graph →

RELATIONSHIPS

6 connections
The paper introduces an instruction generation algorithm for on-the-fly test generation.
co-simulation testbench part of → 90% 2e
The instruction generation algorithm is part of the co-simulation testbench.
on-the-fly instruction stream generation implements → 100% 1e
The instruction generation algorithm implements the on-the-fly instruction stream generation technique.
opcode injection uses → 100% 1e
The instruction generation algorithm uses opcode injection.
instruction field mutation uses → 100% 1e
The instruction generation algorithm applies field mutation rules.
instruction sequence generation uses → 100% 1e
The instruction generation algorithm incorporates sequence generation.

CITATIONS

5 sources
5 citations — click to expand
[1] C1: The instruction generation algorithm is part of a co-simulation-based cross-level testing setup; its baseline fully randomizes generated instructions, with modifications to guide generation toward interesting cases and legal instructions. Efficient Cross-Level Testing for
[2] C2: Pure randomization tends to generate illegal instructions because the illegal-instruction state space is larger; opcode injection can turn a fully randomized 32-bit word into a randomized ADDI example while leaving fields random. Efficient Cross-Level Testing for
[3] C3: The pseudocode can continue an existing sequence, start a new random sequence with 1% probability, generate a random 32-bit instruction word, inject a random valid opcode with 98% probability, apply a random field mutation with 20% probability, and return the resulting single instruction. Efficient Cross-Level Testing for
[4] C4: Field mutation rules are derived from the RISC-V instruction format and include special immediate values, RD-to-zero, RD matching RS1 and/or RS2, RS1 matching RS2, and CSR selector mutation to a supported CSR; the ADDI example mutates RD to match RS1. Efficient Cross-Level Testing for
[5] C5: The cross-level testing approach was implemented and applied to verification of a pipelined 32-bit industrial RISC-V TGF series core implemented in SpinalHDL. Efficient Cross-Level Testing for