fst.h File Reference

Contains functions for FST parsing/simulation. More...

Go to the source code of this file.

Functions

void fst_parse (const char *fst_file)
 Parses and scores FST-style dumpfile.

Detailed Description

Contains functions for FST parsing/simulation.

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

Function Documentation

void fst_parse ( const char *  fst_file  ) 

Parses and scores FST-style dumpfile.

Main FST parsing function. Reads in an FST-style dumpfile, tells Covered about signal information and simulation results.

Parameters:
fst_file Name of FST file to read and score

References Catch_anonymous, db_check_dumpfile_scopes(), db_do_timestep(), FALSE, FATAL, free_safe, fst_callback(), fst_reader_process_hier(), fstReaderClose(), fstReaderIterBlocks(), fstReaderOpen(), fstReaderSetFacProcessMaskAll(), malloc_safe_nolimit, print_output(), PROFILE, PROFILE_END, symtable_create(), symtable_dealloc(), Throw, Try, vcd_prevtime, vcd_prevtime_valid, and vcd_symtab_size.

Referenced by parse_and_score_dumpfile().

00276   { PROFILE(FST_PARSE);
00277 
00278   struct fstReaderContext *xc;
00279 
00280   printf( "fst_file: %s\n", fst_file );
00281 
00282   /* Open LXT file for opening and extract members */
00283   if( (xc = fstReaderOpen( fst_file )) != NULL ) {
00284 
00285     /* Create initial symbol table */
00286     vcd_symtab = symtable_create();
00287 
00288     Try {
00289 
00290       /* Handle the dumpfile definitions */
00291       fst_reader_process_hier( xc );
00292 
00293       /* Check to see that at least one instance was found */
00294       db_check_dumpfile_scopes(); 
00295           
00296       /* Create timestep symbol table array */
00297       if( vcd_symtab_size > 0 ) {
00298         timestep_tab = malloc_safe_nolimit( sizeof( symtable*) * vcd_symtab_size );
00299       }
00300         
00301       /* Not sure what this does but it seems to be a requirement of the FST reader */
00302       fstReaderSetFacProcessMaskAll( xc );
00303 
00304       /* Perform simulation */
00305       fstReaderIterBlocks( xc, fst_callback, NULL, NULL );
00306 
00307       /* Perform last simulation if necessary */
00308       if( vcd_prevtime_valid ) {
00309         (void)db_do_timestep( vcd_prevtime, FALSE );
00310       }
00311 
00312     } Catch_anonymous {
00313       symtable_dealloc( vcd_symtab );
00314       free_safe( timestep_tab, (sizeof( symtable* ) * vcd_symtab_size) );
00315       fstReaderClose( xc );
00316       Throw 0;
00317     }
00318         
00319     /* Deallocate memory */
00320     symtable_dealloc( vcd_symtab );
00321     free_safe( timestep_tab, (sizeof( symtable* ) * vcd_symtab_size) );
00322 
00323     /* Close FST file */
00324     fstReaderClose( xc );
00325 
00326   } else {
00327 
00328     print_output( "Unable to read data from FST dumpfile.  Exiting without scoring.", FATAL, __FILE__, __LINE__ );
00329     Throw 0;
00330 
00331   }
00332 
00333   PROFILE_END;
00334 
00335 }

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