assertion.c File Reference

#include <stdio.h>
#include <assert.h>
#include "assertion.h"
#include "defines.h"
#include "profiler.h"
#include "util.h"

Functions

void assertion_parse (const char *arg)
 Parses -A command-line option to score command.
void assertion_parse_attr (attr_param *ap, int line, const func_unit *funit, bool exclude)
 Parses an in-line attribute for assertion coverage information.
void assertion_get_stats (const func_unit *funit, unsigned int *hit, unsigned int *excluded, unsigned int *total)
 Gather statistics for assertion coverage.
static bool assertion_display_instance_summary (FILE *ofile, const char *name, int hits, int total)
static bool assertion_instance_summary (FILE *ofile, const funit_inst *root, const char *parent_inst, int *hits, int *total)
static bool assertion_display_funit_summary (FILE *ofile, const char *name, const char *fname, int hits, int total)
static bool assertion_funit_summary (FILE *ofile, const funit_link *head, int *hits, int *total)
static void assertion_display_verbose (FILE *ofile, const func_unit *funit, rpt_type rtype)
static void assertion_instance_verbose (FILE *ofile, funit_inst *root, char *parent_inst)
static void assertion_funit_verbose (FILE *ofile, const funit_link *head)
void assertion_report (FILE *ofile, bool verbose)
 Generates report output for assertion coverage.
void assertion_get_funit_summary (func_unit *funit, unsigned int *hit, unsigned int *excluded, unsigned int *total)
 Retrieves the total and hit counts of assertions for the specified functional unit.
void assertion_collect (func_unit *funit, int cov, char ***inst_names, int **excludes, unsigned int *inst_size)
 Collects uncovered and covered assertion instance names for the given module.
void assertion_get_coverage (const func_unit *funit, const char *inst_name, char **assert_mod, str_link **cp_head, str_link **cp_tail)
 Gets missed coverage point descriptions for the given assertion module.

Variables

db ** db_list
unsigned int curr_db
bool report_covered
bool report_instance
isuppl info_suppl
bool report_exclusions

Detailed Description

Author:
Trevor Williams (phase1geo@gmail.com)
Date:
4/4/2006

Function Documentation

void assertion_collect ( func_unit funit,
int  cov,
char ***  inst_names,
int **  excludes,
unsigned int *  inst_size 
)

Collects uncovered and covered assertion instance names for the given module.

Searches the specified functional unit, collecting all uncovered or covered assertion module instance names.

Parameters:
funit Pointer to functional unit
cov Specifies if uncovered (0) or covered (1) assertions should be looked for
inst_names Pointer to array of uncovered instance names found within the specified functional unit
excludes Pointer to array of integers that contain the exclude information for the given instance names
inst_size Number of valid elements in the uncov_inst_names array

References isuppl_u::assert_ovl, ovl_collect(), isuppl_u::part, PROFILE, and PROFILE_END.

00507   { PROFILE(ASSERTION_COLLECT);
00508   
00509   /* Initialize outputs */
00510   *inst_names = NULL;
00511   *excludes   = NULL;
00512   *inst_size  = 0;
00513     
00514   /* If OVL assertion coverage is needed, get this information */
00515   if( info_suppl.part.assert_ovl == 1 ) {
00516     ovl_collect( funit, cov, inst_names, excludes, inst_size );
00517   }
00518     
00519   PROFILE_END;
00520 
00521 }

static bool assertion_display_funit_summary ( FILE *  ofile,
const char *  name,
const char *  fname,
int  hits,
int  total 
) [static]
Returns:
Returns TRUE if at least one assertion was found to be not hit; otherwise, returns FALSE.

Displays the assertion summary information for a given instance to the specified output stream.

Parameters:
ofile Pointer to file handle to output instance summary results to
name Name of functional unit being reported
fname Name of file containing the given functional unit
hits Total number of assertions hit in the given functional unit
total Total number of assertions in the given functional unit

References calc_miss_percent(), PROFILE, and PROFILE_END.

Referenced by assertion_funit_summary(), and assertion_report().

