| Byte | Description |
| 0 | Bits [ 7:0] of output state variable width |
| 1 | Bits [15:8] of output state variable width |
| 2 | Bits [ 7:0] of number of state transition entries currently allocated |
| 3 | Bits [15:8] of number of state transition entries currently allocated |
| 4 | Bits [ 7:0] of number of state transition entries currently occupied |
| 5 | Bits [15:8] of number of state transition entries currently occupied |
| 6 | Bits [ 7:0] of arc array supplemental field |
| Bits | Description |
|---|---|
| 0 | Set to 1 if the forward bidirectional state transition was hit; otherwise, set to 0. |
| 1 | Set to 1 if the reverse bidirectional state transition was hit; otherwise, set to 0. |
| 2 | Set to 1 if this entry is bidirectional (reverse is a transition); otherwise, only forward is valid. |
| 3 | Set to 1 if the output state of the forward transition is a new state in the arc array. |
| 4 | Set to 1 if the input state of the forward transition is a new state in the arc array. |
| 5 | Set to 1 if the forward state transition is excluded from coverage. |
| 6 | Set to 1 if the reverse state transition is excluded from coverage. |
| (width + 6):7 | Bit value of output state of the forward transition. |
| ((width * 2) + 6):(width + 7) | Bit value of input state of the forward transition. |
| Event | Entry | Action | ||
|---|---|---|---|---|
| 0 | 1 | 2 | ||
| Add 0->1 | 0->1,HF=1,HR=0,BD=0 | 0->1 not found in table, add as forward in entry 0 | ||
| Add 1->2 | 0->1,HF=1,HR=0,BD=0 | 1->2,HF=1,HR=0,BD=0 | 1->2 not found in table, add as forward in entry 1 | |
| Add 1->0 | 0->1,HF=1,HR=1,BD=1 | 1->2,HF=1,HR=0,BD=0 | 1->0 found in entry 0, add as reverse and set bidirectional entry bit | |
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "arc.h"
#include "defines.h"
#include "exclude.h"
#include "expr.h"
#include "profiler.h"
#include "util.h"
#include "vector.h"
Functions | |
| void | arc_display (const fsm_table *table) |
| int | arc_find_from_state (const fsm_table *table, const vector *st) |
| Finds the specified FROM state in the given FSM table. | |
| int | arc_find_to_state (const fsm_table *table, const vector *st) |
| Finds the specified TO state in the given FSM table. | |
| int | arc_find_arc (const fsm_table *table, unsigned int fr_index, unsigned int to_index) |
| Finds the specified state transition in the given FSM table. | |
| int | arc_find_arc_by_exclusion_id (const fsm_table *table, int id) |
| Finds the specified state transition in the given FSM table by the exclusion ID. | |
| fsm_table * | arc_create () |
| Allocates and initializes new state transition array. | |
| void | arc_add (fsm_table *table, const vector *fr_st, const vector *to_st, int hit, bool exclude) |
| Adds new state transition arc entry to specified table. | |
| int | arc_state_hits (const fsm_table *table) |
| int | arc_transition_hits (const fsm_table *table) |
| int | arc_transition_excluded (const fsm_table *table) |
| void | arc_get_stats (const fsm_table *table, int *state_hits, int *state_total, int *arc_hits, int *arc_total, int *arc_excluded) |
| Calculates all state and state transition values for reporting purposes. | |
| void | arc_db_write (const fsm_table *table, FILE *file) |
| Writes specified arc array to specified CDD file. | |
| void | arc_db_read (fsm_table **table, char **line) |
| Reads in arc array from CDD database string. | |
| void | arc_db_merge (fsm_table *base, char **line) |
| Merges contents of arc table from line to specified base array. | |
| void | arc_merge (fsm_table *base, const fsm_table *other) |
| Merges two FSM arcs, placing the results in the base arc. | |
| void | arc_get_states (char ***fr_states, unsigned int *fr_state_size, char ***to_states, unsigned int *to_state_size, const fsm_table *table, bool hit, bool any) |
| Stores arc array state values to specified string array. | |
| void | arc_get_transitions (char ***from_states, char ***to_states, int **ids, int **excludes, char ***reasons, int *arc_size, const fsm_table *table, func_unit *funit, bool hit, bool any) |
| Outputs arc array state transition values to specified output stream. | |
| bool | arc_are_any_excluded (const fsm_table *table) |
| Specifies if any state transitions have been excluded from coverage. | |
| void | arc_dealloc (fsm_table *table) |
| Deallocates memory for specified arcs array. | |
Variables | |
| int | curr_arc_id = 1 |
|
||||||||||||||||||||||||
|
Adds new state transition arc entry to specified table. If specified arcs array has not been created yet (value is set to NULL), allocate enough memory in the arc array to hold width number of state transitions. If the specified arcs array has been created but is currently full (arc array max_size and curr_size are equal to each other), add width number of more arc array entries to the current array. After memory has been allocated, create a state transition entry from the fr_st and to_st expressions, setting the hit bits in the entry to 0.
00329 { PROFILE(ARC_ADD);
00330
00331 int from_index; /* Index of found from_state in states array */
00332 int to_index; /* Index of found to_state in states array */
00333 int arcs_index; /* Index of found state transition in arcs array */
00334
00335 assert( table != NULL );
00336
00337 if( (hit == 0) || (!vector_is_unknown( fr_st ) && !vector_is_unknown( to_st )) ) {
00338
00339 /* Search for the from_state vector in the states array */
00340 if( (from_index = arc_find_from_state( table, fr_st )) == -1 ) {
00341 table->fr_states = (vector**)realloc_safe( table->fr_states, (sizeof( vector* ) * table->num_fr_states), (sizeof( vector* ) * (table->num_fr_states + 1)) );
00342 from_index = table->num_fr_states;
00343 table->fr_states[from_index] = vector_create( fr_st->width, VTYPE_VAL, fr_st->suppl.part.data_type, TRUE );
00344 vector_copy( fr_st, table->fr_states[from_index] );
00345 table->num_fr_states++;
00346 }
00347
00348 /* Search for the to_state vector in the states array */
00349 if( (to_index = arc_find_to_state( table, to_st )) == -1 ) {
00350 table->to_states = (vector**)realloc_safe( table->to_states, (sizeof( vector* ) * table->num_to_states), (sizeof( vector* ) * (table->num_to_states + 1)) );
00351 to_index = table->num_to_states;
00352 table->to_states[to_index] = vector_create( to_st->width, VTYPE_VAL, to_st->suppl.part.data_type, TRUE );
00353 vector_copy( to_st, table->to_states[to_index] );
00354 table->num_to_states++;
00355 }
00356
00357 /* If we need to add a new arc, do so now */
00358 if( (arcs_index = arc_find_arc( table, from_index, to_index )) == -1 ) {
00359
00360 table->arcs = (fsm_table_arc**)realloc_safe( table->arcs, (sizeof( fsm_table_arc* ) * table->num_arcs), (sizeof( fsm_table_arc* ) * (table->num_arcs + 1)) );
00361 table->arcs[table->num_arcs] = (fsm_table_arc*)malloc_safe( sizeof( fsm_table_arc ) );
00362 table->arcs[table->num_arcs]->suppl.all = 0;
00363 table->arcs[table->num_arcs]->suppl.part.hit = hit;
00364 table->arcs[table->num_arcs]->suppl.part.excluded = exclude;
00365 table->arcs[table->num_arcs]->from = from_index;
00366 table->arcs[table->num_arcs]->to = to_index;
00367 arcs_index = table->num_arcs;
00368 table->num_arcs++;
00369
00370 /* Otherwise, adjust hit and exclude information */
00371 } else {
00372
00373 table->arcs[arcs_index]->suppl.part.hit |= hit;
00374 table->arcs[arcs_index]->suppl.part.excluded |= exclude;
00375
00376 }
00377
00378 /* If we have set a side with hit equal to 0, we are specifying a known transition. */
00379 if( hit == 0 ) {
00380 table->suppl.part.known = 1;
00381 }
00382
00383 }
00384
00385 PROFILE_END;
00386
00387 }
|
|
|
Specifies if any state transitions have been excluded from coverage.
00843 { PROFILE(ARC_ARE_ANY_EXCLUDED);
00844
00845 unsigned int i = 0; /* Loop iterator */
00846
00847 assert( table != NULL );
00848
00849 while( (i < table->num_arcs) && (table->arcs[i]->suppl.part.excluded == 0) ) i++;
00850
00851 PROFILE_END;
00852
00853 return( i < table->num_arcs );
00854
00855 }
|
|
|
Allocates and initializes new state transition array.
00291 { PROFILE(ARC_CREATE);
00292
00293 fsm_table* table; /* Pointer to newly created FSM table */
00294
00295 /* Allocate memory for the new table here */
00296 table = (fsm_table*)malloc_safe( sizeof( fsm_table ) );
00297
00298 /* Initialize */
00299 table->suppl.all = 0;
00300 table->id = 0;
00301 table->fr_states = NULL;
00302 table->num_fr_states = 0;
00303 table->to_states = NULL;
00304 table->num_to_states = 0;
00305 table->arcs = NULL;
00306 table->num_arcs = 0;
00307
00308 PROFILE_END;
00309
00310 return( table );
00311
00312 }
|
|
||||||||||||
|
Merges contents of arc table from line to specified base array.
00667 { PROFILE(ARC_DB_MERGE);
00668
00669 /*@-mustfreeonly -mustfreefresh@*/
00670
00671 fsm_table* table; /* Currently read FSM table */
00672 unsigned int i; /* Loop iterator */
00673
00674 /* Read in the table */
00675 arc_db_read( &table, line );
00676
00677 /* Merge state transitions */
00678 for( i=0; i<table->num_arcs; i++ ) {
00679 arc_add( base, table->fr_states[table->arcs[i]->from], table->to_states[table->arcs[i]->to], table->arcs[i]->suppl.part.hit, table->arcs[i]->suppl.part.excluded );
00680 }
00681
00682 /* Deallocate the merged table */
00683 arc_dealloc( table );
00684
00685 PROFILE_END;
00686
00687 /*@=mustfreeonly =mustfreefresh@*/
00688
00689 }
|
|
||||||||||||
|
Reads in arc array from CDD database string.
00564 { PROFILE(ARC_DB_READ);
00565
00566 /* Allocate table */
00567 *table = arc_create();
00568
00569 Try {
00570
00571 unsigned int num_fr_states;
00572 unsigned int num_to_states;
00573 int chars_read;
00574
00575 /*@-formatcode@*/
00576 if( sscanf( *line, "%hhx %u %u%n", &((*table)->suppl.all), &num_fr_states, &num_to_states, &chars_read ) == 3 ) {
00577 /*@=formatcode@*/
00578
00579 unsigned int i;
00580 unsigned int num_arcs;
00581
00582 *line += chars_read;
00583
00584 /* Set exclusion ID */
00585 (*table)->id = curr_arc_id;
00586
00587 /* Allocate and initialize fr_states array */
00588 (*table)->fr_states = (vector**)malloc_safe( sizeof( vector* ) * num_fr_states );
00589 (*table)->num_fr_states = num_fr_states;
00590 for( i=0; i<num_fr_states; i++ ) {
00591 (*table)->fr_states[i] = NULL;
00592 }
00593
00594 /* Read in from vectors */
00595 for( i=0; i<num_fr_states; i++ ) {
00596 vector_db_read( &((*table)->fr_states[i]), line );
00597 }
00598
00599 /* Allocate and initialize to_states array */
00600 (*table)->to_states = (vector**)malloc_safe( sizeof( vector* ) * num_to_states );
00601 (*table)->num_to_states = num_to_states;
00602 for( i=0; i<num_to_states; i++ ) {
00603 (*table)->to_states[i] = NULL;
00604 }
00605
00606 /* Read in vectors */
00607 for( i=0; i<num_to_states; i++ ) {
00608 vector_db_read( &((*table)->to_states[i]), line );
00609 }
00610
00611 if( sscanf( *line, "%u%n", &num_arcs, &chars_read ) == 1 ) {
00612
00613 *line += chars_read;
00614
00615 /* Allocate arcs array */
00616 (*table)->arcs = (fsm_table_arc**)malloc_safe( sizeof( fsm_table_arc* ) * num_arcs );
00617 (*table)->num_arcs = num_arcs;
00618 for( i=0; i<num_arcs; i++ ) {
00619 (*table)->arcs[i] = NULL;
00620 }
00621
00622 for( i=0; i<num_arcs; i++ ) {
00623
00624 /* Allocate fsm_table_arc */
00625 (*table)->arcs[i] = (fsm_table_arc*)malloc_safe( sizeof( fsm_table_arc ) );
00626
00627 /*@-formatcode@*/
00628 if( sscanf( *line, "%u %u %hhx%n", &((*table)->arcs[i]->from), &((*table)->arcs[i]->to), &((*table)->arcs[i]->suppl.all), &chars_read ) != 3 ) {
00629 /*@=formatcode@*/
00630 print_output( "Unable to parse FSM table information from database. Unable to read.", FATAL, __FILE__, __LINE__ );
00631 Throw 0;
00632 } else {
00633 *line += chars_read;
00634 curr_arc_id++;
00635 }
00636
00637 }
00638
00639 } else {
00640 print_output( "Unable to parse FSM table information from database. Unable to read.", FATAL, __FILE__, __LINE__ );
00641 Throw 0;
00642 }
00643
00644 } else {
00645 print_output( "Unable to parse FSM table information from database. Unable to read.", FATAL, __FILE__, __LINE__ );
00646 Throw 0;
00647 }
00648
00649 } Catch_anonymous {
00650 arc_dealloc( *table );
00651 *table = NULL;
00652 Throw 0;
00653 }
00654
00655 PROFILE_END;
00656
00657 }
|
|
||||||||||||
|
Writes specified arc array to specified CDD file. Writes the specified arcs array to the specified CDD output file. An arc array is output in a special format that is described in the above documentation for this file.
00522 { PROFILE(ARC_DB_WRITE);
00523
00524 unsigned int i; /* Loop iterator */
00525
00526 assert( table != NULL );
00527
00528 /*@-formatcode@*/
00529 fprintf( file, " %hhx %u %u ", table->suppl.all, table->num_fr_states, table->num_to_states );
00530 /*@=formatcode@*/
00531
00532 /* Output state information */
00533 for( i=0; i<table->num_fr_states; i++ ) {
00534 vector_db_write( table->fr_states[i], file, TRUE, FALSE );
00535 fprintf( file, " " );
00536 }
00537 for( i=0; i<table->num_to_states; i++ ) {
00538 vector_db_write( table->to_states[i], file, TRUE, FALSE );
00539 fprintf( file, " " );
00540 }
00541
00542 /* Output arc information */
00543 fprintf( file, " %u", table->num_arcs );
00544 for( i=0; i<table->num_arcs; i++ ) {
00545 /*@-formatcode@*/
00546 fprintf( file, " %u %u %hhx", table->arcs[i]->from, table->arcs[i]->to, table->arcs[i]->suppl.all );
00547 /*@=formatcode@*/
00548 }
00549
00550 PROFILE_END;
00551
00552 }
|
|
|
Deallocates memory for specified arcs array. Deallocates all allocated memory for the specified state transition arc array.
00863 { PROFILE(ARC_DEALLOC);
00864
00865 if( table != NULL ) {
00866
00867 unsigned int i;
00868
00869 /* Deallocate fr_states */
00870 for( i=0; i<table->num_fr_states; i++ ) {
00871 vector_dealloc( table->fr_states[i] );
00872 }
00873 free_safe( table->fr_states, (sizeof( vector* ) * table->num_fr_states) );
00874
00875 /* Deallocate to_states */
00876 for( i=0; i<table->num_to_states; i++ ) {
00877 vector_dealloc( table->to_states[i] );
00878 }
00879 free_safe( table->to_states, (sizeof( vector* ) * table->num_to_states) );
00880
00881 /* Deallocate arcs */
00882 for( i=0; i<table->num_arcs; i++ ) {
00883 free_safe( table->arcs[i], sizeof( fsm_table_arc ) );
00884 }
00885 free_safe( table->arcs, (sizeof( fsm_table_arc* ) * table->num_arcs) );
00886
00887 /* Now deallocate ourself */
00888 free_safe( table, sizeof( fsm_table ) );
00889
00890 }
00891
00892 PROFILE_END;
00893
00894 }
|
|
|
Displays the given state transition arcs in a human-readable format.
00151 {
00152
00153 unsigned int i; /* Loop iterator */
00154
00155 assert( table != NULL );
00156
00157 for( i=0; i<table->num_arcs; i++ ) {
00158
00159 char* lvec = vector_to_string( table->fr_states[table->arcs[i]->from], HEXIDECIMAL, TRUE );
00160 char* rvec = vector_to_string( table->to_states[table->arcs[i]->to], HEXIDECIMAL, TRUE );
00161
00162 printf( " entry %u: ", i );
00163
00164 /* Output the state transition */
00165 printf( "%s", lvec );
00166 printf( " --> " );
00167 printf( "%s", rvec );
00168
00169 /* Now output the relevant supplemental information */
00170 printf( " (%s %s)\n",
00171 ((table->arcs[i]->suppl.part.excluded == 1) ? "E" : " "),
00172 ((table->arcs[i]->suppl.part.hit == 1) ? "H" : " ") );
00173
00174
00175 /* Deallocate strings */
00176 free_safe( lvec, (strlen( lvec ) + 1) );
00177 free_safe( rvec, (strlen( rvec ) + 1) );
00178
00179 }
00180
00181 }
|
|
||||||||||||||||
|
Finds the specified state transition in the given FSM table.
00247 { PROFILE(ARC_FIND_ARC);
00248
00249 int index = -1;
00250 unsigned int i = 0;
00251
00252 while( (i < table->num_arcs) && (index == -1) ) {
00253 if( (table->arcs[i]->from == fr_index) && (table->arcs[i]->to == to_index) ) {
00254 index = i;
00255 }
00256 i++;
00257 }
00258
00259 PROFILE_END;
00260
00261 return( index );
00262
00263 }
|
|
||||||||||||
|
Finds the specified state transition in the given FSM table by the exclusion ID.
|
|
||||||||||||
|
Finds the specified FROM state in the given FSM table.
00192 { PROFILE(ARC_FIND_FROM_STATE);
00193
00194 int index = -1; /* Return value for this function */
00195 unsigned int i = 0; /* Loop iterator */
00196
00197 assert( table != NULL );
00198
00199 while( (i < table->num_fr_states) && !vector_ceq_ulong( st, table->fr_states[i] ) ) i++;
00200 if( i < table->num_fr_states ) {
00201 index = i;
00202 }
00203
00204 PROFILE_END;
00205
00206 return( index );
00207
00208 }
|
|
||||||||||||
|
Finds the specified TO state in the given FSM table.
00220 { PROFILE(ARC_FIND_TO_STATE);
00221
00222 int index = -1; /* Return value for this function */
00223 unsigned int i = 0; /* Loop iterator */
00224
00225 assert( table != NULL );
00226
00227 while( (i < table->num_to_states) && !vector_ceq_ulong( st, table->to_states[i] ) ) i++;
00228 if( i < table->num_to_states ) {
00229 index = i;
00230 }
00231
00232 PROFILE_END;
00233
00234 return( index );
00235
00236 }
|
|
||||||||||||||||||||||||||||||||
|
Stores arc array state values to specified string array. Traverses entire arc array, storing all states that were hit during simulation (if hit parameter is true or the any parameter is true) or missed during simulation (if hit parameter is false or the any parameter is true).
00724 { PROFILE(ARC_GET_STATES);
00725
00726 unsigned int i, j; /* Loop iterator */
00727
00728 /*@-nullstate@*/
00729
00730 assert( fr_states != NULL );
00731 assert( fr_state_size != NULL );
00732 assert( to_states != NULL );
00733 assert( to_state_size != NULL );
00734
00735 /* Initialize states array pointers and sizes */
00736 *fr_states = NULL;
00737 *fr_state_size = 0;
00738 *to_states = NULL;
00739 *to_state_size = 0;
00740
00741 /* Iterate through the fr_states array, gathering all matching states */
00742 for( i=0; i<table->num_fr_states; i++ ) {
00743 bool state_hit = any;
00744 for( j=0; j<table->num_arcs; j++ ) {
00745 if( table->arcs[j]->from == i ) {
00746 state_hit = state_hit || (table->arcs[j]->suppl.part.hit == 1);
00747 }
00748 }
00749 if( state_hit == hit ) {
00750 *fr_states = (char**)realloc_safe( *fr_states, (sizeof( char* ) * (*fr_state_size)), (sizeof( char* ) * ((*fr_state_size) + 1)) );
00751 (*fr_states)[(*fr_state_size)] = vector_to_string( table->fr_states[i], HEXIDECIMAL, TRUE );
00752 (*fr_state_size)++;
00753 }
00754 }
00755
00756 /* Iterate through the to_states array, gathering all matching states */
00757 for( i=0; i<table->num_to_states; i++ ) {
00758 bool state_hit = any;
00759 for( j=0; j<table->num_arcs; j++ ) {
00760 if( table->arcs[j]->to == i ) {
00761 state_hit = state_hit || (table->arcs[j]->suppl.part.hit == 1);
00762 }
00763 }
00764 if( state_hit == hit ) {
00765 *to_states = (char**)realloc_safe( *to_states, (sizeof( char* ) * (*to_state_size)), (sizeof( char* ) * ((*to_state_size) + 1)) );
00766 (*to_states)[(*to_state_size)] = vector_to_string( table->to_states[i], HEXIDECIMAL, TRUE );
00767 (*to_state_size)++;
00768 }
00769 }
00770
00771 PROFILE_END;
00772
00773 }
|
|
||||||||||||||||||||||||||||
|
Calculates all state and state transition values for reporting purposes. Calculates values for all specified totals from given state transition arc array. If the state and state transition totals are not known (i.e., user specified state variables without specifying legal states and state transitions and/or the user specified state variables and state table was not able to be automatically extracted), return a value of -1 for total values to indicate to the calling function that a different report output is required.
00494 { PROFILE(ARC_GET_STATS);
00495
00496 /* First get hits */
00497 *state_hits += arc_state_hits( table );
00498 *arc_hits += arc_transition_hits( table );
00499 *arc_excluded += arc_transition_excluded( table );
00500
00501 /* If the state transitions are known, calculate them; otherwise, return -1 for totals */
00502 if( table->suppl.part.known == 0 ) {
00503 *state_total = -1;
00504 *arc_total = -1;
00505 } else {
00506 *state_total += table->num_fr_states;
00507 *arc_total += table->num_arcs;
00508 }
00509
00510 PROFILE_END;
00511
00512 }
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Outputs arc array state transition values to specified output stream. Traverses entire arc array, storing all state transitions that were hit during simulation (if hit parameter is true or the any parameter is true) or missed during simulation (if hit parameter is false or the any parameter is true).
00791 { PROFILE(ARC_GET_TRANSITIONS);
00792
00793 unsigned int i; /* Loop iterator */
00794
00795 assert( table != NULL );
00796
00797 /* Initialize state arrays and arc_size */
00798 *from_states = NULL;
00799 *to_states = NULL;
00800 *ids = NULL;
00801 *excludes = NULL;
00802 *reasons = NULL;
00803 *arc_size = 0;
00804
00805 /* Iterate through arc transitions */
00806 for( i=0; i<table->num_arcs; i++ ) {
00807
00808 if( (table->arcs[i]->suppl.part.hit == hit) || any ) {
00809 exclude_reason* er;
00810
00811 *from_states = (char**)realloc_safe( *from_states, (sizeof( char* ) * (*arc_size)), (sizeof( char* ) * (*arc_size + 1)) );
00812 *to_states = (char**)realloc_safe( *to_states, (sizeof( char* ) * (*arc_size)), (sizeof( char* ) * (*arc_size + 1)) );
00813 *ids = (int*)realloc_safe( *ids, (sizeof( int ) * (*arc_size)), (sizeof( int ) * (*arc_size + 1)) );
00814 *excludes = (int*)realloc_safe( *excludes, (sizeof( int ) * (*arc_size)), (sizeof( int ) * (*arc_size + 1)) );
00815 *reasons = (char**)realloc_safe( *reasons, (sizeof( char* ) * (*arc_size)), (sizeof( char* ) * (*arc_size + 1)) );
00816 (*from_states)[(*arc_size)] = vector_to_string( table->fr_states[table->arcs[i]->from], HEXIDECIMAL, TRUE );
00817 (*to_states)[(*arc_size)] = vector_to_string( table->to_states[table->arcs[i]->to], HEXIDECIMAL, TRUE );
00818 (*ids)[(*arc_size)] = table->id + i;
00819 (*excludes)[(*arc_size)] = table->arcs[i]->suppl.part.excluded;
00820
00821 /* If the assertion is currently excluded, check to see if there's a reason associated with it */
00822 if( (table->arcs[i]->suppl.part.excluded == 1) && ((er = exclude_find_exclude_reason( 'F', (table->id + i), funit )) != NULL) ) {
00823 (*reasons)[(*arc_size)] = strdup_safe( er->reason );
00824 } else {
00825 (*reasons)[(*arc_size)] = NULL;
00826 }
00827
00828 (*arc_size)++;
00829 }
00830
00831 }
00832
00833 PROFILE_END;
00834
00835 }
|
|
||||||||||||
|
Merges two FSM arcs, placing the results in the base arc. Merges two FSM arcs into one, placing the result back into the base FSM arc. This function is used to calculate module coverage for the GUI.
00698 { PROFILE(ARC_MERGE);
00699
00700 unsigned int i; /* Loop iterator */
00701
00702 /* Merge state transitions */
00703 for( i=0; i<other->num_arcs; i++ ) {
00704 arc_add( base, other->fr_states[other->arcs[i]->from], other->to_states[other->arcs[i]->to], other->arcs[i]->suppl.part.hit, other->arcs[i]->suppl.part.excluded );
00705 }
00706
00707 PROFILE_END;
00708
00709 }
|
|
|
00401 { PROFILE(ARC_STATE_HITS);
00402
00403 int hit = 0; /* Number of states hit */
00404 unsigned int i; /* Loop iterators */
00405 int* state_hits; /* Contains state hit information */
00406
00407 assert( table != NULL );
00408
00409 /* First, create and intialize a state table to hold hit counts */
00410 state_hits = (int*)malloc_safe( sizeof( int ) * table->num_fr_states );
00411 for( i=0; i<table->num_fr_states; i++ ) {
00412 state_hits[i] = 0;
00413 }
00414
00415 /* Iterate through arc transition array and count unique hits */
00416 for( i=0; i<table->num_arcs; i++ ) {
00417 if( (table->arcs[i]->suppl.part.hit || table->arcs[i]->suppl.part.excluded) ) {
00418 hit += (state_hits[table->arcs[i]->from]++ == 0) ? 1 : 0;
00419 }
00420 }
00421
00422 /* Deallocate state_hits */
00423 free_safe( state_hits, (sizeof( int ) * table->num_fr_states) );
00424
00425 PROFILE_END;
00426
00427 return( hit );
00428
00429 }
|
|
|
00462 { PROFILE(ARC_TRANSITION_EXCLUDED);
00463
00464 int excluded = 0; /* Number of arcs excluded */
00465 unsigned int i; /* Loop iterator */
00466
00467 assert( table != NULL );
00468
00469 for( i=0; i<table->num_arcs; i++ ) {
00470 excluded += table->arcs[i]->suppl.part.excluded;
00471 }
00472
00473 PROFILE_END;
00474
00475 return( excluded );
00476
00477 }
|
|
|
00440 { PROFILE(ARC_TRANSITION_HITS);
00441
00442 int hit = 0; /* Number of arcs hit */
00443 unsigned int i; /* Loop iterator */
00444
00445 assert( table != NULL );
00446
00447 for( i=0; i<table->num_arcs; i++ ) {
00448 hit += table->arcs[i]->suppl.part.hit | table->arcs[i]->suppl.part.excluded;
00449 }
00450
00451 PROFILE_END;
00452
00453 return( hit );
00454
00455 }
|
|
|
Unique identifier for each arc in the design (used for exclusion purposes). This value is assigned to an arc when it is read from the CDD file. |
1.3.4