Skip to content
STIMSMITH

C++ Instruction Set Simulator

CodeArtifact WIKI v1 · 5/26/2026

The C++ Instruction Set Simulator is an automatically generated instruction set simulator produced from a complete formal property suite. The described approach translates an architectural ITL specification into a C++ simulation core, applies code-generation optimizations, and yields simulators whose measured performance is comparable to commercial just-in-time compiled simulator tooling while retaining equivalence to the verified design by construction.

Overview

The C++ Instruction Set Simulator is a generated instruction set simulator (ISS) whose source is derived from a complete, architectural-style property suite rather than from a manually reimplemented ISA model. In the described method, a formally verified property suite becomes a functionally equivalent architectural model of the verified processor design; the generated ISS is therefore equivalent to the design by construction after successful verification. [C1]

ISSs are used in processor and system design flows for pre-silicon software development, allowing software to be simulated before the target system is manufactured or even fully finished. The motivation for generating the C++ ISS is to avoid slow gate-level or cycle-accurate execution for software workloads while also avoiding a separate manual reimplementation of the ISA. [C2]

Generation model

The generation flow starts from an ISA description written in ITL. The next_state macro forms the core of the ISA: it takes the current architectural state and decoded instruction fields and returns the architectural state after executing the instruction. A decode macro decomposes an instruction word into fields stored in an instruction record, enabling reuse of decoded instruction information during simulation. [C3]

The generated simulator core is a C++ class named Sim. It contains the instruction-execution code and stores the architectural state. The translation from ITL to C++ includes generating public functions for next_state, decode, and interface macros; generating private functions for remaining macros; generating a member variable for architectural state; replacing ITL/HDL data types and operations with C++ equivalents; and replacing update expressions with direct array or structure overwrites in C++. [C4]

A full RTL/ISA equivalence proof is not required before generating the simulator. The ISA can be developed in ITL early in the design process and used to generate an ISS before verification starts. If the ISA changes, the ISS is regenerated; full confidence that the ISS complies with the design is obtained at the end of formal verification. [C5]

Runtime integration

The generated C++ class provides the core ISS functionality, but the user supplies a wrapper. The wrapper calls the generated public functions to execute individual instructions and connects the simulation core to peripheral components such as external memories or buses. The evidence also describes integration with commercial simulation and debugging tools in the experimental setup. [C6]

Code-generation optimizations

Several optimizations are applied during C++ generation to improve simulation performance:

  • ITL/HDL values whose bit width fits the host system are mapped to native C++ data types such as unsigned integers.
  • Basic integer arithmetic and simple logic operations are mapped to native C++ operations.
  • Larger bit vectors and complex operations such as bit slicing or bit rotation use optimized library functions.
  • Data dependencies in macro functions are analyzed to identify shared expressions, allowing member variables to cache temporary and intermediate results.
  • Decoded instruction fields are cached so repeated decoding of the same instruction can be avoided, which is effective for common software locality patterns such as loops. [C7]

Experimental results

Two generated ISSs were evaluated. For a small pipelined processor with eight 16-bit registers, a special interrupt-return-vector register, a five-stage pipeline, and seven instructions, the generated property-suite ISS achieved 7 MIPS. In the same comparison, an interpretive commercial-tool ISS achieved 0.22 MIPS and a just-in-time compiled simulator achieved 14 MIPS. [C8]

For an industrial processor design with 64 32-bit registers across multiple hardware contexts, a seven-stage pipeline, memory and bus interfaces, and 88 DLX-based instructions, the generated ISS achieved 1.2 MIPS. The commercial just-in-time compiled simulator achieved 2.5 MIPS. The reported processor core was about 10,000 lines of VHDL, and the final reformulated property suite was about 2,000 lines of ITL. [C9]

The authors conclude that the generated C++ ISS performance is comparable to state-of-the-art commercial tools when the generation applies the described optimizations. They also note that commercial just-in-time compiled simulators remained faster, likely due to tool optimizations and because the generated properties reflected hardware and pipeline effects that may be absent from high-level ISA descriptions. [C10]

Design value

The main technical value of the artifact is that it uses the formal property suite as a single source for both verification and simulation. This supports automatic simulator adaptation when the design or specification changes late in the process and provides a practical way to obtain a proven-correct and efficient ISS for early software development. [C11]

CITATIONS

11 sources
11 citations
[1] A complete formally verified property suite can serve as an architectural model, and a generated C++ ISS is equivalent to the verified design by construction. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[2] ISSs are important for pre-silicon software development and are used instead of gate-level or cycle-accurate models for performance reasons. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[3] The ITL ISA description uses decode and next_state macros, with next_state forming the core of the ISA and decode producing reusable instruction fields. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[4] The generated simulator core is a C++ class Sim, and the ITL-to-C++ translation includes generated public/private functions, architectural-state storage, type/operator replacement, and direct update overwrites. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[5] The ISS can be generated before a full RTL/ISA equivalence proof; if the ISA is updated, the ISS is regenerated, and full confidence is achieved after verification. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[6] A user-provided wrapper calls generated public functions and connects the C++ simulation core to external memories, buses, or commercial simulation/debugging tools. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[7] The C++ generation applies native type/operator mapping, optimized library functions for complex or large-bit-vector operations, shared-expression caching, intermediate-result caching, and decode-result caching. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[8] For the small pipelined processor experiment, the generated ISS achieved 7 MIPS, compared with 0.22 MIPS for an interpretive simulator and 14 MIPS for a just-in-time compiled simulator. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[9] For the industrial processor experiment, the generated ISS achieved 1.2 MIPS versus 2.5 MIPS for a commercial just-in-time compiled simulator; the design had 64 32-bit registers, a seven-stage pipeline, 88 DLX-based instructions, about 10,000 lines of VHDL, and a 2,000-line ITL property suite. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[10] The generated simulator performance is described as comparable to state-of-the-art commercial tools, while commercial JIT-CS simulators remained faster due to tool optimizations and omitted high-level hardware/pipeline effects. Generating an Efficient Instruction Set Simulator from a Complete Property Suite
[11] Using the formal property suite as the single specification source enables automatic simulator adaptation after design/specification changes and supports correct early software-development results based on instruction-set simulation. Generating an Efficient Instruction Set Simulator from a Complete Property Suite