Q: on code coverage and functional coverage?

Hi Dave,
can please give a brief description on below three points.

  1. If my code coverage is 100% and functional coverage is 80% . How to improve functional coverage?
  2. If my functional coverage is 100% and code coverage is 80%. How to improve code coverage?
    3)If both code coverage and functional coverage is 100% . Is my verification is successfully completed?

In reply to Jaygyana:

  1. you need to see where the gap is and tweak the testbench to hit those scenarios, if it is not possible to hit that, then you might have to exclude those.
  2. you dont need to get 100%. Review the code and see if there is any dead logic or real scenarios your test doesnt exercise it.
  3. Not necessarily.

In reply to rag123:
3) Not necessarily. [/quote]

To expand upon this, coverage by itself, whether it’s code or functional, is concerned about covering inputs, outputs, and DUT state. For the given inputs though, you still need to check that the DUT outputs and state are correct. The checker logic might have gaps.

1) If my code coverage is 100% and functional coverage is 80% . How to improve functional coverage?
→ you don’t have test cases which are covering the functional scenarios which are coded in functional coverage. so you need to create the test cases which can exercise those functional scenarios.

2) If my functional coverage is 100% and code coverage is 80%. How to improve code coverage?
→ There is hole in your functional coverage. you don’t have test cases which exercise those code. So write the test cases which exercise those code and modify the functional coverage code to add those missing functional scenarios.
→ There is also chance that design having the dead code.

3)If both code coverage and functional coverage is 100% . Is my verification is successfully completed?
→ No!!! Do multiple reviews of the test cases and functional coverage.
→ Do review the waveform of few test cases to check test is doing as expected.
→ Do read the specification multiple time and check that there is functional coverage for each functional scenario.

In reply to Jaygyana:

  1. Check the test plan if there is any coverpoints to be hit in high priority, In that case do write a test case to target the bins. If those bins are not a priority then please check with the design engineers and after consulting do exclude those coverpoints.

  2. Again check with the design team whether the scenario is valid and whether it should be validated in verification. If so please do write targeted test cases to cover your your (Toggle, fsm, condi, branch) metric which is not hitting. If not on high priority please exclude them.

3)Yeah absolutely if the coverage metrics were hitting as per the test plan. In that case your Functional Verification is 100 %.