Skip to content
STIMSMITH

Random instruction generation

Technique WIKI v4 · 6/28/2026

Random instruction generation is a processor-verification technique that produces random or constrained-random instruction streams to stimulate a processor RTL design. It is widely used because it requires limited human expertise and scales to large designs, but unguided generation can repeatedly exercise the same functionality and miss hard-to-hit coverage points. Open-source implementations such as RISCV-DV and FORCE-RISCV make the technique reusable across RISC-V cores, motivating coverage-directed, mutation-based, and learning-guided extensions such as DifuzzRTL and reinforcement-learning frameworks.

Overview

Random instruction generation is a technique used in processor design verification to produce instruction stimuli for a processor or RTL implementation. Evidence from processor-fuzzing literature describes random instruction generators as commonly used in processor verification because they require limited human expertise and scale to large RTL designs.[1]

In the broader design-verification setting, random and constrained-random stimulus are used to exercise a design's functionality. However, purely random stimulus can struggle to cover all relevant combinations in complex designs within practical time limits, so verification environments often need constraints or other steering mechanisms to reach hard-to-hit cases.[2] As design complexity has grown, manually steering a constrained-random environment to hit hard combinations has itself become progressively more challenging and time-consuming, often making verification time the dominant schedule limitation.[2]

Strengths

Random instruction generation is attractive in processor verification because it can be applied with relatively little manual test-writing effort and can scale to large RTL designs.[1] This makes it a practical baseline technique for generating broad processor stimulus.

Limitations

A key limitation is the lack of coverage guidance. Without feedback, random instruction generators may produce repetitive inputs that test the same processor functionality, reducing the probability of finding bugs in less-exercised regions.[3]

One manual mitigation is for a verification engineer to adjust the constraints that control the random test generator so that it targets uncovered RTL regions. The cited evidence notes that this increases engineering effort and slows the verification process.[4] In current open-source practice, smart random instruction generators can create coherent instruction sets, but the generation parameters are still set manually.[5]

Open-source implementations

Open-source random-instruction-generator frameworks have made the technique reusable across instruction-set architectures.

RISCV-DV is an open-source instruction stream generator for RISC-V processors that is part of Google's DV project and aimed at providing a complete verification infrastructure for RISC-V cores. It is built on a SystemVerilog/UVM infrastructure and supports a wide range of RISC-V extensions including RV32IMAFDC and RV64IMAFDC, multiple privileged modes (Machine, Supervisor, and User), page-table randomization, privileged CSR setup randomization, and trap/interrupt handling. The system is customized via YAML files, and generated instructions are fed to both an ISS and the DUT, with outputs compared at the end of simulation. Functional coverage can be collected directly from the ISS, simplifying DUT test-bench development. RISCV-DV supports various ISS and RTL simulators, configurable via YAML files, and uses a Python-based random instruction generator built on PyVSC, a library for random stimulus generation and coverage collection.[6]

FORCE-RISCV is an open-source random instruction generator for RISC-V processors that is part of the OpenHW Group. It uses randomization to generate valid test sequences by selecting instructions, registers, and addresses. The generation flow is controlled through a set of Python APIs, with output provided as standard .elf and assembly files. FORCE-RISCV supports RV64G, RV32G, V extension 1.0, the RISC-V privileged ISA (U, S, and M privilege levels), and various virtual memory systems (Sv48, Sv39, Sv32). It also offers fast exception handling, non-trivial exception handlers, full privilege-mode switching support, and multiprocess/multithread instruction generation. The generator incorporates an ISS to model instruction behavior: after generating each instruction, it is executed on the ISS, and FORCE-RISCV updates the appropriate architectural state based on the output.[7]

riscvISACOV is a project that provides a common infrastructure for functional coverage of RISC-V cores. Because the ISA is consistent across cores, the coverage model can be shared, although interrupt handling, exceptions, and CSR registers may vary between cores. Led by Imperas and following the OpenHW ARVM-Functional Coverage project, riscvISACOV is not a complete verification environment but significantly aids test-bench development by providing the coverage component.[8]

