Overview
Memory operation stimulus refers to the test stimulus used to exercise vector load, store, mask, and indexed memory-operation behavior in a RISC-V vector accelerator verification environment. In the cited work, memory operations were treated as a delicate verification area because the Vector Processing Unit (VPU) did not access memory directly; instead, it read and wrote data through a scalar core using the memop, load, store, and mask interfaces, requiring substantial inter-sub-interface communication. [C1]
Generation in RISCV-DV
The verification flow used RISCV-DV to generate random RISC-V assembly tests that provided vector instructions to the VPU. The authors extended RISCV-DV with memory-operation-related capabilities, including:
- generation of
vsetvliinstructions and modification of memory-operation generation so tests could change element width and vector length; - an option to select the initialization pattern of data pages;
- constraints on memory addresses accessed by generated tests to avoid memory exceptions, especially for vector indexed memory instructions;
- adaptation of the generated stimulus to the RISC-V Vector 0.7.1 specification used by the design. [C2]
These additions made the memory-operation stimulus configurable enough to test different vector-length and element-width combinations while avoiding unintended exception scenarios that would obscure functional checking. [C2]
Load stimulus and memory-model setup
For vector load operations, the verification environment needed the expected data to be present in memory before the instruction executed. Along with instruction information from Spike, the environment retrieved the data that should be read, wrote that data into a memory model based on the OpenTitan memory model, and then sent the Spike data through the VPU load sub-interface at the corresponding addresses. [C3]
Store stimulus and masked-operation checking
For vector store operations, the environment also needed pre-existing memory contents before instruction execution. This was required to check masked stores and detect undesired writes. During a store, the VPU sent data to the memory model; later, the stored values were read back and compared with Spike’s expected values. [C4]
Masked memory operations produced additional outgoing transactions from the VPU, including masks or indexes. The environment used these transactions to execute the instruction-side memory behavior and compare it against Spike, which helped identify mask-related errors in memory instructions. [C5]
Retry-oriented stimulus
The environment also randomized memory-exception and retry scenarios. In the Open Vector Interface behavior described by the authors, retries occurred when the VPU could not handle all loaded cache lines sent by the scalar core. The instruction then completed with a vstart value identifying the first element that could not be written to the vector registers, meaning the instruction had to be re-executed from that element. [C6]
The verification environment randomized retries using UVM configuration objects to increase the chance of provoking these cases. This was important because retries required killing instructions after the retried instruction, reissuing from the stored vstart, and correctly calculating vstart from the lowest received index, mask, or data chunk. The authors reported that retries were a primary source of VPU errors. [C6]
Coverage role
Memory operation stimulus was also tied to functional coverage. The cited verification effort implemented coverage for diverse load and store scenarios, considering not only vector length but also the organization of the register file. Loads and possible retries with different vstart values were covered by directed tests that were added to the regression suite. [C7]