comb.h File Reference

Contains functions for determining/reporting combinational logic coverage. More...

#include <stdio.h>
#include "defines.h"

Go to the source code of this file.

Functions

void combination_reset_counted_expr_tree (expression *exp)
 Resets combination counted bits in expression tree.
void combination_get_tree_stats (expression *exp, int *ulid, unsigned int curr_depth, bool excluded, unsigned int *hit, unsigned int *excludes, unsigned int *total)
 Calculates combination logic statistics for a single expression tree.
void combination_get_stats (func_unit *funit, unsigned int *hit, unsigned int *excluded, unsigned int *total)
 Calculates combination logic statistics for summary output.
void combination_collect (func_unit *funit, int cov, expression ***exprs, unsigned int *exp_cnt, int **excludes)
 Collects all toggle expressions that match the specified coverage indication.
void combination_get_funit_summary (func_unit *funit, unsigned int *hit, unsigned int *excluded, unsigned int *total)
 Gets combinational logic summary statistics for specified functional unit.
void combination_get_inst_summary (funit_inst *inst, unsigned int *hit, unsigned int *excluded, unsigned int *total)
 Gets combinational logic summary statistics for specified functional unit instance.
void combination_get_expression (int expr_id, char ***code, int **uline_groups, unsigned int *code_size, char ***ulines, unsigned int *uline_size, int **excludes, char ***reasons, unsigned int *exclude_size)
 Gets output for specified expression including underlines and code.
void combination_get_coverage (int exp_id, int uline_id, char ***info, int *info_size)
 Gets output for specified expression including coverage information.
void combination_report (FILE *ofile, bool verbose)
 Generates report output for combinational logic coverage.

Detailed Description

Contains functions for determining/reporting combinational logic coverage.

Author:
Trevor Williams (phase1geo@gmail.com)
Date:
3/31/2002

Function Documentation

void combination_collect ( func_unit funit,
int  cov,
expression ***  exprs,
unsigned int *  exp_cnt,
int **  excludes 
)

Collects all toggle expressions that match the specified coverage indication.

Gathers the covered or uncovered combinational logic information, storing their expressions in the exprs expression arrays. Used by the GUI for verbose combinational logic output.

Parameters:
funit Pointer to functional unit
cov Specifies the coverage type to find
exprs Pointer to an array of expression pointers that contain all fully covered/uncovered expressions
exp_cnt Pointer to a value that will be set to indicate the number of expressions in covs array
excludes Pointer to an array of integers indicating exclusion property of each uncovered expression

References esuppl_u::comb_cntd, combination_output_expr(), combination_reset_counted_exprs(), statement_s::exp, FALSE, func_iter_dealloc(), func_iter_get_next_statement(), func_iter_init(), expression_s::line, esuppl_u::part, PROFILE, PROFILE_END, realloc_safe, expression_s::suppl, and TRUE.

02792   { PROFILE(COMBINATION_COLLECT);
02793 
02794   func_iter  fi;              /* Functional unit iterator */
02795   statement* stmt;            /* Pointer to current statement */
02796  
02797   /* Reset combination counted bits */
02798   combination_reset_counted_exprs( funit );
02799 
02800   /* Create an array that will hold the number of uncovered combinations */
02801   *exp_cnt  = 0;
02802   *exprs    = NULL;
02803   *excludes = NULL;
02804 
02805   func_iter_init( &fi, funit, TRUE, FALSE );
02806 
02807   stmt = func_iter_get_next_statement( &fi );
02808   while( stmt != NULL ) {
02809 
02810     int any_missed     = 0;
02811     int any_measurable = 0;
02812     int any_excluded   = 0;
02813     int all_excluded   = 0;
02814 
02815     combination_output_expr( stmt->exp, 0, &any_missed, &any_measurable, &any_excluded, &all_excluded );
02816 
02817     /* Check for uncovered statements */
02818     if( ((cov == 0) && (any_missed == 1)) ||
02819         ((cov == 1) && (any_missed == 0) && (any_measurable == 1)) ) {
02820       if( stmt->exp->line != 0 ) {
02821         *exprs    = (expression**)realloc_safe( *exprs,    (sizeof( expression* ) * (*exp_cnt)), (sizeof( expression* ) * (*exp_cnt + 1)) );
02822         *excludes =         (int*)realloc_safe( *excludes, (sizeof( int* )        * (*exp_cnt)), (sizeof( int* )        * (*exp_cnt + 1)) );
02823 
02824         (*exprs)[(*exp_cnt)]    = stmt->exp;
02825         (*excludes)[(*exp_cnt)] = all_excluded ? 1 : 0;
02826         (*exp_cnt)++;
02827       }
02828       stmt->exp->suppl.part.comb_cntd = 0;
02829     }
02830 
02831     stmt = func_iter_get_next_statement( &fi );
02832 
02833   }
02834 
02835   func_iter_dealloc( &fi );
02836 
02837   PROFILE_END;
02838 
02839 }