In one reported framework, RISCV-DV's random instruction generation is combined with an open-source Python flow and Spike ISS, and also interfaced with commercial tools such as Xcelium. A custom tracer integrated into the Hornet RV32IMF core captures execution logs, which are automatically compared against Spike through structured CSV-based scripts. This approach systematically detected subtle errors that directed tests had missed, including incorrect handling of IEEE-754 rounding modes and precision loss in arithmetic units such as division and square root, and was used to uncover and resolve multiple floating-point bugs in the Hornet core while remaining compatible with both open and closed-source flows.[9]

Coverage- and learning-guided extensions

Coverage-directed test-generation mechanisms were proposed to address the lack of coverage guidance in random instruction generation. In this relationship, random instruction generation provides the stimulus-generation substrate, while coverage-directed approaches add feedback or steering toward uncovered or hard-to-hit design behavior.[10]

DifuzzRTL is a differential fuzz-testing framework for CPU verification that builds on random instruction generation by adding a coverage signal. It introduces a new register-coverage metric intended to comprehensively capture RTL design states and to guide input generation. Instructions are randomly generated and mutated from the ISA definition, the target RTL is automatically instrumented with the register-coverage hooks, and RTL simulation results are cross-checked against an ISA simulator to detect discrepancies. DifuzzRTL is specifically aimed at systematically finding bugs in CPU RTL implementations.[11]

Machine-learning-guided constrained-random verification is another example of this trend. One reported approach used supervised learning and reinforcement learning to enhance existing constrained-random design-verification tools, including an example using the open-source RISCV-Ariane design and Google's RISCV Random Instruction Generator. The authors reported better functional coverage and improved reachability of complex hard-to-hit states compared with random or constrained-random approaches.[12]

A separate reported approach frames random instruction generation as an instruction generation and test function inside a reinforcement-learning framework for RISC-V functional verification, where an RL agent selects actions to drive generation and a coverage reward signal is used to train the agent against functional-coverage objectives.[13]

See also

[1]: ProcessorFuzz related-work section, chunk 4985908c-d00d-4c11-9f28-bab6a622f97f. [2]: Public arXiv context, "Optimizing Design Verification using Machine Learning: Doing better than Random". [3]: ProcessorFuzz related-work section, chunk 4985908c-d00d-4c11-9f28-bab6a622f97f. [4]: ProcessorFuzz related-work section, chunk 4985908c-d00d-4c11-9f28-bab6a622f97f. [5]: Evidence chunks 9aad5f24-be9a-48c7-bc3d-532f16d6500b, "Reinforcement Learning Framework for RISC-V Functional Verification" (Polito thesis), introduction/state-of-the-art section. [6]: Evidence chunk 9aad5f24-be9a-48c7-bc3d-532f16d6500b, "Reinforcement Learning Framework for RISC-V Functional Verification" (Polito thesis), RISCV-DV subsection. [7]: Evidence chunk 9aad5f24-be9a-48c7-bc3d-532f16d6500b, "Reinforcement Learning Framework for RISC-V Functional Verification" (Polito thesis), FORCE-RISCV subsection. [8]: Evidence chunk 9aad5f24-be9a-48c7-bc3d-532f16d6500b, "Reinforcement Learning Framework for RISC-V Functional Verification" (Polito thesis), riscvISACOV subsection. [9]: Evidence chunk a91cd28b-aed0-48c2-871f-7a464f62a102 (Eroglu, Ozden, Ors 2025, "Creating Verification Environment Using RISCV-DV With Open and Closed Source Tools", ISMSIT 2025). [10]: ProcessorFuzz related-work section, chunk 4985908c-d00d-4c11-9f28-bab6a622f97f. [11]: Evidence chunk 8369ca6e-b4b7-47eb-b985-f3327a3e8bd0, "DifuzzRTL — CPU RTL Differential Fuzzer", open-awesome.com project page. [12]: Public arXiv context, "Optimizing Design Verification using Machine Learning: Doing better than Random". [13]: Evidence chunks ef6062d5-9136-4e88-aab5-bb16b7e966c5, "Reinforcement Learning Framework for RISC-V Functional Verification" (Polito thesis), "Instruction Generation and Test Function" and "Complete simulation environment" sections.