00197   { PROFILE(ASSERTION_DISPLAY_FUNIT_SUMMARY);
00198 
00199   float percent;  /* Percentage of assertions hit */
00200   int   miss;     /* Number of assertions missed */
00201 
00202   calc_miss_percent( hits, total, &miss, &percent );
00203 
00204   fprintf( ofile, "  %-20.20s    %-20.20s   %5d/%5d/%5d      %3.0f%%\n",
00205            name, fname, hits, miss, total, percent );
00206 
00207   PROFILE_END;
00208 
00209   return( miss > 0 );
00210 
00211 }

static bool assertion_display_instance_summary ( FILE *  ofile,
const char *  name,
int  hits,
int  total 
) [static]
Returns:
Returns TRUE if at least one assertion was found to be not hit; otherwise, returns FALSE.

Displays the assertion summary information for a given instance to the specified output stream.

Parameters:
ofile Pointer to file handle to output instance summary results to
name Name of instance being reported
hits Total number of assertions hit in the given instance
total Total number of assertions in the given instance

References calc_miss_percent(), PROFILE, and PROFILE_END.

Referenced by assertion_instance_summary(), and assertion_report().

00105   { PROFILE(ASSERTION_DISPLAY_INSTANCE_SUMMARY);
00106 
00107   float percent;  /* Percentage of assertions hit */
00108   int   miss;     /* Number of assertions missed */
00109 
00110   calc_miss_percent( hits, total, &miss, &percent );
00111 
00112   fprintf( ofile, "  %-43.43s    %5d/%5d/%5d      %3.0f%%\n",
00113            name, hits, miss, total, percent );
00114 
00115   PROFILE_END;
00116 
00117   return( miss > 0 );
00118 
00119 }

static void assertion_display_verbose ( FILE *  ofile,
const func_unit funit,
rpt_type  rtype 
) [static]

Displays the verbose hit/miss assertion information for the given functional unit.

Parameters:
ofile Pointer to the file to output the verbose information to
funit Pointer to the functional unit to display
rtype Type of report output to generate

References isuppl_u::assert_ovl, ovl_display_verbose(), isuppl_u::part, PROFILE, PROFILE_END, RPT_TYPE_EXCL, RPT_TYPE_HIT, and RPT_TYPE_MISS.

Referenced by assertion_funit_verbose(), and assertion_instance_verbose().

00266   { PROFILE(ASSERTION_DISPLAY_VERBOSE);
00267 
00268   switch( rtype ) {
00269     case RPT_TYPE_HIT  :  fprintf( ofile, "    Hit Assertions\n\n" );       break;
00270     case RPT_TYPE_MISS :  fprintf( ofile, "    Missed Assertions\n\n" );    break;
00271     case RPT_TYPE_EXCL :  fprintf( ofile, "    Excluded Assertions\n\n" );  break;
00272   }
00273 
00274   /* If OVL assertion coverage is needed, output it in the OVL style */
00275   if( info_suppl.part.assert_ovl == 1 ) {
00276     ovl_display_verbose( ofile, funit, rtype );
00277   }
00278 
00279   fprintf( ofile, "\n" );
00280 
00281   PROFILE_END;
00282 
00283 }

static bool assertion_funit_summary ( FILE *  ofile,
const funit_link head,
int *  hits,
int *  total 
) [static]
Returns:
Returns TRUE if at least one assertion was found to not be covered in this functional unit; otherwise, returns FALSE.

Outputs the functional unit summary assertion coverage information for the given functional unit to the given output file.

Parameters:
ofile Pointer to output file to display summary information to
head Pointer to the current functional unit link to evaluate
hits Pointer to the number of assertions hit in all functional units
total Pointer to the total number of assertions found in all functional units

References statistic_s::assert_hit, isuppl_u::assert_ovl, statistic_s::assert_total, assertion_display_funit_summary(), FALSE, func_unit_s::filename, free_safe, funit_link_s::funit, funit_flatten_name(), funit_is_unnamed(), get_basename(), funit_link_s::next, obf_file, ovl_is_assertion_module(), isuppl_u::part, PROFILE, PROFILE_END, scope_gen_printable(), statistic_s::show, and func_unit_s::stat.

Referenced by assertion_report().

