Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

/Users/trevorw/projects/release/covered-0.7.4/src/fsm.h

Go to the documentation of this file.
00001 #ifndef __FSM_H__
00002 #define __FSM_H__
00003 
00004 /*
00005  Copyright (c) 2006-2009 Trevor Williams
00006 
00007  This program is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by the Free Software
00009  Foundation; either version 2 of the License, or (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00012  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00013  See the GNU General Public License for more details.
00014 
00015  You should have received a copy of the GNU General Public License along with this program;
00016  if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00026 #include <stdio.h>
00027 
00028 #include "defines.h"
00029 
00031 fsm* fsm_create(
00032   expression* from_state,
00033   expression* to_state,
00034   bool        exclude
00035 );
00036 
00038 void fsm_add_arc(
00039   fsm*        table,
00040   expression* from_state,
00041   expression* to_state
00042 );
00043 
00045 void fsm_create_tables( fsm* table );
00046 
00048 void fsm_db_write( fsm* table, FILE* file, bool ids_issued );
00049 
00051 void fsm_db_read( char** line, /*@null@*/func_unit* funit );
00052 
00054 void fsm_db_merge(
00055   fsm*   base,
00056   char** line
00057 );
00058 
00060 void fsm_merge(
00061   fsm* base,
00062   fsm* other
00063 );
00064 
00066 void fsm_table_set(
00067   expression*     expr,
00068   const sim_time* time
00069 );
00070 
00072 void fsm_get_stats(
00073             fsm_link* table,
00074   /*@out@*/ int*      state_hit,
00075   /*@out@*/ int*      state_total,
00076   /*@out@*/ int*      arc_hit,
00077   /*@out@*/ int*      arc_total,
00078   /*@out@*/ int*      arc_excluded
00079 );
00080 
00082 void fsm_get_funit_summary(
00083             func_unit* funit,
00084   /*@out@*/ int*       hit,
00085   /*@out@*/ int*       excluded,
00086   /*@out@*/ int*       total
00087 );
00088 
00090 void fsm_get_inst_summary(
00091             funit_inst* inst,
00092   /*@out@*/ int*        hit,
00093   /*@out@*/ int*        excluded,
00094   /*@out@*/ int*        total
00095 );
00096 
00098 void fsm_collect(
00099             func_unit* funit,
00100             int        cov,
00101   /*@out@*/ sig_link** sig_head,
00102   /*@out@*/ sig_link** sig_tail,
00103   /*@out@*/ int**      expr_ids,
00104   /*@out@*/ int**      excludes
00105 );
00106 
00108 void fsm_get_coverage(
00109             func_unit*    funit,
00110             int           expr_id,
00111   /*@out@*/ char***       total_fr_states,
00112   /*@out@*/ unsigned int* total_fr_state_num,
00113   /*@out@*/ char***       total_to_states,
00114   /*@out@*/ unsigned int* total_to_state_num,
00115   /*@out@*/ char***       hit_fr_states,
00116   /*@out@*/ unsigned int* hit_fr_state_num,
00117   /*@out@*/ char***       hit_to_states,
00118   /*@out@*/ unsigned int* hit_to_state_num,
00119   /*@out@*/ char***       total_from_arcs,
00120   /*@out@*/ char***       total_to_arcs,
00121   /*@out@*/ int**         total_ids,
00122   /*@out@*/ int**         excludes,
00123   /*@out@*/ char***       reasons,
00124   /*@out@*/ int*          total_arc_num,
00125   /*@out@*/ char***       hit_from_arcs,
00126   /*@out@*/ char***       hit_to_arcs,
00127   /*@out@*/ int*          hit_arc_num,
00128   /*@out@*/ char***       input_state,
00129   /*@out@*/ unsigned int* input_size,
00130   /*@out@*/ char***       output_state,
00131   /*@out@*/ unsigned int* output_size
00132 );
00133 
00135 void fsm_report( FILE* ofile, bool verbose );
00136 
00138 void fsm_dealloc( fsm* table );
00139 
00140 #endif
00141 

Generated on Wed Jun 17 22:19:19 2009 for Covered by doxygen 1.3.4