void combination_get_coverage ( int  exp_id,
int  uline_id,
char ***  info,
int *  info_size 
)

Gets output for specified expression including coverage information.

Returns:
Returns TRUE if we were successful in obtaining coverage detail for the specified information; otherwise, returns FALSE to indicate an error.

Calculates the coverage detail for the specified subexpression and stores this in string format in the info and info_size arguments. The coverage detail created matches the coverage detail output format that is used in the ASCII reports.

Parameters:
exp_id Expression ID of statement containing subexpression to get coverage detail for
uline_id Underline ID of subexpression to get coverage detail for
info Pointer to string array that will be populated with the coverage detail
info_size Number of entries in info array

References combination_get_missed_expr(), exp_link_s::exp, func_unit_s::exp_head, exp_link_find(), expression_find_uline_id(), funit_find_by_id(), PROFILE, PROFILE_END, and TRUE.

03016   { PROFILE(COMBINATION_GET_COVERAGE);
03017 
03018   func_unit*  funit;  /* Pointer to found functional unit */
03019   exp_link*   expl;   /* Pointer to current expression link */
03020   expression* exp;    /* Pointer to found expression */
03021 
03022   /* Find the functional unit that contains this expression */
03023   funit = funit_find_by_id( exp_id );
03024   assert( funit != NULL );
03025 
03026   /* Find statement containing this expression */
03027   expl = exp_link_find( exp_id, funit->exp_head );
03028   assert( expl != NULL );
03029 
03030   /* Now find the subexpression that matches the given underline ID */
03031   exp = expression_find_uline_id( expl->exp, uline_id );
03032   assert( exp != NULL );
03033 
03034   combination_get_missed_expr( info, info_size, exp, 0, TRUE );
03035 
03036   PROFILE_END;
03037 
03038 }

void combination_get_expression ( int  expr_id,
char ***  code,
int **  uline_groups,
unsigned int *  code_size,
char ***  ulines,
unsigned int *  uline_size,
int **  excludes,
char ***  reasons,
unsigned int *  exclude_size 
)

Gets output for specified expression including underlines and code.

Exceptions:
anonymous Throw combination_underline_tree

Gets the combinational logic coverage information for the specified expression ID, storing the output in the code and ulines arrays. Used by the GUI for displaying an expression's coverage information.

Parameters:
expr_id Expression ID to retrieve information for
code Pointer to an array of strings containing generated code for this expression
uline_groups Pointer to an array of integers used for underlined missed subexpressions in this expression
code_size Pointer to value that will be set to indicate the number of elements in the code array
ulines Pointer to an array of strings that contain underlines of missed subexpressions
uline_size Pointer to value that will be set to indicate the number of elements in the ulines array
excludes Pointer to an array of values that determine if the associated subexpression is currently excluded or not from coverage
reasons Pointer to an array of strings that specify the reason for exclusion
exclude_size Pointer to value that will be set to indicate the number of elements in excludes

References Catch_anonymous, codegen_gen_expr(), combination_get_exclude_list(), combination_prep_line(), combination_underline_tree(), exp_link_s::exp, func_unit_s::exp_head, exp_link_find(), free_safe, funit_find_by_id(), funit_get_curr_module(), malloc_safe, expression_s::op, PROFILE, PROFILE_END, realloc_safe, Throw, and Try.