00225   { PROFILE(ASSERTION_FUNIT_SUMMARY);
00226 
00227   bool miss_found = FALSE;  /* Set to TRUE if assertion was found to be missed */
00228 
00229   while( head != NULL ) {
00230 
00231     /* If this is an assertion module, don't output any further */
00232     if( head->funit->stat->show && !funit_is_unnamed( head->funit ) &&
00233         ((info_suppl.part.assert_ovl == 0) || !ovl_is_assertion_module( head->funit )) ) {
00234 
00235       /* Get printable version of functional unit name */
00236       /*@only@*/ char* pname = scope_gen_printable( funit_flatten_name( head->funit ) );
00237 
00238       miss_found |= assertion_display_funit_summary( ofile, pname, get_basename( obf_file( head->funit->filename ) ),
00239                                                      head->funit->stat->assert_hit, head->funit->stat->assert_total );
00240 
00241       /* Update accumulated information */
00242       *hits  += head->funit->stat->assert_hit;
00243       *total += head->funit->stat->assert_total;
00244 
00245       free_safe( pname, (strlen( pname ) + 1) );
00246 
00247     }
00248 
00249     head = head->next;
00250 
00251   }
00252 
00253   PROFILE_END;
00254 
00255   return( miss_found );
00256 
00257 }

static void assertion_funit_verbose ( FILE *  ofile,
const funit_link head 
) [static]

Outputs the functional unit verbose assertion coverage information for the given functional unit to the given output file.

Parameters:
ofile Pointer to the file to output the functional unit verbose information to
head Pointer to the current functional unit link to look at

References statistic_s::assert_excluded, statistic_s::assert_hit, statistic_s::assert_total, assertion_display_verbose(), func_unit_s::filename, free_safe, funit_link_s::funit, FUNIT_AFUNCTION, FUNIT_ANAMED_BLOCK, FUNIT_ATASK, funit_flatten_name(), FUNIT_FUNCTION, funit_is_unnamed(), FUNIT_MODULE, FUNIT_NAMED_BLOCK, FUNIT_TASK, funit_link_s::next, obf_file, PROFILE, PROFILE_END, report_covered, report_exclusions, RPT_TYPE_EXCL, RPT_TYPE_HIT, RPT_TYPE_MISS, scope_gen_printable(), func_unit_s::stat, and func_unit_s::type.

Referenced by assertion_report().

00365   { PROFILE(ASSERTION_FUNIT_VERBOSE);
00366 
00367   char* pname;  /* Printable version of functional unit name */
00368 
00369   while( head != NULL ) {
00370 
00371     if( !funit_is_unnamed( head->funit ) &&
00372         (((head->funit->stat->assert_hit < head->funit->stat->assert_total) && !report_covered) ||
00373          ((head->funit->stat->assert_hit > 0) && report_covered) ||
00374          ((head->funit->stat->assert_excluded > 0) && report_exclusions)) ) {
00375 
00376       /* Get printable version of functional unit name */
00377       pname = scope_gen_printable( funit_flatten_name( head->funit ) );
00378 
00379       fprintf( ofile, "\n" );
00380       switch( head->funit->type ) {
00381         case FUNIT_MODULE       :  fprintf( ofile, "    Module: " );       break;
00382         case FUNIT_ANAMED_BLOCK :
00383         case FUNIT_NAMED_BLOCK  :  fprintf( ofile, "    Named Block: " );  break;
00384         case FUNIT_AFUNCTION    :
00385         case FUNIT_FUNCTION     :  fprintf( ofile, "    Function: " );     break;
00386         case FUNIT_ATASK        :
00387         case FUNIT_TASK         :  fprintf( ofile, "    Task: " );         break;
00388         default                 :  fprintf( ofile, "    UNKNOWN: " );      break;
00389       }
00390       fprintf( ofile, "%s, File: %s\n", pname, obf_file( head->funit->filename ) );
00391       fprintf( ofile, "    -------------------------------------------------------------------------------------------------------------\n" );
00392 
00393       free_safe( pname, (strlen( pname ) + 1) );
00394 
00395       if( ((head->funit->stat->assert_hit < head->funit->stat->assert_total) && !report_covered) ||
00396           ((head->funit->stat->assert_hit > 0) && report_covered && (!report_exclusions || (head->funit->stat->assert_hit > head->funit->stat->assert_excluded))) ) {
00397         assertion_display_verbose( ofile, head->funit, (report_covered ? RPT_TYPE_HIT : RPT_TYPE_MISS) );
00398       }
00399       if( report_exclusions && (head->funit->stat->assert_excluded > 0) ) {
00400         assertion_display_verbose( ofile, head->funit, RPT_TYPE_EXCL );
00401       }
00402 
00403     }
00404 
00405     head = head->next;
00406 
00407   }
00408 
00409   PROFILE_END;
00410 
00411 }

void assertion_get_coverage ( const func_unit funit,
const char *  inst_name,
char **  assert_mod,
str_link **  cp_head,
str_link **  cp_tail 
)

Gets missed coverage point descriptions for the given assertion module.

Finds all of the coverage points for the given assertion instance and stores their string descriptions and execution counts in the cp list.

Parameters:
funit Pointer to functional unit
inst_name Name of assertion module instance to retrieve
assert_mod Pointer to assertion module name and filename being retrieved
cp_head Pointer to head of list of strings/integers containing coverage point information
cp_tail Pointer to tail of list of strings/integers containing coverage point information

References isuppl_u::assert_ovl, ovl_get_coverage(), isuppl_u::part, PROFILE, and PROFILE_END.

00533   { PROFILE(ASSERTION_GET_COVERAGE);
00534 
00535   /* Find functional unit */
00536   *cp_head = *cp_tail = NULL;
00537 
00538   /* If OVL assertion coverage is needed, get this information */
00539   if( info_suppl.part.assert_ovl == 1 ) {
00540     ovl_get_coverage( funit, inst_name, assert_mod, cp_head, cp_tail );
00541   }
00542 
00543   PROFILE_END;
00544  
00545 }

void assertion_get_funit_summary ( func_unit funit,
unsigned int *  hit,
unsigned int *  excluded,
unsigned int *  total 
)

Retrieves the total and hit counts of assertions for the specified functional unit.

Counts the total number and number of hit assertions for the specified functional unit.

Parameters:
funit Pointer to functional unit
hit Pointer to the number of hit assertions in the specified functional unit
excluded Pointer to the number of excluded assertions
total Pointer to the total number of assertions in the specified functional unit

References isuppl_u::assert_ovl, ovl_get_funit_stats(), isuppl_u::part, PROFILE, and PROFILE_END.

00483   { PROFILE(ASSERTION_GET_FUNIT_SUMMARY);
00484         
00485   /* Initialize total and hit counts */
00486   *hit      = 0;
00487   *excluded = 0;
00488   *total    = 0;
00489   
00490   if( info_suppl.part.assert_ovl == 1 ) {
00491     ovl_get_funit_stats( funit, hit, excluded, total );
00492   }
00493     
00494   PROFILE_END;
00495   
00496 }

void assertion_get_stats ( const func_unit funit,
unsigned int *  hit,
unsigned int *  excluded,
unsigned int *  total 
)

Gather statistics for assertion coverage.

Gets total and hit assertion coverage statistics for the given functional unit.

Parameters:
funit Pointer to current functional unit
hit Pointer to the total number of hit assertions in this functional unit
excluded Pointer to the number of excluded assertions
total Pointer to the total number of assertions found in this functional unit

References isuppl_u::assert_ovl, ovl_get_funit_stats(), isuppl_u::part, PROFILE, and PROFILE_END.

Referenced by report_gather_funit_stats(), and report_gather_instance_stats().

00077   { PROFILE(ASSERTION_GET_STATS);
00078 
00079   assert( funit != NULL );
00080 
00081   /* Initialize total and hit values */
00082   *hit      = 0;
00083   *excluded = 0;
00084   *total    = 0;
00085 
00086   /* If OVL assertion coverage is needed, check this functional unit */
00087   if( info_suppl.part.assert_ovl == 1 ) {
00088     ovl_get_funit_stats( funit, hit, excluded, total );
00089   }
00090 
00091   PROFILE_END;
00092 
00093 }

static bool assertion_instance_summary ( FILE *  ofile,
const funit_inst root,
const char *  parent_inst,
int *  hits,
int *  total 
) [static]
Returns:
Returns TRUE if at least one assertion was found to not be covered in this function unit instance; otherwise, returns FALSE.

Outputs the instance summary assertion coverage information for the given functional unit instance to the given output file.

Parameters:
ofile Pointer to the file to output the instance summary information to
root Pointer to the current functional unit instance to look at
parent_inst Scope of parent instance of this instance
hits Pointer to number of assertions hit in given instance tree
total Pointer to total number of assertions found in given instance tree

