Skip to content
STIMSMITH

gen_section

CodeArtifact

gen_section is a helper function used by the riscv_asm_program_gen assembly-program generator to insert named assembly sections into an instruction stream. The evidence shows it being used for the _start header section, host-interface code such as write_tohost and _exit, and trap-vector-related code such as mtvec_handler.

First seen 5/26/2026
Last seen 5/28/2026
Evidence 2 chunks
Wiki v1

WIKI

Overview

gen_section is a code-generation helper associated with the riscv_asm_program_gen flow in riscv-dv. The surrounding generator class is described as producing complete RISC-V assembly programs for processor IP verification, including initialization, instruction, data, stack, page-table, interrupt, and exception-handling sections.

Within that flow, gen_section is used to add named assembly sections into the generated instruction stream.

READ FULL ARTICLE →

NEIGHBORHOOD

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

explore full graph →

RELATIONSHIPS

5 connections
riscv_asm_program_gen part of → 100% 4e
gen_section is a function within riscv_asm_program_gen used to insert instruction sections.
gen_program ← uses 95% 2e
gen_program uses gen_section to add host interface instructions and other sections.
gen_program_header ← uses 100% 2e
gen_program_header calls gen_section to insert the header instructions.
exception handling implements → 1e
gen_section selects and implements exception handling instructions in the generated program.
interrupt handling implements → 1e
gen_section selects and implements interrupt handling instructions in the generated program.

CITATIONS

6 sources
6 citations — click to expand
[1] riscv_asm_program_gen generates complete RISC-V assembly programs for RISC-V IP verification and includes functions for sections such as initialization, instruction, data, stack, page table, interrupt, and exception handling. RISC-V source class riscv_asm_program_gen, the brain behind ...
[2] gen_program() is described as the main function that generates all sections of the program and calls other riscv_asm_program_gen functions. RISC-V source class riscv_asm_program_gen, the brain behind ...
[3] gen_program_header() calls gen_section("_start", str), which inserts header instructions into instr_stream. RISC-V source class riscv_asm_program_gen, the brain behind ...
[4] After main-program and subprogram generation, host-interface-related instructions are added by gen_section, including write_tohost, sw gp, tohost, t1, and _exit. RISC-V source class riscv_asm_program_gen, the brain behind ...
[5] riscv_asm_program uses gen_section() to select the mtvec_handler instruction string, which has exception_hander and interrupt_handler defined. RISC-V source class riscv_asm_program_gen, the brain behind ...
[6] The generated program flow uses gen_program() and associated helpers with riscv_instruction_sequence, base test classes, and configuration helpers to produce complete RISC-V assembly programs with randomized instructions and randomized GPR selections. RISC-V source class riscv_asm_program_gen, the brain behind ...