Skip to content
STIMSMITH

reference model comparison

Concept WIKI v1 · 5/28/2026

Reference model comparison is a processor verification technique that runs code on both an implementation and a high-level golden model, then checks whether their architectural states or execution traces agree. It can be implemented as end-of-simulation comparison, trace comparison, or co-simulation, with co-simulation addressing asynchronous stimuli such as interrupts by coordinating the implementation and reference model during execution.

Overview

Reference model comparison is a verification technique for processors in which the execution of an implementation is compared against a reference, or golden, model. In the cited MICRO-54 paper, the reference model is described as a high-level software model of a processor that is fast, uncomplicated, omits implementation details, and updates architectural state at instruction-level granularity. The core idea is that when the same code runs on the device under test (DUT) and the model, their architectural states should match at any given moment. [C1]

This technique is useful in settings where self-checking is difficult. For randomly generated verification code, the paper notes that self-checking techniques are not applicable because of the random nature of the tests; instead, pass/fail behavior can be determined by comparing execution with a reference model. [C2]

Implementation styles

End-of-simulation comparison

End-of-simulation comparison is a simple and low-cost setup. The same code is run on the reference model and the RTL implementation, and only after the test completes are architectural states compared. In the paper's description, the register-file state and memory from both executions are dumped and compared. [C3]

This approach has two important limitations. First, a buggy behavior that affects architectural state can later be overwritten by correct execution and therefore hidden. Second, if a mismatch is detected only at the end, debugging can be difficult because the observed failure may be far from the original point of divergence. [C3]

Trace comparison

Trace comparison is another way to implement reference-model checking. It requires both models to dump execution logs, typically including program-counter flow and every register or memory writeback. The logs are then compared, and mismatches are flagged. [C4]

However, trace comparison is not well suited to asynchronous external stimuli such as interrupts and debug requests. Because the models run standalone and the comparison happens after execution, a single interrupt can make the logs diverge. [C5]

Co-simulation

Co-simulation addresses the asynchronous-stimulus problem by running the RTL model and reference model in parallel and allowing communication between them. The models start executing the same code and pass messages to each other. [C6]

One class of message is used at specified events such as instruction commit: the RTL model signals the reference to commit an instruction and compare the relevant state. If the comparison fails, execution halts immediately and the stimulus that caused the failure is reported, which simplifies debugging by placing the investigation near the point of divergence. [C6]

A second class of message is needed for asynchronous interrupts. When the RTL flags an interrupt, it must be able to inform the emulator so that the emulator follows the RTL execution path. [C7]

Role in processor verification

Reference model comparison is part of simulation-based or dynamic processor verification. The evidence contrasts it with formal verification: formal methods exhaustively examine possible execution paths but face scalability limits on complex modern processors, while simulation-based verification scales but checks only the finite set of paths exercised by supplied stimuli. [C8]

Related work

The MICRO-54 paper Effective Processor Verification with Logic Fuzzer Enhanced Co-simulation uses reference model comparison as part of its discussion of processor verification infrastructure and co-simulation. [C1]

CITATIONS

8 sources
8 citations
[1] A reference or golden model is a high-level software processor model that is fast, uncomplicated, omits implementation details, and changes architectural state at instruction-level granularity; reference model comparison checks that the implementation and model follow matching execution paths and architectural states. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[2] For randomly generated verification tests, self-checking techniques are not applicable due to the random nature of the generated tests, so execution can be compared with a reference model. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[3] End-of-simulation comparison runs the same code on the reference model and RTL implementation, dumps register-file and memory state at the end, and compares them; its drawbacks include hidden overwritten bugs and difficult debugging far from the divergence point. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[4] Trace comparison requires both models to dump execution logs, typically including program-counter flow and register or memory writebacks, and flags mismatches between the traces. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[5] Trace comparison fails for asynchronous external stimuli such as interrupts and debug requests because standalone models compared after execution can produce different logs from a single interrupt. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[6] Co-simulation runs the models in parallel with communication; at events such as instruction commit, the RTL signals the reference to commit and compare state, and a failed comparison immediately halts execution and reports the stimulus. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[7] To support asynchronous interrupts in co-simulation, the setup must allow messaging that overwrites the emulator execution path; when the RTL flags an interrupt, it informs the emulator to follow that path. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...
[8] Formal verification exhaustively examines execution paths but has scalability limits for complex processors, while simulation-based verification is scalable but covers only a finite set of execution paths driven by supplied stimuli. [PDF] Effective Processor Verification with Logic Fuzzer Enhanced Co ...