Basic definition of Functional coverage
Functional coverage is the determination of how much functionality of the design has been exercised by the verification environment. Let us explain this with a simple example:
If your manager told you to prove that the set of regression tests created for a particular design was exercising all the functionality defined in the specification. How would you go about proving?
- You would show the list of tests in the regression suite and correlation of those tests to the functionality defined in the specification.
- You would need to prove that the test executed the functionality, it is supposed to check.
- Finally, you would create a list showing each function and check off those that were exercised.
- From this list you would extract a metric showing number of functions exercised divided by total number of functions to be checked.
This is probably what you would present to your manager. This is functional coverage. The difficulty is that it is a too much of manual process; Today's design requires more structured approach.
There are two magical questions that every design team ask and answer.
- Is my chip functioning properly?
- Am I done verifying the chip?
Proper execution of each test in a test suite is measure of functional coverage. Each test is created to check the particular functionality of a specification. Therefore, it is natural we assume that if it were proven that each test is completed properly, then the entire set of functionality is verified. This assumes that each test has been verified to exercise the functionality for which it was created. In many cases this verification is performed manually. This type of manual checking is both time consuming and error prone. There appears to be a confusion in the industry what constitutes a functional coverage.
Code coverage
This will give information about how many lines are executed, how many times expressions, branches executed. This coverage is collected by the simulation tools. Users use this coverage to reach those corner cases which are not hit by the random test cases. Users have to write the directed test cases to reach the missing code coverage areas.
Both of them have equal importance in the verification. 100% functional coverage does not mean that the DUT is completely exercised and vice-versa. Verification engineers will consider both coverages to measure the verification progress.
I would like to explain this difference with a simple example. Let's say, the specification talks about 3 features, A, B, and C. And let's say that the RTL designed coded only feature A and B.If the test exercises only feature A and B, then you can 100% code coverage. Thus, even if you have 100% code coverage, you have a big hole (feature C) in the design.So, the verification engineer, has to write functional coverage code for A, B and C and 100% functional coverage means, there are tests for all the features, which the verification engineer has thought of.
The role of coverage in verification environment
Both functional and code coverage are complementary to each other, meaning that 100% functional coverage doesn't imply 100% code coverage; 100% code coverage - still has to achieve functional coverage goals.
Identify the coverage holes
One of the most important of functional verification is to identify the coverage holes in the coverage space The goal for any successful verification is to achieve the specified target goals with least amount of simulation cycle.
Limitation of functional coverage
- There is not a defined list of 100% functionality of the design is and therefore, there may be a missing functionality in the list.
- There is no real way to check that the coverage model is correct, manual check is the only way.