Skip to content
STIMSMITH

C++ reference model

Concept WIKI v1 · 6/1/2026

A C++ reference model is the functional reference-calculation component used in a twin-based RISC-V verification framework. In the cited system, it executes vector instructions sequentially, represents co-processor memories with integer arrays, models addressing and bit-exact arithmetic/logic behavior, and serves as the comparison baseline for validating co-processor execution results.

C++ reference model

In the cited twin-based verification framework, the C++ reference model is the software implementation used for reference calculation of vector instructions alongside execution on the hardware co-processor. It is part of the RISC-V-side reference execution used to validate the co-processor's behavior.[1]

Role in the verification flow

After test sequences are generated, the vector instructions are executed on the V²PRO co-processor under control of the RISC-V core. In parallel, the same vector instructions are calculated by the RISC-V reference model. The results produced by hardware execution and by the reference memories are then compared; mismatches cause verification failure and trigger detailed reporting.[2][3]

Implementation characteristics

The reference calculation was implemented in C++ with function-level behavior for each vector operation.[4] According to the cited description, the model:

  • processes vector instructions sequentially,[5]
  • iterates through the co-processor's vector units and vector lanes,[6]
  • realizes internal memories such as register files and local memories as integer arrays,[7]
  • handles complex addressing parameters in loops over vector operations,[8]
  • implements logic and arithmetic behavior with bit-level exact masks, including examples such as shifting and multiplication precision,[9]
  • simulates the chaining mechanism of neighbor vector lanes by sequential interleaving of vector-element calculation and chaining-source selection.[10]

Modeling scope

The cited paper characterizes the co-processor emulation as functionally correct but coarse-grained. Specific hardware implementation details are intentionally omitted, including details such as a vector lane's pipeline execution and stall conditions.[11]

Significance

Because the C++ reference model provides the reference execution against which hardware state is checked, it acts as the functional oracle in the framework's self-testing and validation process.[3]

[1]: Reference calculation is performed by the RISC-V reference model in the cited framework. [2]: The RISC-V controls execution of generated vector instruction sequences on the co-processor. [3]: After both twins execute the sequence, stored hardware results are compared with the reference memories. [4]: The reference calculation was implemented in C++. [5]: The model processes vector instructions sequentially. [6]: The V²PRO array is processed by iterating through vector units and vector lanes. [7]: Register files and local memories are realized by integer arrays. [8]: A loop processes vector operations with defined complex addressing parameters. [9]: Logic and arithmetic operations are implemented with corresponding bit-level exact masks. [10]: Neighbor-lane chaining is modeled by sequential interleaving of element calculation and chaining-source selection. [11]: The model is coarse-grained and ignores some hardware-specific execution details.

LINKED ENTITIES

1 links

CITATIONS

8 sources
8 citations
[4] The model iterates through vector units and vector lanes, and represents register files and local memories as integer arrays. A Self-Testing Framework for Verification and Validation of a RISC-V-Based System with a Co-processor | International Journal of Parallel Programming | Springer Nature Link
[5] The model implements vector operations with complex addressing parameters and bit-level exact masks for arithmetic and logic behavior. A Self-Testing Framework for Verification and Validation of a RISC-V-Based System with a Co-processor | International Journal of Parallel Programming | Springer Nature Link
[6] The chaining mechanism of neighbor vector lanes is simulated by sequential interleaving of element calculation and chaining-source selection. A Self-Testing Framework for Verification and Validation of a RISC-V-Based System with a Co-processor | International Journal of Parallel Programming | Springer Nature Link
[7] The co-processor emulation is functionally correct but coarse-grained, ignoring details such as pipeline execution and stall conditions. A Self-Testing Framework for Verification and Validation of a RISC-V-Based System with a Co-processor | International Journal of Parallel Programming | Springer Nature Link
[8] After execution on both twins, hardware results stored in external memory are compared against the reference memories, and mismatches cause verification failure with detailed reporting. A Self-Testing Framework for Verification and Validation of a RISC-V-Based System with a Co-processor | International Journal of Parallel Programming | Springer Nature Link