For each loaded and merged test, all the source instances (module instances) are progressively scanned for the total number of coverable objects and the total number of covered objects. A running tally is maintained for each coverage metric.
In the previous code, ‘covered’ is the sum of all covered objects for all instances. Note the UCAPI property covdbDeepCovered returns the total coverable objects for each design module instance. The value allcoverable[m] stores the total number of coverable objects for each metric using the UCAPI property covdbDeepCoverable at the instance level. The property covdbDeepCovered is called at the test level to get the covered items for each test, while covdbDeepCoverable is called at the design level to get the total coverable for the design, i.e., we want to be able to look at total possible coverable objects for a given design and then look at the contribution of each test to the number of covered items.
Once the number of covered and coverable objects is obtained, the incremental value is calculated:
incr = covered – allcovered[m];
The score is then calculated for each test:
metincrscore = (100.0 * incr) / allcoverable[m];
The score, metincrscore, is a score for each test which represents the incremental number of covered items relative to the total number of possible coverable items.
Similarly, the total score is reported as:
metscore = (100.0 * covered) / allcoverable[m] ;
Sample output from a small run is illustrated below: