01.Home - nayanarudramurthy/functional-coverage GitHub Wiki
Coverage
Coverage is a generic term for measuring progress to complete design verification. Coverage report are read in percentage.
Need for coverage
To help us to understand whether all features of design is measured and to know whether every line in the code is executed or not.
Types of coverage
- Code Coverage
- Functional Coverage
Code Coverage
Code coverage deals with the implementation part that is, it checks whether your tests exercised the “implementation” of the design specification, but it won’t check the verification plan. It will measures the quality of testcase
- Line Coverage: Checks how many lines have been executed.
- Path Coverage: Checks in which path the code have been executed.
- Toggle Coverage: Checks which single bit variable have/had the values 0 or 1.
- FSM Coverage: Checks which state and transitions in a state machine have been visited.
Limitation
It depends on design code so it can measure coverage for the code which has been written, but cannot say anything about the software that has not been written.
Functional Coverage
Functional coverage defines how much of the design specification has been exercised in verification or Functional coverage measures the progress of all tests in fulfilling the verification plan requirements. It measures the quality of DV.
Limitation
If there are 15 features in the design and if we mentioned only 10 features of them, it will conclude that all the featured are covered. So make sure to include all design features is included in functional coverage block.
Need
Functional coverage is needed to track whether all the DUT features have been verified and measures the quality of verification. Functional coverage help us to target the DUT features that are unverified.
Difference between Functional Coverage and Code Coverage
Sl.No. | Functional Coverage | Code Coverage |
---|---|---|
1. | Checks how well the stimulus is covering various functionality | Checks how well code is tested by stimulus |
2. | If any block of code is missing in the design, functional coverage can identify that mistake | If any block of code is missing in the design, code coverage cannot identify that mistake |
3. | Depends on design specification | Depends on design code |
Coverage comparison
When functional coverage and code coverage are low
- It is the start of the project
When functional coverage is high and code coverage is low
- Code needs more cover points/cases
- Dead code
- It is possible that test plan is missing some features to cover
When functional coverage is low and code coverage is high
- Poor quality of stimulus(try different seeds)
When functional coverage and code coverage are high
- End of the design and check for the bug rate