riscv_instr_gen_config
riscv_instr_gen_config is a configuration class in the CHIPS Alliance open-source riscv-dv random instruction generator flow for RISC-V processor verification. It is randomized from the riscv_instr_base_test.sv test before assembly-program generation begins. The resulting configuration determines major constraints and switches used by the generated RISC-V assembly test program. [C1]
Role in the generation flow
The evidence describes riscv_instr_gen_config as the first configuration object randomized before the riscv_asm_program_gen flow generates the assembly program. This places it upstream of the assembly-program construction process, where riscv_asm_program_gen later creates sections such as initialization, instruction, data, stack, page-table, interrupt, and exception-handling sections. [C1] [C2]
Configuration responsibilities
Randomization of riscv_instr_gen_config decides several test-generation properties: [C1]
- The RISC-V extension set used for the generated program.
- The supported privilege mode.
- The instruction count in the main program.
- The instruction count in subprograms.
- Whether break instructions are generated, controlled through
no_ebreak. - Similar suppression controls for
no_dret,no_fence, andno_wfi. - Other Boolean-style variables that may be set according to DUT features and testbench stimulus-generation requirements.
Relationship to riscv_asm_program_gen
riscv_asm_program_gen is the assembly-program generator class that emits the complete RISC-V assembly program used to verify RISC-V IP. The configuration established by riscv_instr_gen_config precedes that generation and controls important aspects of what the program may contain. After configuration, riscv_asm_program_gen performs program construction through functions such as gen_program(), gen_program_header(), init_gpr(), directed instruction stream generation, main-program instruction-stream conversion, optional subprogram insertion, and host-interface section emission. [C1] [C2]
Practical significance
Because riscv_instr_gen_config encodes DUT- and testbench-dependent choices, it is the point where a verification environment can constrain generated stimulus to match the target RISC-V IP capabilities. For example, a DUT or testbench that should not receive certain instruction types can use variables such as no_ebreak, no_dret, no_fence, or no_wfi to prevent those instructions from being generated. [C1]