|
|||||
Combined coverage methodology speeds verification
Combined coverage methodology speeds verification Engineers are creating designs larger than ever before. As gate counts exceed one million, verification methodologies have failed to adjust, turning functional verification into the main bottleneck in the design process. The magnitude and complexity of recent designs introduces new challenges, including reducing the time it takes to do verification, and ensuring complete verification. Historically, engineers have used a few coverage metrics -- such as toggle coverage, bug rates and code coverage alone -- to evaluate the verification process. However, these metrics have limited capabilities for ensuring that their design functionality has been completely covered. What engineers need is a more complete coverage methodology -- one that encapsulates a combined coverage metric-functional coverage, code coverage and assertion coverage. These measurements are highly complementary. For instance, you can achieve one hundred percent functional coverage o f your design, and still not exercise some parts of the HDL code. Conversely, you can have one hundred percent code coverage, but miss testing corner case functionality of the design. Missing assertion coverage is an indication that "error" behavior has not been sufficiently exercised. A methodology based on all types of coverage should be used from early stages in the verification process, and is necessary to ensure complete coverage of the design. Types of coverage The set of features provided by code coverage tools usually includes line/block coverage, arc coverage for state machines, expression coverage, event coverage and toggle coverage. More recent code coverage tools also include capabilities that automatically extract finite state machines from the design and simplify the task of ensuring complete states and transition coverage. Code coverage is a necessity. Most people would agree it is unacceptable to synthesize code that is either dead or unverified. Nevertheless, code coverage is not enough. Most functional scenarios cannot be mapped into lines of code. For example, code coverage cannot indicate whether we've been through all the legal combination of states in two orthogonal state machines. Another example might be whether we have tried all the possible inputs while the design under test (DUT) was in all the different internal states. Also, code coverage does not look at sequences of events, such as what else happened before, during, or after a line of code has been executed. Thus, code coverage does not ensure completeness and does not fulfill most of the requirements that allow expediting the verification task. In general, three inherent limitations of code coverage tools are: overlooking non-implemented features, the inability to measure the interaction between multiple modules, and the ability to measure simultaneous events or sequences of events. On the other hand, functional coverage perceives the design from a user's or a system point of view. Functional coverage tells you which functions have been tested, and which have not. For instance, have you covered all of your typical scenarios? Error cases? Corner cases? Protocols? Functional coverage also allows questions such as, "OK, I've covered every state in my state machine, but did I ever have an interrupt at the same time? When the input buffer was full, did I have all types of packets injected? Did I ever inject two erroneous packets in a row?" The bulk of low-level details may be hidden from the report reviewer. Functional coverage elevates the discussion to specific transactions or sequences of transactions without overwhelming the verification engineer with bit vectors and signal names. This level of abstraction enables natural translation from cover age results to test plan items. Figure 1, below, provides an example of functional coverage in an environment that creates many simulation scenarios. Figure 1 -- Functional coverage serves multiple simulation scenarios Functional coverage provides an excellent indication of how we're meeting the goals set by the test plan. However, it may not correlate exactly to the actual RTL implementation, which may have diverged over time. For example, code coverage results can find a "hole" in the test plan -- functionality that is implemented in the RTL, but never targeted by the test plan. Therefore, code coverage and functional coverage are complementary. Table 1 illustrates how functional coverage and code coverage correlate to each other, and how the combination of both provides a much more reliable indication of complete coverage.
Table 1 -- Correlation between functional coverage and code coverage Assertions are representations of properties used during simulation as protocol checkers. They can also be leveraged as properties to be proven with formal and semi-formal tools. When they are used in simulation, there is the potential that a test, or a suite of tests, may not come to the condition that the assertion is looking for. More importantly, since many assertions can be triggered by complex conditions, it's important to know what triggered the assertion and whether or not an error was reported. Assertion coverage gives a clear understanding of what potential error behavior was covered and properties and conditions that have not yet been exercised. While error behavior is important, assertion coverage adds incremental value and is not a sufficient metric for verification on its own. Coverage requirements The requirements for coverage can be categorized into two groups: demands for the data gathering and analysis engine, and requirements for the surrounding testbench that will allow efficient usage of the accumulated information. Coverage engine requirements Informative reports Efficient coverage analysis Testbase ranking
The coverage tool should allow the engineer to analyze the coverage information both between simulations and during a test run. The first approach requires the ability to save the collected information to be reviewed later on. The second approach requires a run-time interface to the coverage database that allows it to be used during simulation. Grading Optimizing the test suite Open environment Methodology requirements
The recommended approach to coverage Phase one: Test plan An encompassing test plan is a good start to ensure complete verification. Experience and creativity can be used to identify areas that are prone to bugs. It is advisable to consult people with extensive verification background and the designer to get internal insights into the design. Note that no test plan can cover every possible bug, which highlights the importance of directed-random test generation. However, a good test plan is still essential to an efficient verification strategy and becomes the basis for a functional coverage model. Phase two: Functional coverage specification Phase three: Build the testbench Phase four: Writing tests and simulation Note that from the beginning, the best tests are directed-random tests. In other words, your tests should be targeted at a specifi c area, but anything that need not be specified should be randomized. By changing the random seed, each test can become thousands of tests, each testing the same target from different paths and randomizing data. This is the most efficient way to increase coverage and find bugs! Phase five: Code coverage integration At the same time identify the untested functionality. Once identified, review your test plan and make sure it is not an overlooked area in the test plan. Update the test plan and functional and assertion coverage code as necessary. Phase six: Thorough coverage Phase seven: Regression testing Conclusion Sharon Rosenberg is a Senior Consulting Engineer at Verisity Design, Inc. Over the last few years since he joined the company, Sharon has held various positions in Verisity, including research and developmentfield work with Verisity's customers, verification methodology development and technical marketing.
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |