Enter into Zilicon Zone

VLSI-world's feed

RocketTheme Joomla Templates


Read more...
Code coverage Print E-mail
Save this page
Delicious
YahooMyWeb
Stumble
NewsVine
Reddit
YahooMyWeb
Technorati

Code Coverage It is a process of validating or finding the quality of the test bench for RTL code for a particular design. This is a measurement which tells how good the design has been exercised with the test bench / test cases.

Code coverage is applied to DUT (Design Under Test) to check how thoroughly the HDL exercised by test suite. Code coverage points the portion of code which did not exercised,it also points the corner/edge cases, unused/dead code.

There are varieties of tools available in the market for code coverage. Modelsim (From MentorGraphics) and ICC (From Cadence) are some examples of those.

With out code coverage tools designer can only say the simulation output is the expected one or not. But he will not know whether he needs more test cases or not. With help of code coverage it is very easy to know how well the HDL code exercised. From the code coverage result it is easy to determine how more TCs needed for a complete test.

Well, what are the things to be checked during code coverage? Or what are the types of code coverage? Following text describes the types of coverage which are applied together or separately. There will be a possibility to enable or disable any one particular type of the coverage during the process.

Block coverage - When block coverage enabled the tool monitors all exercisable blocks in the HDL code. Block is a statement or sequence of statements that executes with no branches and delays. Assume there are 100 blocks in one design but only 75 blocks are exercised with test suite then the block coverage is 75%. So it is sure that the design needs more test cases to exercise the complete logic.

Branch coverage- In a 'case' or 'if-else' there may be more the one branch in the design. Test case should exercise all branches for the completeness. Often some cases in a case statement of else part of 'if-else' statement will be missed. Branch coverage will identify those errors. A snippet of code considered 100% covered with branch coverage when all the branches of code executed at least once. Some time it is referred as decision coverage. Branch coverage also applied to case statements, like the following: 

case (z)
  
1 : x=0;
  
2 : x=10;
  
3 : x=20;
endcase

In this example, branch coverage will identify whether each of the three branches of the Case statement is taken.

 
VLSI-world.com