Microprocessor Design Verification:Correctness Checking
Correctness Checking
Correctness checking is the process of isolating a design error by determining whether the simulation test was successful. In this section, we discuss three techniques for correctness checking: self-checking, reference model comparison, and assertion checking. The three methods are complementary and are often used in conjunction to achieve the highest coverage. Figure 64.4 illustrates the three correctness checkers in the verification flow of the Alpha 21164 microprocessor [4].
Self-checking
Self-checking is the simplest way to determine success for focused, hand-coded tests. The test program sets up a combination of conditions and then checks to see if the RTL model reacted correctly to the simulated situation [11]. However, this approach is time consuming, prone to error, and intrusive at the register transfer level. The test generator may be required to maintain an extensive amount of state. Furthermore, the technique is often not useful beyond a single focused test.
Reference Model Comparison
An alternative to self-checking is to compare the traces generated by the RTL model with the simulation traces of an architectural reference model, as illustrated in Figure 64.2. This technique, known as reference model comparison, obviates the need for constantly checking the state of the processor being simulated. The reference model is an abstraction of the design architecture written in a high-level language such as C++. It represents all features visible to software, including the instruction set and support for memory and I/O space [4].
Several correctness checks may be performed using the reference model, of which the simplest is end- of-state comparison. When simulation completes, the contents of memory locations are accessed, and the final state of the register files are compared. However, end-of-state comparison is not very useful for lengthy simulations because it may be difficult to identify incorrect intermediate results, which are overwritten during simulation. Comparing intermediate results during simulation is a solution; however, this requires the reference model to match the timing of the RTL model, and is not easily implemented. Additional comparisons that can be made include checking the PC flow and checking writes to integer and floating-point registers. Incorrect values here will signal problems with control-flow and data manipulation instructions.
Assertion Checking
Assertion checking, another popular means to check correctness, is the process of adding segments of code to the RTL model to verify that certain properties of design behavior always hold true under simulation. Examples of simple assertion checking include monitoring illegal states and invalid transi- tions. More complex checking involves monitoring queue overruns and violation of the bus protocol [7]. An example of a specialized assertion checker is the cache coherency checker used in the verification of the Alpha 21164 microprocessor [4]. The system supports three levels of caching, with the second- and third-level caches being write-back. Cache coherency checking was activated at regular intervals during simulation to ensure that coherency rules were not violated. Table 64.2 presents the origins of bugs introduced into the design and the percentages of bugs detected by the various correctness checking mechanisms for the Alpha 21264 microprocessor [7]. Assertion checkers were the most successful; however, when viewed collectively, 44% of errors were found by reference model comparison.
With the correctness checking problem examined, the next major issue in simulation-based verification is determining whether acceptable levels of coverage have been achieved by the simulation vectors. In the next section, we look at several techniques for coverage analysis.
Comments
Post a Comment