References statistic_s::assert_hit, isuppl_u::assert_ovl, statistic_s::assert_total, assertion_display_instance_summary(), funit_inst_s::child_head, db_is_unnamed_scope(), FALSE, free_safe, funit_inst_s::funit, funit_is_unnamed(), funit_inst_s::name, funit_inst_s::name_diff, funit_inst_s::next, ovl_is_assertion_module(), isuppl_u::part, PROFILE, PROFILE_END, scope_gen_printable(), statistic_s::show, funit_inst_s::stat, and funit_inst_s::suppl.

Referenced by assertion_report().

00134   { PROFILE(ASSERTION_INSTANCE_SUMMARY);
00135 
00136   funit_inst* curr;                /* Pointer to current child functional unit instance of this node */
00137   char        tmpname[4096];       /* Temporary holder of instance name */
00138   char*       pname;               /* Printable version of instance name */
00139   bool        miss_found = FALSE;  /* Set to TRUE if assertion was missed */
00140 
00141   assert( root != NULL );
00142   assert( root->stat != NULL );
00143 
00144   /* Get printable version of the instance name */
00145   pname = scope_gen_printable( root->name );
00146 
00147   /* Calculate instance name */
00148   if( db_is_unnamed_scope( pname ) || root->suppl.name_diff ) {
00149     strcpy( tmpname, parent_inst );
00150   } else if( strcmp( parent_inst, "*" ) == 0 ) {
00151     strcpy( tmpname, pname );
00152   } else {
00153     /*@-retvalint@*/snprintf( tmpname, 4096, "%s.%s", parent_inst, pname );
00154   }
00155 
00156   free_safe( pname, (strlen( pname ) + 1) );
00157 
00158   if( (root->funit != NULL) && root->stat->show && !funit_is_unnamed( root->funit ) &&
00159       ((info_suppl.part.assert_ovl == 0) || !ovl_is_assertion_module( root->funit )) ) {
00160 
00161     miss_found |= assertion_display_instance_summary( ofile, tmpname, root->stat->assert_hit, root->stat->assert_total ); 
00162 
00163     /* Update accumulated information */
00164     *hits  += root->stat->assert_hit;
00165     *total += root->stat->assert_total;
00166 
00167   }
00168 
00169   /* If this is an assertion module, don't output any further */
00170   if( (info_suppl.part.assert_ovl == 0) || !ovl_is_assertion_module( root->funit ) ) {
00171 
00172     curr = root->child_head;
00173     while( curr != NULL ) {
00174       miss_found |= assertion_instance_summary( ofile, curr, tmpname, hits, total );
00175       curr = curr->next;
00176     }
00177 
00178   }
00179 
00180   PROFILE_END;
00181 
00182   return( miss_found );
00183 
00184 }

static void assertion_instance_verbose ( FILE *  ofile,
funit_inst root,
char *  parent_inst 
) [static]

Outputs the instance verbose assertion coverage information for the given functional unit instance to the given output file.

Parameters:
ofile Pointer to the file to output the instance verbose information to
root Pointer to the current functional unit instance to look at
parent_inst Scope of parent of this functional unit instance

References statistic_s::assert_excluded, statistic_s::assert_hit, statistic_s::assert_total, assertion_display_verbose(), funit_inst_s::child_head, db_is_unnamed_scope(), func_unit_s::filename, free_safe, funit_inst_s::funit, FUNIT_AFUNCTION, FUNIT_ANAMED_BLOCK, FUNIT_ATASK, funit_flatten_name(), FUNIT_FUNCTION, funit_is_unnamed(), FUNIT_MODULE, FUNIT_NAMED_BLOCK, FUNIT_TASK, funit_inst_s::name, funit_inst_s::name_diff, funit_inst_s::next, obf_file, PROFILE, PROFILE_END, report_covered, report_exclusions, RPT_TYPE_EXCL, RPT_TYPE_HIT, RPT_TYPE_MISS, scope_gen_printable(), funit_inst_s::stat, funit_inst_s::suppl, and func_unit_s::type.

Referenced by assertion_report().

