Skip to content
STIMSMITH

riscv_instr_base_test

CodeArtifact WIKI v1 · 5/26/2026

riscv_instr_base_test is a riscv-dv test artifact identified as riscv_instr_base_test.sv. It randomizes riscv_instr_gen_config, which determines key random-instruction-generation settings such as enabled RISC-V extensions, supported privilege mode, main/subprogram instruction counts, and suppression flags for instructions such as ebreak, dret, fence, and wfi.

Overview

riscv_instr_base_test refers to the riscv_instr_base_test.sv test in the open-source CHIPS Alliance riscv-dv RISC-V random instruction generator environment. In the documented generation flow, this test is the point from which the riscv_instr_gen_config class is randomized. That randomized configuration drives major stimulus-generation choices used later when generating RISC-V assembly programs for processor verification. [C1]

Role in the riscv-dv flow

The surrounding riscv-dv environment is described as an open-source, SystemVerilog UVM-based class structure for RISC-V IP verification. Its generated random tests can be run with a design IP, and the assembly program generated by the environment includes sections such as initialization, instruction, data, stack, page table, interrupt handling, and exception handling. [C2]

Within that flow, riscv_instr_base_test.sv randomizes riscv_instr_gen_config before assembly generation. This randomization selects or constrains several high-level test characteristics, including:

  • the RISC-V extension set being exercised;
  • the supported privilege mode;
  • instruction counts in the main program and subprograms;
  • whether break instructions are suppressed via no_ebreak;
  • related suppression/configuration flags such as no_dret, no_fence, and no_wfi. [C1]

The same evidence notes that additional Boolean variables can be set according to DUT features and testbench stimulus-generation requirements, making riscv_instr_base_test.sv part of the configurable test setup rather than the assembly-emission logic itself. [C3]

Relationship to program generation

After configuration randomization, the documented assembly-generation flow centers on riscv_asm_program_gen.sv, whose gen_program() function generates the program sections and calls subordinate functions such as get_directed_instr_stream(), gen_program_header(), init_gpr(), and directed-instruction-stream generation. [C4]

Because riscv_instr_base_test.sv randomizes riscv_instr_gen_config, its primary technical significance is that it establishes generation parameters consumed by the broader riscv-dv program-generation flow. The evidence specifically ties those parameters to extension selection, privilege support, instruction-count choices, and instruction-suppression controls. [C1]

Key configuration outputs

Configuration area Evidence-supported behavior
ISA selection Decides the RISC-V extension being run. [C1]
Privilege setup Decides the supported privilege mode. [C1]
Program sizing Decides instruction counts in the main program and subprogram. [C1]
Instruction suppression Controls whether certain instructions are generated, including ebreak, dret, fence, and wfi via variables such as no_ebreak, no_dret, no_fence, and no_wfi. [C1]
DUT/testbench adaptation Other variables can be set true or false based on DUT features and stimulus-generation requirements. [C3]

LINKED ENTITIES

1 links

CITATIONS

4 sources
4 citations
[1] riscv_instr_base_test.sv randomizes riscv_instr_gen_config, which determines RISC-V extension selection, supported privilege mode, main/subprogram instruction counts, and suppression flags such as no_ebreak, no_dret, no_fence, and no_wfi. RISC-V source class riscv_asm_program_gen, the brain behind ...
[2] The open-source CHIPS Alliance riscv-dv environment provides a SystemVerilog UVM-based class structure for RISC-V IP verification and generates assembly-program sections including initialization, instruction, data, stack, page table, interrupt, and exception-handling sections. RISC-V source class riscv_asm_program_gen, the brain behind ...
[3] Additional configuration variables can be set true or false based on DUT features and testbench stimulus-generation requirements. RISC-V source class riscv_asm_program_gen, the brain behind ...
[4] riscv_asm_program_gen.sv contains gen_program(), which generates program sections and calls functions including get_directed_instr_stream(), gen_program_header(), init_gpr(), and directed-instruction-stream generation. RISC-V source class riscv_asm_program_gen, the brain behind ...