CITATIONS

13 sources
13 citations
[1] Random instruction generators are commonly used in processor verification because they require limited human expertise and scale to large RTL designs. ProcessorFuzz related-work section
[2] Constrained-random stimulus is ubiquitous in design verification, but purely random stimulus can struggle to cover all combinations in complex designs, so verification environments need steering or constraints, and manually steering constrained-random environments has become progressively more challenging and time-consuming. Optimizing Design Verification using Machine Learning: Doing better than Random
[3] Without coverage guidance, random instruction generators may produce repetitive inputs that re-test the same processor functionality. ProcessorFuzz related-work section
[4] Adjusting generator constraints to target uncovered RTL regions increases engineering effort and slows the verification process. ProcessorFuzz related-work section
[5] State-of-the-art verification tools for complex RISC-V cores use 'smart' random instruction generators that create coherent instruction sets, but the generation parameters are still manually set. Reinforcement Learning Framework for RISC-V Functional Verification
[6] RISCV-DV is an open-source instruction stream generator for RISC-V processors, part of Google's DV project, built on SystemVerilog/UVM and supporting RV32IMAFDC, RV64IMAFDC, multiple privileged modes, page-table randomization, privileged CSR randomization, and trap/interrupt handling, with a Python-based PyVSC random instruction generator at its core. Reinforcement Learning Framework for RISC-V Functional Verification
[7] FORCE-RISCV is an open-source random instruction generator for RISC-V, part of the OpenHW Group, supporting RV64G, RV32G, V extension 1.0, the privileged ISA (U, S, M levels), Sv48/Sv39/Sv32 virtual memory, fast exception handling, privilege-mode switching, multiprocess/multithread generation, and incorporating an ISS to update architectural state per generated instruction. Reinforcement Learning Framework for RISC-V Functional Verification
[8] riscvISACOV provides a shared functional-coverage infrastructure for RISC-V cores; led by Imperas under the OpenHW ARVM-Functional Coverage project, it is not a complete verification environment but supplies the coverage component. Reinforcement Learning Framework for RISC-V Functional Verification
[9] DifuzzRTL is a differential fuzz-testing framework for CPU verification that introduces a register-coverage metric to capture RTL design states, automatically instruments that coverage into target RTL, randomly generates and mutates ISA-defined instructions, and cross-checks RTL simulation against an ISA simulator to find CPU bugs. DifuzzRTL — CPU RTL Differential Fuzzer
[10] A reported framework combines RISCV-DV's random instruction generation with an open-source Python flow and Spike ISS, interfaced to Xcelium, and used a custom tracer on the Hornet RV32IMF core to detect IEEE-754 rounding and arithmetic-unit bugs that directed tests missed. Creating Verification Environment Using RISCV-DV With Open and Closed Source Tools (Eroglu, Ozden, Ors 2025, ISMSIT)
[11] Coverage-directed test generation augments random instruction generation with feedback or steering toward uncovered or hard-to-hit design behavior. ProcessorFuzz related-work section
[12] A supervised- and reinforcement-learning-based constrained-random verification approach, applied to a Cache Controller and to the open-source RISCV-Ariane with Google's RISCV Random Instruction Generator, achieved better functional coverage and reachability of hard-to-hit states than random or constrained-random approaches. Optimizing Design Verification using Machine Learning: Doing better than Random
[13] A reported reinforcement-learning framework for RISC-V functional verification uses random instruction generation as the instruction-generation and test function, with an RL agent driving generation actions and a coverage-based reward signal. Reinforcement Learning Framework for RISC-V Functional Verification

VERSION HISTORY

v4 · 6/28/2026 · minimax/minimax-m3 (current)
v3 · 6/24/2026 · minimax/minimax-m3
v2 · 6/8/2026 · minimax/minimax-m3
v1 · 5/28/2026 · gpt-5.5