fsm.h

Go to the documentation of this file.
00001 #ifndef __FSM_H__
00002 #define __FSM_H__
00003 
00004 /*
00005  Copyright (c) 2006-2010 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   int         line,
00035   bool        exclude
00036 );
00037 
00039 void fsm_add_arc(
00040   fsm*        table,
00041   expression* from_state,
00042   expression* to_state
00043 );
00044 
00046 void fsm_create_tables(
00047   fsm* table
00048 );
00049 
00051 void fsm_db_write(
00052   fsm*  table,
00053   FILE* file,
00054   bool  ids_issued
00055 );
00056 
00058 void fsm_db_read(
00059              char**     line,
00060   /*@null@*/ func_unit* funit
00061 );
00062 
00064 void fsm_db_merge(
00065   fsm*   base,
00066   char** line
00067 );
00068 
00070 void fsm_merge(
00071   fsm* base,
00072   fsm* other
00073 );
00074 
00076 void fsm_table_set(
00077   expression*     expr,
00078   const sim_time* time
00079 );
00080 
00082 void fsm_get_stats(
00083             fsm_link* table,
00084   /*@out@*/ int*      state_hit,
00085   /*@out@*/ int*      state_total,
00086   /*@out@*/ int*      arc_hit,
00087   /*@out@*/ int*      arc_total,
00088   /*@out@*/ int*      arc_excluded
00089 );
00090 
00092 void fsm_get_funit_summary(
00093             func_unit* funit,
00094   /*@out@*/ int*       hit,
00095   /*@out@*/ int*       excluded,
00096   /*@out@*/ int*       total
00097 );
00098 
00100 void fsm_get_inst_summary(
00101             funit_inst* inst,
00102   /*@out@*/ int*        hit,
00103   /*@out@*/ int*        excluded,
00104   /*@out@*/ int*        total
00105 );
00106 
00108 void fsm_collect(
00109             func_unit* funit,
00110             int        cov,
00111   /*@out@*/ sig_link** sig_head,
00112   /*@out@*/ sig_link** sig_tail,
00113   /*@out@*/ int**      expr_ids,
00114   /*@out@*/ int**      excludes
00115 );
00116 
00118 void fsm_get_coverage(
00119             func_unit*    funit,
00120             int           expr_id,
00121   /*@out@*/ char***       total_fr_states,
00122   /*@out@*/ unsigned int* total_fr_state_num,
00123   /*@out@*/ char***       total_to_states,
00124   /*@out@*/ unsigned int* total_to_state_num,
00125   /*@out@*/ char***       hit_fr_states,
00126   /*@out@*/ unsigned int* hit_fr_state_num,
00127   /*@out@*/ char***       hit_to_states,
00128   /*@out@*/ unsigned int* hit_to_state_num,
00129   /*@out@*/ char***       total_from_arcs,
00130   /*@out@*/ char***       total_to_arcs,
00131   /*@out@*/ int**         total_ids,
00132   /*@out@*/ int**         excludes,
00133   /*@out@*/ char***       reasons,
00134   /*@out@*/ int*          total_arc_num,
00135   /*@out@*/ char***       hit_from_arcs,
00136   /*@out@*/ char***       hit_to_arcs,
00137   /*@out@*/ int*          hit_arc_num,
00138   /*@out@*/ char***       input_state,
00139   /*@out@*/ unsigned int* input_size,
00140   /*@out@*/ char***       output_state,
00141   /*@out@*/ unsigned int* output_size
00142 );
00143 
00145 void fsm_report(
00146   FILE* ofile,
00147   bool  verbose
00148 );
00149 
00151 void fsm_dealloc(
00152   fsm* table
00153 );
00154 
00155 #endif
00156 
Generated on Sun Nov 21 00:55:35 2010 for Covered by  doxygen 1.6.3