02910   { PROFILE(COMBINATION_GET_EXPRESSION);
02911 
02912   exp_link*    expl;              /* Pointer to found signal link */
02913   unsigned int tmp;               /* Temporary integer (unused) */
02914   unsigned int i, j;              /* Loop iterators */
02915   char**       tmp_ulines;
02916   unsigned int tmp_uline_size;
02917   int          start     = 0;
02918   unsigned int uline_max = 20;
02919   func_unit*   funit;
02920 
02921   /* Find functional unit that contains this expression */
02922   funit = funit_find_by_id( expr_id );
02923   assert( funit != NULL );
02924 
02925   /* Find the expression itself */
02926   expl = exp_link_find( expr_id, funit->exp_head );
02927   assert( expl != NULL );
02928 
02929   /* Generate line of code that missed combinational coverage */
02930   codegen_gen_expr( expl->exp, expl->exp->op, code, code_size, funit );
02931   *uline_groups = (int*)malloc_safe( sizeof( int ) * (*code_size) );
02932 
02933   /* Generate exclude information */
02934   *excludes     = NULL;
02935   *reasons      = NULL;
02936   *exclude_size = 0;
02937   combination_get_exclude_list( expl->exp, funit_get_curr_module( funit ), excludes, reasons, exclude_size );
02938 
02939   Try {
02940 
02941     /* Output underlining feature for missed expressions */
02942     combination_underline_tree( expl->exp, 0, &tmp_ulines, &tmp_uline_size, &tmp, expl->exp->op, (*code_size == 1), funit );
02943   
02944   } Catch_anonymous {
02945     unsigned int i;
02946     free_safe( *uline_groups, (sizeof( int ) * (*code_size)) );
02947     *uline_groups = NULL;
02948     for( i=0; i<*code_size; i++ ) {
02949       free_safe( (*code)[i], (strlen( (*code)[i] ) + 1) );
02950     }
02951     free_safe( *code, (sizeof( char* ) * *code_size) );
02952     *code      = NULL;
02953     *code_size = 0;
02954     free_safe( *excludes, (sizeof( int* ) * *exclude_size) );
02955     *excludes     = NULL;
02956     *exclude_size = 0;
02957     Throw 0;
02958   }
02959 
02960   *ulines     = (char**)malloc_safe( sizeof( char* ) * uline_max );
02961   *uline_size = 0;
02962 
02963   for( i=0; i<*code_size; i++ ) {
02964 
02965     assert( (*code)[i] != NULL );
02966 
02967     (*uline_groups)[i] = 0;
02968 
02969     if( *code_size == 1 ) {
02970       *ulines            = tmp_ulines;
02971       *uline_size        = tmp_uline_size;
02972       (*uline_groups)[0] = tmp_uline_size;
02973       tmp_uline_size     = 0;
02974     } else {
02975       for( j=0; j<tmp_uline_size; j++ ) {
02976         if( ((*ulines)[*uline_size] = combination_prep_line( tmp_ulines[j], start, strlen( (*code)[i] ) )) != NULL ) {
02977           ((*uline_groups)[i])++;
02978           (*uline_size)++;
02979           if( *uline_size == uline_max ) {
02980             uline_max += 20;
02981             *ulines    = (char**)realloc_safe( *ulines, (sizeof( char* ) * (uline_max - 20)), (sizeof( char* ) * uline_max) );
02982           }
02983         }
02984       }
02985     }
02986 
02987     start += strlen( (*code)[i] );
02988 
02989   }
02990 
02991   for( i=0; i<tmp_uline_size; i++ ) {
02992     free_safe( tmp_ulines[i], (strlen( tmp_ulines[i] ) + 1) );
02993   }
02994 
02995   if( tmp_uline_size > 0 ) {
02996     free_safe( tmp_ulines, (sizeof( char* ) * tmp_uline_size) );
02997   }
02998 
02999   PROFILE_END;
03000 
03001 }

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

Gets combinational logic summary statistics for specified functional unit.

Retrieves the combinational logic summary information for the specified functional unit