00293   { PROFILE(ASSERTION_INSTANCE_VERBOSE);
00294 
00295   funit_inst* curr_inst;      /* Pointer to current instance being evaluated */
00296   char        tmpname[4096];  /* Temporary name holder for instance */
00297   char*       pname;          /* Printable version of functional unit name */
00298 
00299   assert( root != NULL );
00300 
00301   /* Get printable version of instance name */
00302   pname = scope_gen_printable( root->name );
00303 
00304   if( db_is_unnamed_scope( pname ) || root->suppl.name_diff ) {
00305     strcpy( tmpname, parent_inst );
00306   } else if( strcmp( parent_inst, "*" ) == 0 ) {
00307     strcpy( tmpname, pname );
00308   } else {
00309     snprintf( tmpname, 4096, "%s.%s", parent_inst, pname );
00310   }
00311 
00312   free_safe( pname, (strlen( pname ) + 1) );
00313 
00314   if( !funit_is_unnamed( root->funit ) &&
00315       (((root->stat->assert_hit < root->stat->assert_total) && !report_covered) ||
00316        ((root->stat->assert_hit > 0) && report_covered) ||
00317        ((root->stat->assert_excluded > 0) && report_exclusions)) ) {
00318 
00319     /* Get printable version of functional unit name */
00320     pname = scope_gen_printable( funit_flatten_name( root->funit ) );
00321 
00322     fprintf( ofile, "\n" );
00323     switch( root->funit->type ) {
00324       case FUNIT_MODULE       :  fprintf( ofile, "    Module: " );       break;
00325       case FUNIT_ANAMED_BLOCK :
00326       case FUNIT_NAMED_BLOCK  :  fprintf( ofile, "    Named Block: " );  break;
00327       case FUNIT_AFUNCTION    :
00328       case FUNIT_FUNCTION     :  fprintf( ofile, "    Function: " );     break;
00329       case FUNIT_ATASK        :
00330       case FUNIT_TASK         :  fprintf( ofile, "    Task: " );         break;
00331       default                 :  fprintf( ofile, "    UNKNOWN: " );      break;
00332     }
00333     fprintf( ofile, "%s, File: %s, Instance: %s\n", pname, obf_file( root->funit->filename ), tmpname );
00334     fprintf( ofile, "    -------------------------------------------------------------------------------------------------------------\n" );
00335 
00336     free_safe( pname, (strlen( pname ) + 1) );
00337 
00338     if( ((root->stat->assert_hit < root->stat->assert_total) && !report_covered) ||
00339         ((root->stat->assert_hit > 0) && report_covered && (!report_exclusions || (root->stat->assert_hit > root->stat->assert_excluded))) ) {
00340       assertion_display_verbose( ofile, root->funit, (report_covered ? RPT_TYPE_HIT : RPT_TYPE_MISS) );
00341     }
00342     if( report_exclusions && (root->stat->assert_excluded > 0) ) {
00343       assertion_display_verbose( ofile, root->funit, RPT_TYPE_EXCL );
00344     }
00345 
00346   }
00347 
00348   curr_inst = root->child_head;
00349   while( curr_inst != NULL ) {
00350     assertion_instance_verbose( ofile, curr_inst, tmpname );
00351     curr_inst = curr_inst->next;
00352   }
00353 
00354   PROFILE_END;
00355 
00356 }

void assertion_parse ( const char *  arg  ) 

Parses -A command-line option to score command.

Parameters:
arg Command-line argument specified in -A option to score command to parse

Parses the specified command-line argument as an assertion to consider for coverage.

References PROFILE, and PROFILE_END.

00050                                                     { PROFILE(ASSERTION_PARSE);
00051 
00052   PROFILE_END;
00053 
00054 }

void assertion_parse_attr ( attr_param ap,
int  line,
const func_unit funit,
bool  exclude 
)

Parses an in-line attribute for assertion coverage information.

Parses the specified assertion attribute for assertion coverage details.

Parameters:
ap Pointer to attribute to parse
line First line number of assertion
funit Pointer to current functional unit containing this attribute
exclude If TRUE, excludes this assertion from coverage consideration

References PROFILE, and PROFILE_END.

Referenced by attribute_parse().

00064   { PROFILE(ASSERTION_PARSE_ATTR);
00065 
00066   PROFILE_END;
00067 }

void assertion_report ( FILE *  ofile,
bool  verbose 
)