Parameters:
funit Pointer to functional unit
hit Pointer to location to store the number of hit combinations for the specified functional unit
excluded Pointer to number of excluded logical combinations
total Pointer to location to store the total number of combinations for the specified functional unit

References statistic_s::comb_excluded, statistic_s::comb_hit, statistic_s::comb_total, PROFILE, PROFILE_END, and func_unit_s::stat.

00569   { PROFILE(COMBINATION_GET_FUNIT_SUMMARY);
00570 
00571   *hit      = funit->stat->comb_hit;
00572   *excluded = funit->stat->comb_excluded;
00573   *total    = funit->stat->comb_total;
00574 
00575   PROFILE_END;
00576 
00577 }

void combination_get_inst_summary ( funit_inst inst,
unsigned int *  hit,
unsigned int *  excluded,
unsigned int *  total 
)

Gets combinational logic summary statistics for specified functional unit instance.

Retrieves the combinational logic summary information for the specified functional unit instance

Parameters:
inst Pointer to functional unit instance
hit Pointer to location to store the number of hit combinations for the specified functional unit instance
excluded Pointer to number of excluded logical combinations
total Pointer to location to store the total number of combinations for the specified functional unit instance

References statistic_s::comb_excluded, statistic_s::comb_hit, statistic_s::comb_total, PROFILE, PROFILE_END, and funit_inst_s::stat.

00587   { PROFILE(COMBINATION_GET_INST_SUMMARY);
00588   
00589   *hit      = inst->stat->comb_hit;
00590   *excluded = inst->stat->comb_excluded;
00591   *total    = inst->stat->comb_total;
00592             
00593   PROFILE_END;
00594   
00595 }

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

Calculates combination logic statistics for summary output.

Iterates through specified expression list and finds all root expressions. For each root expression, the combination_get_tree_stats function is called to generate the coverage numbers for the specified expression tree. Called by report function.

Parameters:
funit Pointer to functional unit to search
hit Pointer to number of logical combinations hit during simulation
excluded Pointer to number of excluded logical combinations
total Pointer to total number of logical combinations

References combination_get_tree_stats(), statement_s::exp, FALSE, func_iter_dealloc(), func_iter_get_next_statement(), func_iter_init(), funit_is_unnamed(), statement_s::part, PROFILE, PROFILE_END, statement_s::suppl, and TRUE.

Referenced by report_gather_funit_stats(), and report_gather_instance_stats().

00534   { PROFILE(COMBINATION_GET_STATS);
00535 
00536   func_iter  fi;    /* Functional unit iterator */
00537   statement* stmt;  /* Pointer to current statement being examined */
00538   int        ulid;  /* Current underline ID for this expression */
00539   
00540   /* If the given functional unit is not an unnamed scope, traverse it now */
00541   if( !funit_is_unnamed( funit ) ) {
00542 
00543     /* Initialize functional unit iterator */
00544     func_iter_init( &fi, funit, TRUE, FALSE );
00545 
00546     /* Traverse statements in the given functional unit */
00547     while( (stmt = func_iter_get_next_statement( &fi )) != NULL ) {
00548       ulid = 1;
00549       combination_get_tree_stats( stmt->exp, &ulid, 0, stmt->suppl.part.excluded, hit, excluded, total );
00550     }
00551 
00552     /* Deallocate functional unit iterator */
00553     func_iter_dealloc( &fi );
00554 
00555   }
00556 
00557   PROFILE_END;
00558 
00559 }

void combination_get_tree_stats ( expression exp,
int *  ulid,
unsigned int  curr_depth,
bool  excluded,
unsigned int *  hit,
unsigned int *  excludes,
unsigned int *  total 
)

Calculates combination logic statistics for a single expression tree.

Recursively traverses the specified expression tree, recording the total number of logical combinations in the expression list and the number of combinations hit during the course of simulation. An expression can be considered for combinational coverage if the "measured" bit is set in the expression.

Parameters:
exp Pointer to expression tree to traverse
ulid Pointer to current underline ID
curr_depth Current search depth in given expression tree
excluded Specifies that this expression should be excluded for hit information because one or more of its parent expressions have been excluded
hit Pointer to number of logical combinations hit during simulation
excludes Pointer to number of excluded logical combinations
total Pointer to total number of logical combinations

References allow_multi_expr, AND_COMB, esuppl_u::comb_cntd, combination_calc_depth(), combination_get_tree_stats(), combination_is_expr_multi_node(), combination_multi_expr_calc(), ESUPPL_EXCLUDED, ESUPPL_IS_ROOT, ESUPPL_WAS_COMB_COUNTED, ESUPPL_WAS_FALSE, ESUPPL_WAS_TRUE, esuppl_u::eval_00, esuppl_u::eval_01, esuppl_u::eval_10, esuppl_u::eval_11, EXP_OP_AND, EXP_OP_EXPAND, EXP_OP_LAND, EXP_OP_LOR, EXP_OP_OR, expr_stmt_u::expr, EXPR_IS_COMB, EXPR_IS_EVENT, EXPR_IS_MEASURABLE, expression_is_static_only(), FALSE, exp_info_s::is_comb, expression_s::left, expression_s::op, OR_COMB, expression_s::parent, esuppl_u::part, PROFILE, PROFILE_END, report_bitwise, report_comb_depth, REPORT_DETAILED, REPORT_SUMMARY, REPORT_VERBOSE, expression_s::right, exp_info_s::suppl, expression_s::suppl, TRUE, expression_s::ulid, expression_s::value, vector_get_eval_ab_count(), vector_get_eval_abc_count(), vector_get_eval_abcd_count(), and vector_s::width.

Referenced by combination_get_stats(), combination_get_tree_stats(), and exclude_expr_assign_and_recalc().