Generates report output for assertion coverage.

Outputs assertion coverage report information to the given file handle.

Parameters:
ofile File to output report contents to
verbose Specifies if verbose report output needs to be generated

References assertion_display_funit_summary(), assertion_display_instance_summary(), assertion_funit_summary(), assertion_funit_verbose(), assertion_instance_summary(), assertion_instance_verbose(), curr_db, FALSE, funit_head, inst_link_s::inst, db_s::inst_head, funit_inst_s::name_diff, inst_link_s::next, PROFILE, PROFILE_END, report_covered, report_instance, and funit_inst_s::suppl.

Referenced by report_generate().

00419   { PROFILE(ASSERTION_REPORT);
00420 
00421   bool       missed_found = FALSE;  /* If set to TRUE, lines were found to be missed */
00422   inst_link* instl;                 /* Pointer to current instance link */
00423   int        acc_hits     = 0;      /* Total number of assertions hit */
00424   int        acc_total    = 0;      /* Total number of assertions in design */
00425 
00426   fprintf( ofile, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
00427   fprintf( ofile, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ASSERTION COVERAGE RESULTS   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
00428   fprintf( ofile, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
00429 
00430   if( report_instance ) {
00431 
00432     fprintf( ofile, "Instance                                           Hit/ Miss/Total    Percent hit\n" );
00433     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
00434 
00435     instl = db_list[curr_db]->inst_head;
00436     while( instl != NULL ) {
00437       missed_found |= assertion_instance_summary( ofile, instl->inst, (instl->inst->suppl.name_diff ? "<NA>" : "*"), &acc_hits, &acc_total );
00438       instl = instl->next;
00439     }
00440     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
00441     (void)assertion_display_instance_summary( ofile, "Accumulated", acc_hits, acc_total );
00442 
00443     if( verbose && (missed_found || report_covered) ) {
00444       fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
00445       instl = db_list[curr_db]->inst_head;
00446       while( instl != NULL ) {
00447         assertion_instance_verbose( ofile, instl->inst, (instl->inst->suppl.name_diff ? "<NA>" : "*") );
00448         instl = instl->next;
00449       }
00450 
00451     }
00452 
00453   } else {
00454 
00455     fprintf( ofile, "Module/Task/Function      Filename                 Hit/ Miss/Total    Percent hit\n" );
00456     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
00457 
00458     missed_found = assertion_funit_summary( ofile, db_list[curr_db]->funit_head, &acc_hits, &acc_total );
00459     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
00460     (void)assertion_display_funit_summary( ofile, "Accumulated", "", acc_hits, acc_total );
00461 
00462     if( verbose && (missed_found || report_covered) ) {
00463       fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
00464       assertion_funit_verbose( ofile, db_list[curr_db]->funit_head );
00465     }
00466 
00467   }
00468 
00469   fprintf( ofile, "\n\n" );
00470 
00471   PROFILE_END;
00472 
00473 }


Variable Documentation

unsigned int curr_db

Array of database pointers storing all currently loaded databases.

Informational line for the CDD file.

If set to a boolean value of TRUE, displays excluded coverage points for a particular CDD file. By default, Covered will not display excluded coverage points. This can be useful when used in conjunction with the -x option for including excluded coverage points. Must be used in conjunction with the -d v|d (verbose output) option.

Referenced by assertion_funit_verbose(), assertion_instance_verbose(), combination_funit_verbose(), combination_instance_verbose(), combination_list_missed(), combination_report(), fsm_display_verbose(), fsm_funit_verbose(), fsm_instance_verbose(), fsm_report(), line_funit_verbose(), line_instance_verbose(), line_report(), memory_funit_verbose(), memory_instance_verbose(), memory_report(), report_parse_args(), toggle_funit_verbose(), toggle_instance_verbose(), and toggle_report().

If set to a boolean value of TRUE, provides a coverage information for individual functional unit instances. If set to a value of FALSE, reports coverage information on a functional unit basis, merging results from all instances of same functional unit.

Referenced by assertion_report(), combination_report(), command_report(), fsm_report(), line_report(), memory_report(), report_generate(), report_parse_args(), report_print_header(), and toggle_report().

Generated on Sun Nov 21 00:55:36 2010 for Covered by  doxygen 1.6.3