00333   { PROFILE(COMBINATION_GET_TREE_STATS);
00334 
00335   int num_hit = 0;  /* Number of expression value hits for the current expression */
00336   int tot_num;      /* Total number of combinations for the current expression */
00337 
00338   if( exp != NULL ) {
00339 
00340     /* Calculate excluded value for this expression */
00341     excluded |= ESUPPL_EXCLUDED( exp->suppl );
00342 
00343     /* Calculate children */
00344     combination_get_tree_stats( exp->left,  ulid, combination_calc_depth( exp, curr_depth, TRUE ),  excluded, hit, excludes, total );
00345     combination_get_tree_stats( exp->right, ulid, combination_calc_depth( exp, curr_depth, FALSE ), excluded, hit, excludes, total );
00346 
00347     if( ((report_comb_depth == REPORT_DETAILED) && (curr_depth <= report_comb_depth)) ||
00348          (report_comb_depth == REPORT_VERBOSE) ||
00349          (report_comb_depth == REPORT_SUMMARY) ) {
00350 
00351       if( (EXPR_IS_MEASURABLE( exp ) == 1) && (ESUPPL_WAS_COMB_COUNTED( exp->suppl ) == 0) ) {
00352 
00353         if( (ESUPPL_IS_ROOT( exp->suppl ) == 1) || (exp->op != exp->parent->expr->op) ||
00354             ((exp->op != EXP_OP_AND) &&
00355              (exp->op != EXP_OP_LAND) &&
00356              (exp->op != EXP_OP_OR)   &&
00357              (exp->op != EXP_OP_LOR)) ||
00358              !allow_multi_expr ) {
00359 
00360           /* Calculate current expression combination coverage */
00361           if( (((exp->left != NULL) &&
00362                 (exp->op == exp->left->op)) ||
00363                ((exp->right != NULL) &&
00364                 (exp->op == exp->right->op))) &&
00365               ((exp->op == EXP_OP_AND)  ||
00366                (exp->op == EXP_OP_OR)   ||
00367                (exp->op == EXP_OP_LAND) ||
00368                (exp->op == EXP_OP_LOR)) && allow_multi_expr ) {
00369             combination_multi_expr_calc( exp, ulid, FALSE, excluded, hit, excludes, total );
00370           } else {
00371             if( !expression_is_static_only( exp ) ) {
00372               if( EXPR_IS_COMB( exp ) == 1 ) {
00373                 if( exp_op_info[exp->op].suppl.is_comb == AND_COMB ) {
00374                   if( report_bitwise ) {
00375                     tot_num = 3 * exp->value->width;
00376                     num_hit = vector_get_eval_abc_count( exp->value );
00377                   } else {
00378                     tot_num = 3;
00379                     num_hit = ESUPPL_WAS_FALSE( exp->left->suppl )  + 
00380                               ESUPPL_WAS_FALSE( exp->right->suppl ) +
00381                               exp->suppl.part.eval_11;
00382                   }
00383                 } else if( exp_op_info[exp->op].suppl.is_comb == OR_COMB ) {
00384                   if( report_bitwise ) {
00385                     tot_num = 3 * exp->value->width;
00386                     num_hit = vector_get_eval_abc_count( exp->value );
00387                   } else {
00388                     tot_num = 3;
00389                     num_hit = ESUPPL_WAS_TRUE( exp->left->suppl )  +
00390                               ESUPPL_WAS_TRUE( exp->right->suppl ) +
00391                               exp->suppl.part.eval_00;
00392                   }
00393                 } else {
00394                   if( report_bitwise ) {
00395                     tot_num = 4 * exp->value->width;
00396                     num_hit = vector_get_eval_abcd_count( exp->value );
00397                   } else {
00398                     tot_num = 4;
00399                     num_hit = exp->suppl.part.eval_00 +
00400                               exp->suppl.part.eval_01 +
00401                               exp->suppl.part.eval_10 +
00402                               exp->suppl.part.eval_11;
00403                   }
00404                 }
00405                 *total += tot_num;
00406                 if( excluded ) {
00407                   *hit      += tot_num;
00408                   *excludes += tot_num;
00409                 } else {
00410                   *hit += num_hit;
00411                 }
00412                 if( (num_hit != tot_num) && (exp->ulid == -1) && !combination_is_expr_multi_node( exp ) ) {
00413                   exp->ulid = *ulid;
00414                   (*ulid)++;
00415                 }
00416               } else if( EXPR_IS_EVENT( exp ) == 1 ) {
00417                 (*total)++;
00418                 num_hit = ESUPPL_WAS_TRUE( exp->suppl );
00419                 if( excluded ) {
00420                   (*hit)++;
00421                   (*excludes)++;
00422                 } else {
00423                   *hit += num_hit;
00424                 }
00425                 if( (num_hit != 1) && (exp->ulid == -1) && !combination_is_expr_multi_node( exp ) ) {
00426                   exp->ulid = *ulid;
00427                   (*ulid)++;
00428                 }
00429               } else {
00430                 if( (exp->op != EXP_OP_EXPAND) || (exp->value->width > 0) ) {
00431                   if( report_bitwise ) {
00432                     *total  = *total + (2 * exp->value->width);
00433                     num_hit = vector_get_eval_ab_count( exp->value );
00434                   } else {
00435                     *total  = *total + 2;
00436                     num_hit = ESUPPL_WAS_TRUE( exp->suppl ) + ESUPPL_WAS_FALSE( exp->suppl );
00437                   }
00438                   if( excluded ) {
00439                     *hit      += 2;
00440                     *excludes += 2;
00441                   } else {
00442                     *hit += num_hit;
00443                   }
00444                   if( (num_hit != 2) && (exp->ulid == -1) && !combination_is_expr_multi_node( exp ) ) {
00445                     exp->ulid = *ulid;
00446                     (*ulid)++;
00447                   }
00448                 }
00449               }
00450             }
00451           }
00452 
00453         }
00454 
00455       }
00456 
00457     }
00458 
00459     /* Consider this expression to be counted */
00460     exp->suppl.part.comb_cntd = 1;
00461 
00462   }
00463 
00464   PROFILE_END;
00465 
00466 }

void combination_report ( FILE *  ofile,
bool  verbose 
)

Generates report output for combinational logic coverage.

Exceptions:
anonymous combination_funit_verbose combination_instance_verbose

After the design is read into the functional unit hierarchy, parses the hierarchy by functional unit, reporting the combinational logic coverage for each functional unit encountered. The parent functional unit will specify its own combinational logic coverage along with a total combinational logic coverage including its children.

Parameters:
ofile Pointer to file to output results to
verbose Specifies whether or not to provide verbose information

References combination_display_funit_summary(), combination_display_instance_summary(), combination_funit_summary(), combination_funit_verbose(), combination_instance_summary(), combination_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_exclusions, report_instance, and funit_inst_s::suppl.

Referenced by report_generate().

03051   { PROFILE(COMBINATION_REPORT);
03052 
03053   bool       missed_found = FALSE;  /* If set to TRUE, indicates combinations were missed */
03054   inst_link* instl;                 /* Pointer to current instance link */
03055   int        acc_hits     = 0;      /* Accumulated number of combinations hit */
03056   int        acc_total    = 0;      /* Accumulated number of combinations in design */
03057 
03058   fprintf( ofile, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
03059   fprintf( ofile, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   COMBINATIONAL LOGIC COVERAGE RESULTS   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
03060   fprintf( ofile, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
03061 
03062   if( report_instance ) {
03063 
03064     fprintf( ofile, "                                                                            Logic Combinations\n" );
03065     fprintf( ofile, "Instance                                                              Hit/Miss/Total    Percent hit\n" );
03066     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
03067 
03068     instl = db_list[curr_db]->inst_head;
03069     while( instl != NULL ) {
03070       missed_found |= combination_instance_summary( ofile, instl->inst, (instl->inst->suppl.name_diff ? "<NA>" : "*"), &acc_hits, &acc_total );
03071       instl = instl->next;
03072     }
03073     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
03074     (void)combination_display_instance_summary( ofile, "Accumulated", acc_hits, acc_total );
03075     
03076     if( verbose && (missed_found || report_covered || report_exclusions) ) {
03077       fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
03078       instl = db_list[curr_db]->inst_head;
03079       while( instl != NULL ) {
03080         combination_instance_verbose( ofile, instl->inst, (instl->inst->suppl.name_diff ? "<NA>" : "*") );
03081         instl = instl->next;
03082       }
03083     }
03084 
03085   } else {
03086 
03087     fprintf( ofile, "                                                                            Logic Combinations\n" );
03088     fprintf( ofile, "Module/Task/Function                Filename                          Hit/Miss/Total    Percent hit\n" );
03089     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
03090 
03091     missed_found = combination_funit_summary( ofile, db_list[curr_db]->funit_head, &acc_hits, &acc_total );
03092     fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
03093     (void)combination_display_funit_summary( ofile, "Accumulated", "", acc_hits, acc_total );
03094 
03095     if( verbose && (missed_found || report_covered || report_exclusions) ) {
03096       fprintf( ofile, "---------------------------------------------------------------------------------------------------------------------\n" );
03097       combination_funit_verbose( ofile, db_list[curr_db]->funit_head );
03098     }
03099 
03100   }
03101 
03102   fprintf( ofile, "\n\n" );
03103 
03104   PROFILE_END;
03105 
03106 }

void combination_reset_counted_expr_tree ( expression exp  ) 

Resets combination counted bits in expression tree.

Recursively iterates through specified expression tree, clearing the combination counted bit in the supplemental field of each child expression. This functions needs to get called whenever the excluded bit of an expression is changed.

Parameters:
exp Pointer to expression tree to reset

References esuppl_u::comb_cntd, combination_reset_counted_expr_tree(), expression_s::left, esuppl_u::part, PROFILE, PROFILE_END, expression_s::right, and expression_s::suppl.

Referenced by combination_reset_counted_expr_tree(), exclude_expr_assign_and_recalc(), and rank_gather_comp_cdd_cov().

00509   { PROFILE(COMBINATION_RESET_COUNTED_EXPR_TREE);
00510 
00511   if( exp != NULL ) {
00512 
00513     exp->suppl.part.comb_cntd = 0;
00514 
00515     combination_reset_counted_expr_tree( exp->left );
00516     combination_reset_counted_expr_tree( exp->right );
00517 
00518   }
00519 
00520   PROFILE_END;
00521 
00522 }

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