score.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <sys/times.h>
#include <unistd.h>
#include "db.h"
#include "defines.h"
#include "fsm_arg.h"
#include "fsm_var.h"
#include "info.h"
#include "link.h"
#include "ovl.h"
#include "parse.h"
#include "param.h"
#include "perf.h"
#include "score.h"
#include "search.h"
#include "sys_tasks.h"
#include "util.h"
#include "vector.h"
#include "vpi.h"

Functions

void process_timescale (const char *txt, bool report)
void define_macro (const char *name, const char *value)
static void score_usage ()
static void score_generate_top_vpi_module (const char *vpi_file, const char *output_db, const char *top_inst)
void score_generate_top_dumpvars_module (const char *dumpvars_file)
 Creates a module that contains all of the signals to dump from the design for coverage purposes.
static void score_generate_pli_tab_file (const char *tab_file, const char *top_mod)
void score_parse_define (const char *def)
 Parses the specified define from the command-line.
static bool score_parse_args (int argc, int last_arg, const char **argv)
void command_score (int argc, int last_arg, const char **argv)
 Parses score command-line and performs score.

Variables

char * top_module = NULL
char * top_instance = NULL
static char * output_db = NULL
static char * dump_file = NULL
static int dump_mode = DUMP_FMT_NONE
char * lxt_file = NULL
static char * vpi_file = NULL
char * dumpvars_file = NULL
int delay_expr_type = DELAY_EXPR_DEFAULT
char * ppfilename = NULL
bool instance_specified = FALSE
uint64 timestep_update = 0
int flag_race_check = WARNING
bool flag_check_races = TRUE
static bool flag_display_sim_stats = FALSE
unsigned int flag_global_generation = GENERATION_SV
bool flag_use_command_line_debug = FALSE
char * command_line_debug_file = NULL
str_linkgen_mod_head = NULL
static str_linkgen_mod_tail = NULL
static char * timescale = NULL
char * cdd_message = NULL
bool flag_conservative = FALSE
str_linkrace_ignore_mod_head = NULL
str_linkrace_ignore_mod_tail = NULL
int64 largest_malloc_size
int64 curr_malloc_size
str_linkuse_files_head
char user_msg [USER_MSG_LENGTH]
char * directive_filename
bool debug_mode
isuppl info_suppl
char * pragma_coverage_name
char * pragma_racecheck_name
char score_run_path [4096]
bool warnings_suppressed
str_linksim_plusargs_head
str_linksim_plusargs_tail

Detailed Description

Author:
Trevor Williams (phase1geo@gmail.com)
Date:
11/29/2001

Function Documentation

void command_score ( int  argc,
int  last_arg,
const char **  argv 
)

Parses score command-line and performs score.

Performs score command functionality.

Parameters:
argc Number of arguments in score command-line
last_arg Index of last parsed argument in list
argv Arguments from command-line to parse

References Catch_anonymous, COVERED_HEADER, db_close(), db_create(), defparam_dealloc(), DFLT_OUTPUT_CDD, directive_filename, dump_file, DUMP_FMT_FST, DUMP_FMT_LXT, DUMP_FMT_NONE, DUMP_FMT_VCD, dump_mode, dumpvars_file, FALSE, flag_display_sim_stats, free_safe, fsm_var_cleanup(), HEADER, largest_malloc_size, NORMAL, output_db, parse_and_score_dumpfile(), parse_design(), perf_output_inst_report(), ppfilename, pragma_coverage_name, pragma_racecheck_name, print_output(), PROFILE, PROFILE_END, score_generate_pli_tab_file(), score_generate_top_vpi_module(), score_parse_args(), search_free_lists(), search_init(), str_link_delete_list(), strdup_safe, sys_task_dealloc(), Throw, timescale, top_instance, top_module, TRUE, Try, user_msg, USER_MSG_LENGTH, and vpi_file.

Referenced by main().

01179   { PROFILE(COMMAND_SCORE);
01180 
01181   unsigned int rv;  /* Return value from snprintf calls */
01182   bool         error = FALSE;
01183 
01184   /* Output header information */
01185   rv = snprintf( user_msg, USER_MSG_LENGTH, COVERED_HEADER );
01186   assert( rv < USER_MSG_LENGTH );
01187   print_output( user_msg, HEADER, __FILE__, __LINE__ );
01188 
01189   Try {
01190 
01191     /* Create a database to start storing the results */
01192     (void)db_create();
01193 
01194     /* Parse score command-line */
01195     if( !score_parse_args( argc, last_arg, argv ) ) {
01196 
01197       if( output_db == NULL ) {
01198         output_db = strdup_safe( DFLT_OUTPUT_CDD );
01199       }
01200  
01201       /* Parse design */
01202       if( use_files_head != NULL ) {
01203         print_output( "Reading design...", NORMAL, __FILE__, __LINE__ );
01204         search_init();
01205         parse_design( top_module, output_db );
01206         print_output( "", NORMAL, __FILE__, __LINE__ );
01207       }
01208 
01209       /* Generate VPI-based top module */
01210       if( vpi_file != NULL ) {
01211 
01212         rv = snprintf( user_msg, USER_MSG_LENGTH, "Outputting VPI file %s...", vpi_file );
01213         assert( rv < USER_MSG_LENGTH );
01214         print_output( user_msg, NORMAL, __FILE__, __LINE__ );
01215         score_generate_top_vpi_module( vpi_file, output_db, top_instance );
01216         score_generate_pli_tab_file( vpi_file, top_module );
01217 
01218       /* Read dumpfile and score design */
01219       } else if( dump_mode != DUMP_FMT_NONE ) {
01220 
01221         switch( dump_mode ) {
01222           case DUMP_FMT_VCD :  rv = snprintf( user_msg, USER_MSG_LENGTH, "Scoring VCD dumpfile %s...", dump_file );  break;
01223           case DUMP_FMT_LXT :  rv = snprintf( user_msg, USER_MSG_LENGTH, "Scoring LXT dumpfile %s...", dump_file );  break;
01224           case DUMP_FMT_FST :  rv = snprintf( user_msg, USER_MSG_LENGTH, "Scoring FST dumpfile %s...", dump_file );  break;
01225         }
01226         assert( rv < USER_MSG_LENGTH );
01227         print_output( user_msg, NORMAL, __FILE__, __LINE__ );
01228         parse_and_score_dumpfile( output_db, dump_file, dump_mode );
01229         print_output( "", NORMAL, __FILE__, __LINE__ );
01230 
01231       }
01232 
01233       if( dump_mode != DUMP_FMT_NONE ) {
01234         print_output( "***  Scoring completed successfully!  ***\n", NORMAL, __FILE__, __LINE__ );
01235       }
01236       /*@-duplicatequals -formatcode -formattype@*/
01237       rv = snprintf( user_msg, USER_MSG_LENGTH, "Dynamic memory allocated:   %" FMT64 "u bytes", largest_malloc_size );
01238       assert( rv < USER_MSG_LENGTH );
01239       /*@=duplicatequals =formatcode =formattype@*/
01240       print_output( user_msg, NORMAL, __FILE__, __LINE__ );
01241       print_output( "", NORMAL, __FILE__, __LINE__ );
01242 
01243       /* Display simulation statistics if specified */
01244       if( flag_display_sim_stats ) {
01245         perf_output_inst_report( stdout );
01246       }
01247 
01248     }
01249 
01250   } Catch_anonymous {
01251     fsm_var_cleanup();
01252     error = TRUE;
01253   }
01254 
01255   /* Close database */
01256   db_close();
01257 
01258   /* Deallocate memory for search engine */
01259   search_free_lists();
01260 
01261   /* Deallocate memory for defparams */
01262   defparam_dealloc();
01263 
01264   /* Deallocate memory for system tasks */
01265   sys_task_dealloc();
01266 
01267   /* Deallocate generation module string list */
01268   str_link_delete_list( gen_mod_head );
01269 
01270   /* Deallocate race ignore string list */
01271   str_link_delete_list( race_ignore_mod_head );
01272 
01273   free_safe( output_db, (strlen( output_db ) + 1) );
01274   free_safe( dump_file, (strlen( dump_file ) + 1) );
01275   free_safe( vpi_file, (strlen( vpi_file ) + 1) );
01276   free_safe( dumpvars_file, (strlen( dumpvars_file ) + 1) );
01277   free_safe( top_module, (strlen( top_module ) + 1) );
01278   free_safe( ppfilename, (strlen( ppfilename ) + 1) );
01279   ppfilename = NULL;
01280 
01281   free_safe( directive_filename, (strlen( directive_filename ) + 1) );
01282   free_safe( top_instance, (strlen( top_instance ) + 1) );
01283   free_safe( timescale, (strlen( timescale ) + 1) );
01284   free_safe( pragma_coverage_name, (strlen( pragma_coverage_name ) + 1) );
01285   free_safe( pragma_racecheck_name, (strlen( pragma_racecheck_name ) + 1) );
01286 
01287   if( error ) {
01288     Throw 0;
01289   }
01290 
01291   PROFILE_END;
01292 
01293 }

void define_macro ( const char *  name,
const char *  value 
)
void process_timescale ( const char *  txt,
bool  report 
)

Referenced by score_parse_args().

static void score_generate_pli_tab_file ( const char *  tab_file,
const char *  top_mod 
) [static]
Parameters:
tab_file Name of PLI tab file to create
top_mod Name of top-level module
Exceptions:
anonymous Throw

Creates a PLI table file.

References Catch_anonymous, FATAL, free_safe, malloc_safe, print_output(), PROFILE, scope_extract_front(), strdup_safe, Throw, Try, user_msg, and USER_MSG_LENGTH.

Referenced by command_score().

00425   { PROFILE(SCORE_GENERATE_PLI_TAB_FILE);
00426 
00427   FILE* tfile;     /* File handle of VPI tab file - only necessary for VCS */
00428   char* mod_name;  /* Name of VPI module */
00429   char* ext;       /* Extension of VPI module */
00430 
00431   /* Extract the name of the module from the given filename */
00432   mod_name = (char*)malloc_safe( strlen( tab_file ) + 5 );
00433   ext      = strdup_safe( tab_file );
00434   scope_extract_front( tab_file, mod_name, ext );
00435 
00436   Try {
00437 
00438     if( ext[0] != '\0' ) {
00439 
00440       strcat( mod_name, ".tab" );
00441       if( (tfile = fopen( mod_name, "w" )) != NULL ) {
00442 
00443         unsigned int rv;
00444         fprintf( tfile, "$covered_sim  call=covered_sim_calltf  acc+=r,cbk:%s+\n", top_mod );
00445         rv = fclose( tfile );
00446         assert( rv == 0 );
00447 
00448       } else {
00449   
00450         unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unable to open %s for writing", mod_name );
00451         assert( rv < USER_MSG_LENGTH );
00452         print_output( user_msg, FATAL, __FILE__, __LINE__ );
00453         Throw 0;
00454 
00455       }
00456 
00457     } else {
00458 
00459       print_output( "Specified -vpi filename did not contain a file extension", FATAL, __FILE__, __LINE__ );
00460       Throw 0;
00461 
00462     }
00463 
00464   } Catch_anonymous {
00465     free_safe( mod_name, (strlen( mod_name ) + 1) );
00466     free_safe( ext, (strlen( ext ) + 1) );
00467     Throw 0;
00468   }
00469 
00470   /* Deallocate memory */
00471   free_safe( mod_name, (strlen( tab_file ) + 5) );
00472   free_safe( ext, (strlen( tab_file ) + 1) );
00473 
00474 }

void score_generate_top_dumpvars_module ( const char *  dumpvars_file  ) 

Creates a module that contains all of the signals to dump from the design for coverage purposes.

Exceptions:
anonymous Throw

Creates the dumpvars top-level module to use for dumping only needed portions of the design to the designated dumpfile.

Parameters:
dumpvars_file Name of dumpvars file to create

References Catch_anonymous, db_output_dumpvars(), FATAL, free_safe, print_output(), PROFILE, PROFILE_END, scope_extract_front(), strdup_safe, Throw, timescale, Try, user_msg, and USER_MSG_LENGTH.

Referenced by parse_design().

00354   { PROFILE(SCORE_GENERATE_TOP_DUMPVARS_MODULE);
00355 
00356   FILE* vfile;     /* File handle to top-level module */
00357   char* mod_name;  /* Name of dumpvars module */
00358   char* ext;       /* Extension of dumpvars module */
00359 
00360   /* Extract the name of the module from the given filename */
00361   mod_name = strdup_safe( dumpvars_file );
00362   ext      = strdup_safe( dumpvars_file );
00363   scope_extract_front( dumpvars_file, mod_name, ext );
00364 
00365   Try {
00366 
00367     if( ext[0] != '\0' ) {
00368 
00369       if( (vfile = fopen( dumpvars_file, "w" )) != NULL ) {
00370 
00371         unsigned int rv;
00372         if( timescale != NULL ) {
00373           fprintf( vfile, "`timescale %s\n", timescale );
00374         }
00375         fprintf( vfile, "module %s;\n", mod_name );
00376         fprintf( vfile, "initial begin\n" );
00377         fprintf( vfile, "  $dumpfile( \"%s.vcd\" );\n", mod_name );
00378         db_output_dumpvars( vfile );
00379         fprintf( vfile, "end\n" );
00380         fprintf( vfile, "endmodule\n" );
00381         rv = fclose( vfile );
00382         assert( rv == 0 );
00383 
00384       } else {
00385 
00386         unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unable to open %s for writing", dumpvars_file );
00387         assert( rv < USER_MSG_LENGTH );
00388         print_output( user_msg, FATAL, __FILE__, __LINE__ );
00389         Throw 0;
00390 
00391       }
00392 
00393     } else {
00394 
00395       print_output( "Specified -dumpvars filename did not contain a file extension", FATAL, __FILE__, __LINE__ );
00396       Throw 0;
00397 
00398     }
00399 
00400   } Catch_anonymous {
00401     free_safe( mod_name, (strlen( mod_name ) + 1) );
00402     free_safe( ext, (strlen( ext ) + 1) );
00403     Throw 0;
00404   }
00405 
00406   /* Deallocate memory */
00407   free_safe( mod_name, (strlen( dumpvars_file ) + 1) );
00408   free_safe( ext, (strlen( dumpvars_file ) + 1) );
00409 
00410   PROFILE_END;
00411 
00412 }

static void score_generate_top_vpi_module ( const char *  vpi_file,
const char *  output_db,
const char *  top_inst 
) [static]
Exceptions:
anonymous Throw

Creates a Verilog file that calls the Covered VPI system task.

Parameters:
vpi_file Name of VPI module to create
output_db Name of output CDD database file
top_inst Name of top-level instance

References Catch_anonymous, FATAL, free_safe, print_output(), PROFILE, PROFILE_END, scope_extract_front(), strdup_safe, Throw, timescale, Try, user_msg, and USER_MSG_LENGTH.

Referenced by command_score().

00291   { PROFILE(SCORE_GENERATE_TOP_VPI_MODULE);
00292 
00293   FILE* vfile;     /* File handle to VPI top-level module */
00294   char* mod_name;  /* Name of VPI module */
00295   char* ext;       /* Extension of VPI module */
00296 
00297   /* Extract the name of the module from the given filename */
00298   mod_name = strdup_safe( vpi_file );
00299   ext      = strdup_safe( vpi_file );
00300   scope_extract_front( vpi_file, mod_name, ext );
00301 
00302   Try {
00303  
00304     if( ext[0] != '\0' ) {
00305 
00306       if( (vfile = fopen( vpi_file, "w" )) != NULL ) {
00307   
00308         unsigned int rv;
00309         if( timescale != NULL ) {
00310           fprintf( vfile, "`timescale %s\n", timescale );
00311         }
00312         fprintf( vfile, "module %s;\ninitial $covered_sim( \"%s\", %s );\nendmodule\n", mod_name, output_db, top_inst );
00313         rv = fclose( vfile );
00314         assert( rv == 0 );
00315 
00316       } else {
00317   
00318         unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unable to open %s for writing", vpi_file );
00319         assert( rv < USER_MSG_LENGTH );
00320         print_output( user_msg, FATAL, __FILE__, __LINE__ );
00321         Throw 0;
00322 
00323       }
00324 
00325     } else {
00326 
00327       print_output( "Specified -vpi filename did not contain a file extension", FATAL, __FILE__, __LINE__ );
00328       Throw 0;
00329 
00330     }
00331 
00332   } Catch_anonymous {
00333     free_safe( mod_name, (strlen( mod_name ) + 1) );
00334     free_safe( ext, (strlen( ext ) + 1) );
00335     Throw 0;
00336   }
00337 
00338   /* Deallocate memory */
00339   free_safe( mod_name, (strlen( vpi_file ) + 1) );
00340   free_safe( ext, (strlen( vpi_file ) + 1) );
00341 
00342   PROFILE_END;
00343 
00344 }

static bool score_parse_args ( int  argc,
int  last_arg,
const char **  argv 
) [static]
Returns:
Returns TRUE if the help option was parsed.
Exceptions:
anonymous search_add_directory_path Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw Throw score_parse_args ovl_add_assertions_to_no_score_list fsm_arg_parse read_command_file search_add_file defparam_add search_add_extensions search_add_no_score_funit

Parses score command argument list and performs specified functions based on these arguments.

Parameters:
argc Number of arguments specified in argv parameter list
last_arg Index of last parsed argument in list
argv List of arguments to parse

References isuppl_u::assert_ovl, Catch_anonymous, cdd_message, check_option_value(), cli_read_hist_file(), define_macro(), defparam_add(), DELAY_EXPR_DEFAULT, DELAY_EXPR_MAX, DELAY_EXPR_MIN, DELAY_EXPR_TYP, delay_expr_type, DFLT_DUMPVARS_NAME, DFLT_VPI_NAME, dump_file, DUMP_FMT_FST, DUMP_FMT_LXT, DUMP_FMT_NONE, DUMP_FMT_VCD, dump_mode, dumpvars_file, isuppl_u::excl_always, isuppl_u::excl_assign, isuppl_u::excl_final, isuppl_u::excl_init, isuppl_u::excl_pragma, FALSE, FATAL, file_exists(), flag_check_races, flag_conservative, flag_display_sim_stats, flag_global_generation, flag_race_check, flag_use_command_line_debug, free_safe, fsm_arg_parse(), GENERATION_1995, GENERATION_2001, GENERATION_SV, instance_specified, is_legal_filename(), is_variable(), NORMAL, output_db, ovl_add_assertions_to_no_score_list(), isuppl_u::part, ppfilename, pragma_coverage_name, pragma_racecheck_name, print_output(), process_timescale(), PROFILE, read_command_file(), score_add_args(), score_parse_define(), score_run_path, score_usage(), search_add_directory_path(), search_add_extensions(), search_add_file(), search_add_include_path(), search_add_no_score_funit(), str_link_add(), strdup_safe, sys_task_store_plusarg(), Throw, timescale, timestep_update, top_instance, top_module, TRUE, Try, user_msg, USER_MSG_LENGTH, vector_from_string(), vpi_file, WARNING, and warnings_suppressed.

Referenced by command_score().

00518   { PROFILE(SCORE_PARSE_ARGS);
00519 
00520   int   i = last_arg + 1;  /* Loop iterator */
00521   int   j;                 /* Loop iterator */
00522   char* ptr;               /* Pointer to current character in defined value */
00523   char* rv;                /* Return value from snprintf calls */
00524   bool  help_found = FALSE;
00525 
00526   while( (i < argc) && !help_found ) {
00527 
00528     if( strncmp( "-h", argv[i], 2 ) == 0 ) {
00529 
00530       score_usage();
00531       help_found = TRUE;
00532 
00533     } else if( strncmp( "-i", argv[i], 2 ) == 0 ) {
00534 
00535       if( check_option_value( argc, argv, i ) ) {
00536         i++;
00537         if( instance_specified ) {
00538           print_output( "Only one -i option may be present on the command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00539         } else {
00540           top_instance       = strdup_safe( argv[i] );
00541           score_add_args( argv[i-1], argv[i] );
00542           instance_specified = TRUE;
00543         }
00544       } else {
00545         Throw 0;
00546       }
00547 
00548     } else if( (strncmp( "-o", argv[i], 2 ) == 0) || (strncmp( "-cdd", argv[i], 4 ) == 0) ) {
00549 
00550       if( check_option_value( argc, argv, i ) ) {
00551         i++;
00552         if( output_db != NULL ) {
00553           print_output( "Only one -o/-cdd option may be present on the command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00554         } else {
00555           if( file_exists( argv[i] ) || is_legal_filename( argv[i] ) ) {
00556             output_db = strdup_safe( argv[i] );
00557             score_add_args( argv[i-1], argv[i] );
00558           } else {
00559             unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Output file \"%s\" is not writable", argv[i] );
00560             assert( rv < USER_MSG_LENGTH );
00561             print_output( user_msg, FATAL, __FILE__, __LINE__ );
00562             Throw 0;
00563           }
00564         }
00565       } else {
00566         Throw 0;
00567       }
00568 
00569     } else if( strncmp( "-ts", argv[i], 3 ) == 0 ) {
00570 
00571       if( check_option_value( argc, argv, i ) ) {
00572         i++;
00573         if( timestep_update != 0 ) {
00574           print_output( "Only one -ts option may be present on the command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00575         } else {
00576           timestep_update = ato64( argv[i] );
00577           score_add_args( argv[i-1], argv[i] );
00578         }
00579       } else {
00580         Throw 0;
00581       }
00582 
00583     } else if( strncmp( "-t", argv[i], 2 ) == 0 ) {
00584 
00585       if( check_option_value( argc, argv, i ) ) {
00586         i++;
00587         if( top_module != NULL ) {
00588           print_output( "Only one -t option may be present on the command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00589         } else {
00590           if( is_variable( argv[i] ) ) {
00591             top_module = strdup_safe( argv[i] );
00592             score_add_args( argv[i-1], argv[i] );
00593           } else {
00594             unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Illegal top-level module name specified \"%s\"", argv[i] );
00595             assert( rv < USER_MSG_LENGTH );
00596             print_output( user_msg, FATAL, __FILE__, __LINE__ );
00597             Throw 0;
00598           }
00599         }
00600       } else {
00601         Throw 0;
00602       }
00603 
00604     } else if( strncmp( "-I", argv[i], 2 ) == 0 ) {
00605 
00606       if( check_option_value( argc, argv, i ) ) {
00607         i++;
00608         search_add_include_path( argv[i] );
00609         score_add_args( argv[i-1], argv[i] );
00610       } else {
00611         Throw 0;
00612       }
00613 
00614     } else if( strncmp( "-y", argv[i], 2 ) == 0 ) {
00615 
00616       if( check_option_value( argc, argv, i ) ) {
00617         i++;
00618         search_add_directory_path( argv[i] );
00619         score_add_args( argv[i-1], argv[i] );
00620       } else {
00621         Throw 0;
00622       }
00623 
00624     } else if( strncmp( "-F", argv[i], 2 ) == 0 ) {
00625 
00626       if( check_option_value( argc, argv, i ) ) {
00627         i++;
00628         fsm_arg_parse( argv[i] );
00629         score_add_args( argv[i-1], argv[i] );
00630       } else {
00631         Throw 0;
00632       }
00633       
00634     } else if( strncmp( "-fst", argv[i], 4 ) == 0 ) {
00635 
00636       if( check_option_value( argc, argv, i ) ) {
00637         i++;
00638         switch( dump_mode ) {
00639           case DUMP_FMT_NONE :
00640             if( file_exists( argv[i] ) ) {
00641               dump_file = strdup_safe( argv[i] );
00642               dump_mode = DUMP_FMT_FST;
00643               score_add_args( argv[i-1], argv[i] );
00644             } else {
00645               unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "FST dumpfile not found \"%s\"", argv[i] );
00646               assert( rv < USER_MSG_LENGTH );
00647               print_output( user_msg, FATAL, __FILE__, __LINE__ );
00648               Throw 0;
00649             }
00650             break;
00651           case DUMP_FMT_VCD :
00652             print_output( "Both the -vcd and -lxt options were specified on the command-line", FATAL, __FILE__, __LINE__ );
00653             Throw 0;
00654             /*@-unreachable@*/
00655             break;
00656             /*@=unreachable@*/
00657           case DUMP_FMT_LXT :
00658             print_output( "Both the -lxt and -fst options were specified on the command-line", FATAL, __FILE__, __LINE__ );
00659             Throw 0;
00660             /*@-unreachable@*/
00661             break;
00662             /*@=unreachable@*/
00663           case DUMP_FMT_FST :
00664             print_output( "Only one -fst option is allowed on the score command-line", FATAL, __FILE__, __LINE__ );
00665             Throw 0;
00666             /*@-unreachable@*/
00667             break;
00668             /*@=unreachable@*/
00669           default :
00670             assert( 0 );
00671             break;
00672         }
00673       } else {
00674         Throw 0;
00675       }
00676 
00677     } else if( strncmp( "-f", argv[i], 2 ) == 0 ) {
00678 
00679       if( check_option_value( argc, argv, i ) ) {
00680         char** arg_list = NULL;
00681         int    arg_num  = 0;
00682         i++;
00683         Try {
00684           read_command_file( argv[i], &arg_list, &arg_num );
00685           help_found = score_parse_args( arg_num, -1, (const char**)arg_list );
00686         } Catch_anonymous {
00687           for( j=0; j<arg_num; j++ ) {
00688             free_safe( arg_list[j], (strlen( arg_list[j] ) + 1) );
00689           }
00690           free_safe( arg_list, (sizeof( char* ) * arg_num) );
00691           Throw 0;
00692         }
00693         for( j=0; j<arg_num; j++ ) {
00694           free_safe( arg_list[j], (strlen( arg_list[j] ) + 1) );
00695         }
00696         free_safe( arg_list, (sizeof( char* ) * arg_num) );
00697       } else {
00698         Throw 0;
00699       }
00700 
00701     } else if( strncmp( "-ec", argv[i], 3 ) == 0 ) {
00702 
00703       info_suppl.part.excl_assign = 1;
00704       score_add_args( argv[i], NULL );
00705 
00706     } else if( strncmp( "-ea", argv[i], 3 ) == 0 ) {
00707 
00708       info_suppl.part.excl_always = 1;
00709       score_add_args( argv[i], NULL );
00710 
00711     } else if( strncmp( "-ei", argv[i], 3 ) == 0 ) {
00712 
00713       info_suppl.part.excl_init = 1;
00714       score_add_args( argv[i], NULL );
00715 
00716     } else if( strncmp( "-ef", argv[i], 3 ) == 0 ) {
00717 
00718       info_suppl.part.excl_final = 1;
00719       score_add_args( argv[i], NULL );
00720 
00721     } else if( strncmp( "-ep", argv[i], 3 ) == 0 ) {
00722 
00723       info_suppl.part.excl_pragma = 1;
00724       score_add_args( argv[i], NULL );
00725       if( ((i+1) < argc) && (argv[i+1][0] != '-') ) {
00726         i++;
00727         pragma_coverage_name = strdup_safe( argv[i] );
00728         score_add_args( argv[i], NULL );
00729       } else {
00730         pragma_coverage_name = strdup_safe( "coverage" );
00731       }
00732 
00733     } else if( strncmp( "-e", argv[i], 2 ) == 0 ) {
00734 
00735       if( check_option_value( argc, argv, i ) ) {
00736         i++;
00737         search_add_no_score_funit( argv[i] );
00738         score_add_args( argv[i-1], argv[i] );
00739       } else {
00740         Throw 0;
00741       }
00742 
00743     } else if( strncmp( "-vcd", argv[i], 4 ) == 0 ) {
00744 
00745       if( check_option_value( argc, argv, i ) ) {
00746         i++;
00747         switch( dump_mode ) {
00748           case DUMP_FMT_NONE :
00749             if( file_exists( argv[i] ) ) {
00750               dump_file = strdup_safe( argv[i] );
00751               dump_mode = DUMP_FMT_VCD;
00752               score_add_args( argv[i-1], argv[i] );
00753             } else {
00754               unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "VCD dumpfile not found \"%s\"", argv[i] );
00755               assert( rv < USER_MSG_LENGTH );
00756               print_output( user_msg, FATAL, __FILE__, __LINE__ );
00757               Throw 0;
00758             }
00759             break;
00760           case DUMP_FMT_VCD :
00761             print_output( "Only one -vcd option is allowed on the score command-line", FATAL, __FILE__, __LINE__ );
00762             Throw 0;
00763             /*@-unreachable@*/
00764             break;
00765             /*@=unreachable@*/
00766           case DUMP_FMT_LXT :
00767             print_output( "Both the -vcd and -lxt options were specified on the command-line", FATAL, __FILE__, __LINE__ );
00768             Throw 0;
00769             /*@-unreachable@*/
00770             break;
00771             /*@=unreachable@*/
00772           case DUMP_FMT_FST :
00773             print_output( "Both the -vcd and -fst options were specified on the command-line", FATAL, __FILE__, __LINE__ );
00774             Throw 0;
00775             /*@-unreachable@*/
00776             break;
00777             /*@=unreachable@*/
00778           default :
00779             assert( 0 );
00780             break;
00781         }
00782       } else {
00783         Throw 0;
00784       }
00785 
00786     } else if( strncmp( "-lxt", argv[i], 4 ) == 0 ) {
00787  
00788       if( check_option_value( argc, argv, i ) ) {
00789         i++; 
00790         switch( dump_mode ) {
00791           case DUMP_FMT_NONE :
00792             if( file_exists( argv[i] ) ) {
00793               dump_file = strdup_safe( argv[i] );
00794               dump_mode = DUMP_FMT_LXT;
00795               score_add_args( argv[i-1], argv[i] );
00796             } else {
00797               unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "LXT dumpfile not found \"%s\"", argv[i] );
00798               assert( rv < USER_MSG_LENGTH );
00799               print_output( user_msg, FATAL, __FILE__, __LINE__ );
00800               Throw 0;
00801             }
00802             break;
00803           case DUMP_FMT_VCD :
00804             print_output( "Both the -vcd and -lxt options were specified on the command-line", FATAL, __FILE__, __LINE__ );
00805             Throw 0;
00806             /*@-unreachable@*/
00807             break;
00808             /*@=unreachable@*/
00809           case DUMP_FMT_LXT :
00810             print_output( "Only one -lxt option is allowed on the score command-line", FATAL, __FILE__, __LINE__ );
00811             Throw 0;
00812             /*@-unreachable@*/
00813             break;
00814             /*@=unreachable@*/
00815           case DUMP_FMT_FST :
00816             print_output( "Both the -lxt and -fst options were specified on the command-line", FATAL, __FILE__, __LINE__ );
00817             Throw 0;
00818             /*@-unreachable@*/
00819             break;
00820             /*@=unreachable@*/
00821           default :
00822             assert( 0 );
00823             break;
00824         }
00825       } else {
00826         Throw 0;
00827       }
00828 
00829     } else if( strncmp( "-top_ts", argv[i], 7 ) == 0 ) {
00830 
00831       if( check_option_value( argc, argv, i ) ) {
00832         i++;
00833         if( timescale != NULL ) {
00834           print_output( "Only one -top_ts option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00835           if( (i == argc) || (argv[i][0] == '-') ) {
00836             i--;
00837           }
00838         } else {
00839           process_timescale( argv[i], FALSE );
00840           timescale = strdup_safe( argv[i] );
00841           score_add_args( argv[i-1], argv[i] );
00842         }
00843       } else {
00844         Throw 0;
00845       }
00846 
00847     } else if( strncmp( "-vpi", argv[i], 4 ) == 0 ) {
00848 
00849       i++;
00850       if( vpi_file != NULL ) {
00851         print_output( "Only one -vpi option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00852         if( (i == argc) || (argv[i][0] == '-') ) {
00853           i--;
00854         }
00855       } else {
00856         if( (i < argc) && (argv[i][0] != '-') ) {
00857           vpi_file = strdup_safe( argv[i] );
00858           score_add_args( argv[i-1], argv[i] );
00859         } else {
00860           vpi_file = strdup_safe( DFLT_VPI_NAME );
00861           i--;
00862           score_add_args( argv[i], NULL );
00863         }
00864       }
00865 
00866     } else if( strncmp( "-dumpvars", argv[i], 9 ) == 0 ) {
00867 
00868       i++;
00869       if( dumpvars_file != NULL ) {
00870         print_output( "Only one -dumpvars option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00871         if( (i == argc) || (argv[i][0] == '-') ) {
00872           i--;
00873         }
00874       } else {
00875         if( (i < argc) && (argv[i][0] != '-') ) {
00876           dumpvars_file = strdup_safe( argv[i] );
00877           score_add_args( argv[i-1], argv[i] );
00878         } else {
00879           dumpvars_file = strdup_safe( DFLT_DUMPVARS_NAME );
00880           i--;
00881           score_add_args( argv[i], NULL );
00882         }
00883       }
00884 
00885     } else if( strncmp( "-v", argv[i], 2 ) == 0 ) {
00886 
00887       if( check_option_value( argc, argv, i ) ) {
00888         i++;
00889         search_add_file( argv[i] );
00890         score_add_args( argv[i-1], argv[i] );
00891       } else {
00892         Throw 0;
00893       }
00894 
00895     } else if( strncmp( "+libext+", argv[i], 8 ) == 0 ) {
00896 
00897       search_add_extensions( argv[i] + 8 );
00898       score_add_args( argv[i], NULL );
00899 
00900     } else if( strncmp( "-D", argv[i], 2 ) == 0 ) {
00901 
00902       if( check_option_value( argc, argv, i ) ) {
00903         i++;
00904         score_parse_define( argv[i] );
00905         score_add_args( argv[i-1], argv[i] );
00906       } else {
00907         Throw 0;
00908       }
00909  
00910     } else if( strncmp( "-p", argv[i], 2 ) == 0 ) {
00911       
00912       if( check_option_value( argc, argv, i ) ) {
00913         i++;
00914         if( ppfilename != NULL ) {
00915           print_output( "Only one -p option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00916         } else {
00917           if( is_variable( argv[i] ) ) {
00918             ppfilename = strdup_safe( argv[i] );
00919             score_add_args( argv[i-1], argv[i] );
00920           } else {
00921             unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unrecognizable filename %s specified for -p option.", argv[i] );
00922             assert( rv < USER_MSG_LENGTH );
00923             print_output( user_msg, FATAL, __FILE__, __LINE__ );
00924             Throw 0;
00925           }
00926         }
00927       } else {
00928         Throw 0;
00929       }
00930         
00931     } else if( strncmp( "-P", argv[i], 2 ) == 0 ) {
00932 
00933       if( check_option_value( argc, argv, i ) ) {
00934         char* tmp = strdup_safe( argv[i+1] );
00935         Try {
00936           i++;
00937           ptr = tmp;
00938           while( (*ptr != '\0') && (*ptr != '=') ) {
00939             ptr++;
00940           }
00941           if( *ptr == '\0' ) {
00942             print_output( "Option -P must specify a value to assign.  See \"covered score -h\" for more information.",
00943                           FATAL, __FILE__, __LINE__ );
00944             Throw 0;
00945           } else {
00946             vector* vec;
00947             int     base;
00948             score_add_args( argv[i-1], argv[i] );
00949             *ptr = '\0';
00950             ptr++;
00951             vector_from_string( &ptr, FALSE, &vec, &base );
00952             if( vec == NULL ) {
00953               unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unable to parse value for option -P %s=%s", tmp, ptr );
00954               assert( rv < USER_MSG_LENGTH );
00955               print_output( user_msg, FATAL, __FILE__, __LINE__ );
00956               Throw 0;
00957             }
00958             defparam_add( tmp, vec );
00959           }
00960         } Catch_anonymous {
00961           free_safe( tmp, (strlen( argv[i] ) + 1) );
00962           Throw 0;
00963         }
00964         free_safe( tmp, (strlen( argv[i] ) + 1) );
00965       } else {
00966         Throw 0;
00967       }
00968       
00969     } else if( strncmp( "-T", argv[i], 2 ) == 0 ) {
00970       
00971       if( check_option_value( argc, argv, i ) ) {
00972         i++;
00973         if( delay_expr_type != DELAY_EXPR_DEFAULT ) {
00974           print_output( "Only one -T option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
00975         } else {
00976           if( strcmp( argv[i], "min" ) == 0 ) {
00977             delay_expr_type = DELAY_EXPR_MIN;
00978             score_add_args( argv[i-1], argv[i] );
00979           } else if( strcmp( argv[i], "max" ) == 0 ) {
00980             delay_expr_type = DELAY_EXPR_MAX;
00981             score_add_args( argv[i-1], argv[i] );
00982           } else if( strcmp( argv[i], "typ" ) == 0 ) {
00983             delay_expr_type = DELAY_EXPR_TYP;
00984             score_add_args( argv[i-1], argv[i] );
00985           } else {
00986             unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unknown -T value (%s).  Please specify min, max or typ.", argv[i] );
00987             assert( rv < USER_MSG_LENGTH );
00988             print_output( user_msg, FATAL, __FILE__, __LINE__ );
00989             Throw 0;
00990           }
00991         }
00992       } else {
00993         Throw 0;
00994       }
00995 
00996     } else if( strncmp( "-r", argv[i], 2 ) == 0 ) {
00997 
00998       switch( argv[i][2] ) {
00999         case 'E'  :  flag_race_check  = FATAL;    break;
01000         case 'W'  :  flag_race_check  = WARNING;  break;
01001         case 'I'  :
01002           if( argv[i][3] == '=' ) {
01003             (void)str_link_add( strdup_safe( argv[i] + 4 ), &race_ignore_mod_head, &race_ignore_mod_tail );
01004           } else { 
01005             flag_check_races = FALSE;
01006           }
01007         case 'S'  :
01008         case '\0' :  flag_race_check  = NORMAL;   break;
01009         case 'P'  :
01010           if( argv[i][3] == '=' ) {
01011             pragma_racecheck_name = strdup_safe( argv[i] + 4 );
01012           } else {
01013             pragma_racecheck_name = strdup_safe( "racecheck" );
01014           }
01015           break;
01016         default   :
01017           {
01018             unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unknown race condition value %c (available types are E, W, S, I or P)", argv[i][2] );
01019             assert( rv < USER_MSG_LENGTH );
01020             print_output( user_msg, FATAL, __FILE__, __LINE__ );
01021             Throw 0;
01022           }
01023           /*@-unreachable@*/
01024           break;
01025           /*@=unreachable@*/
01026       }
01027       score_add_args( argv[i], NULL );
01028 
01029     } else if( strncmp( "-S", argv[i], 2 ) == 0 ) {
01030 
01031       flag_display_sim_stats = TRUE;
01032       score_add_args( argv[i], NULL );
01033 
01034     } else if( strncmp( "-A", argv[i], 2 ) == 0 ) {
01035 
01036       if( check_option_value( argc, argv, i ) ) {
01037         i++;
01038         if( strncmp( argv[i], "ovl", 3 ) == 0 ) {
01039           info_suppl.part.assert_ovl = 1;
01040           define_macro( "OVL_VERILOG",  "1" );
01041           define_macro( "OVL_COVER_ON", "1" );
01042           score_add_args( argv[i-1], argv[i] );
01043         } else {
01044           unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unknown -A value (%s).  Please specify ovl.", argv[i] );
01045           assert( rv < USER_MSG_LENGTH );
01046           print_output( user_msg, FATAL, __FILE__, __LINE__ );
01047           Throw 0;
01048         }
01049       } else {
01050         Throw 0;
01051       }
01052 
01053     } else if( strncmp( "-g", argv[i], 2 ) == 0 ) {
01054 
01055       int  generation;
01056       char tmp[256];
01057 
01058       if( check_option_value( argc, argv, i ) ) {
01059         i++;
01060         if( argv[i][(strlen( argv[i] ) - 1)] == '1' ) {
01061           generation = GENERATION_1995;
01062         } else if( argv[i][(strlen( argv[i] ) - 1)] == '2' ) {
01063           generation = GENERATION_2001;
01064         } else if( argv[i][(strlen( argv[i] ) - 1)] == '3' ) {
01065           generation = GENERATION_SV;
01066         } else {
01067           unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unknown generation value '%c'.  Legal values are 1, 2 or 3.", argv[i][(strlen( argv[i] ) - 1)] );
01068           assert( rv < USER_MSG_LENGTH );
01069           print_output( user_msg, FATAL, __FILE__, __LINE__ ); 
01070           Throw 0;
01071         }
01072         if( strlen( argv[i] ) == 1 ) {
01073           flag_global_generation = generation;
01074         } else {
01075           strcpy( tmp, argv[i] );
01076           if( tmp[(strlen( tmp ) - 2)] == '=' ) {
01077             str_link* strl;
01078             tmp[(strlen( tmp ) - 2)] = '\0';
01079             strl        = str_link_add( strdup_safe( tmp ), &gen_mod_head, &gen_mod_tail );
01080             strl->suppl = generation;
01081           } else {
01082             unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Illegal -g syntax \"%s\".  See \"covered score -h\" for correct syntax.", tmp );
01083             assert( rv < USER_MSG_LENGTH );
01084             print_output( user_msg, FATAL, __FILE__, __LINE__ );
01085             Throw 0;
01086           }
01087         }
01088         score_add_args( argv[i-1], argv[i] );
01089       } else {
01090         Throw 0;
01091       }
01092 
01093     } else if( strncmp( "-cli", argv[i], 4 ) == 0 ) {
01094 
01095 #ifdef DEBUG_MODE
01096       i++;
01097       if( flag_use_command_line_debug ) {
01098         print_output( "Only one -cli option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
01099         if( (i == argc) || (argv[i][0] == '-') ) {
01100           i--;
01101         }
01102       } else {
01103         if( (i < argc) && (argv[i][0] != '-') ) {
01104           cli_read_hist_file( argv[i] );
01105           score_add_args( argv[i-1], argv[i] );
01106         } else {
01107           i--;
01108           score_add_args( argv[i], argv[i] );
01109         }
01110         flag_use_command_line_debug = TRUE;
01111       }
01112 #else
01113       print_output( "Command-line debugger (-cli option) is not available because Covered was not configured with the --enable-debug option", FATAL, __FILE__, __LINE__ );
01114       Throw 0;
01115 #endif
01116 
01117     } else if( strncmp( "-m", argv[i], 2 ) == 0 ) {
01118 
01119       if( check_option_value( argc, argv, i ) ) {
01120         i++;
01121         if( cdd_message != NULL ) {
01122           print_output( "Only one -m option is allowed on the score command-line.  Using first value...", WARNING, __FILE__, __LINE__ );
01123         } else {
01124           cdd_message = strdup_safe( argv[i] );
01125         }
01126       } else {
01127         Throw 0;
01128       }
01129 
01130     } else if( strncmp( "-conservative", argv[i], 13 ) == 0 ) {
01131 
01132       flag_conservative = TRUE;
01133 
01134     } else if( strncmp( "-Wignore", argv[i], 8 ) == 0 ) {
01135 
01136       warnings_suppressed = TRUE;
01137 
01138     /* Any other option that is a plusarg will be added to the list of simulation plusargs */
01139     } else if( strncmp( "+", argv[i], 1 ) == 0 ) {
01140 
01141       sys_task_store_plusarg( argv[i] + 1 );
01142       score_add_args( argv[i], NULL );
01143 
01144     } else {
01145 
01146       unsigned int rv = snprintf( user_msg, USER_MSG_LENGTH, "Unknown score command option \"%s\".  See \"covered score -h\" for more information.", argv[i] );
01147       assert( rv < USER_MSG_LENGTH );
01148       print_output( user_msg, FATAL, __FILE__, __LINE__ );
01149       Throw 0;
01150 
01151     }
01152 
01153     i++;
01154 
01155   }
01156 
01157   if( !help_found ) {
01158 
01159     /* If the -A option was not specified, add all OVL modules to list of no-score modules */
01160     ovl_add_assertions_to_no_score_list( info_suppl.part.assert_ovl );
01161     
01162     /* Get the current directory */
01163     rv = getcwd( score_run_path, 4096 );
01164     assert( rv != NULL );
01165 
01166   }
01167 
01168   return( help_found );
01169 
01170 }

void score_parse_define ( const char *  def  ) 

Parses the specified define from the command-line.

Parameters:
def Define value to parse

Parses the specified define from the command-line, storing the define value in the define tree according to its value.

References define_macro(), free_safe, PROFILE, and strdup_safe.

Referenced by score_parse_args().

00482                                            { PROFILE(SCORE_PARSE_DEFINE);
00483 
00484   char* tmp = strdup_safe( def );  /* Temporary copy of the given argument */
00485   char* ptr = tmp;                 /* Pointer to current character in define */
00486 
00487   while( (*ptr != '\0') && (*ptr != '=') ) {
00488     ptr++;
00489   }
00490 
00491   if( *ptr == '=' ) {
00492     *ptr = '\0';
00493     ptr++;
00494     define_macro( tmp, ptr );
00495   } else {
00496     define_macro( tmp, "" );
00497   }
00498 
00499   /* Deallocate memory */
00500   free_safe( tmp, (strlen( def ) + 1) );
00501 
00502 }

static void score_usage (  )  [static]

Displays usage information for score command.

References DFLT_VPI_NAME.

Referenced by score_parse_args().

00162                           {
00163 
00164   printf( "\n" );
00165   printf( "Usage:  covered score (-h | -t <top-level_module_name> [-vcd <dumpfile> | -lxt <dumpfile> | -fst <dumpfile>] [<options>])\n" );
00166   printf( "\n" );
00167   printf( "   Dumpfile formats:\n" );
00168   printf( "      Both the VCD and LXT style dumpfiles are supported by Covered.\n" );
00169   printf( "\n" );
00170   printf( "      If either the -vcd, -lxt, or -fst option is specified, the design is scored using this dumpfile\n" );
00171   printf( "      for coverage gathering.  If neither option is specified, Covered will only create an\n" );
00172   printf( "      initial CDD file from the design and will not attempt to score the design.  An error message\n" );
00173   printf( "      will be displayed if both options are present on the command-line.\n" );
00174   printf( "\n" );
00175   printf( "   -h                              Displays this help information.\n" );
00176   printf( "\n" );
00177   printf( "   Options:\n" );
00178   printf( "      -vpi (<name>)                Generates Verilog module called <name> which contains code to\n" );
00179   printf( "                                     allow Covered to run as a VPI during simulation.  If <name>\n" );
00180   printf( "                                     is not specified, the module file is called %s\n", DFLT_VPI_NAME );
00181   printf( "                                     If the -vcd option is specified along with this option, this\n" );
00182   printf( "                                     option will not be used.\n" );
00183   printf( "      -dumpvars (<name>)           Generates Verilog module called <name> which contains code to\n" );
00184   printf( "                                     dump only the signals in the design that are necessary for coverage\n" );
00185   printf( "                                     purposes.  If compiled as a top-module along with your design and no\n" );
00186   printf( "                                     other $dumpfile/$dumpvars calls are made, this dump module will provide\n" );
00187   printf( "                                     additional performance gains.  The name of the dumpfile created is called\n" );
00188   printf( "                                     <name>.vcd\n" );
00189   printf( "      -top_ts <timescale>          This option is only valid when the -vpi or -dumpvars options have been specified.\n" );
00190   printf( "                                     This option allows the user to specify a timescale for the generated\n" );
00191   printf( "                                     Verilog module.  If this option is not specified, no timescale will\n" );
00192   printf( "                                     be created for the generated module.  The value of <timescale> is\n" );
00193   printf( "                                     specified as follows:\n" );
00194   printf( "                                       (1|10|100)(s|ms|us|ns|ps|fs)/(1|10|100)(s|ms|us|ns|ps|fs)\n" );
00195   printf( "                                     If whitespace is needed between the various values, place the\n" );
00196   printf( "                                     entire contents of <timescale> in double quotes.\n" );
00197   printf( "      -i <instance_name>           Verilog hierarchical scope of top-level module to score.\n" );
00198   printf( "                                     Necessary if module to verify coverage is not the top-level\n" );
00199   printf( "                                     module in the design.  If not specified, -t value is used.\n" );
00200   printf( "      -o <database_filename>       Name of database to write coverage information to.\n" );
00201   printf( "      -cdd <database_filename>     Name of database to read coverage information from (same as -o).\n" );
00202   printf( "      -I <directory>               Directory to find included Verilog files.\n" );
00203   printf( "      -f <filename>                Name of file containing additional arguments to parse.\n" );
00204   printf( "      -F <module>=(<ivar>,)<ovar>  Module, input state variable and output state variable of\n" );
00205   printf( "                                     an FSM state variable.  If input variable (ivar) is not specified,\n" );
00206   printf( "                                     the output variable (ovar) is also used as the input variable.\n" ); 
00207   printf( "      -A ovl                       Specifies that any OVL assertion found in the design should be\n" );
00208   printf( "                                     automatically included for assertion coverage.\n" );
00209   printf( "      -y <directory>               Directory to find unspecified Verilog files.\n" );
00210   printf( "      -v <filename>                Name of specific Verilog file to score.\n" );
00211   printf( "      -D <define_name>(=<value>)   Defines the specified name to 1 or the specified value.\n" );
00212   printf( "      -p <filename>                Specifies name of file to use for preprocessor output.\n" );
00213   printf( "      -P <parameter_scope>=<value> Performs a defparam on the specified parameter with value.\n" );
00214   printf( "      -T min|typ|max               Specifies value to use in delay expressions of the form min:typ:max.\n" );
00215   printf( "      -ts <number>                 If design is being scored, specifying this option will output\n" );
00216   printf( "                                     the current timestep (by increments of <number>) to standard output.\n" );
00217   printf( "      -S                           Outputs simulation performance information after scoring has completed.  This\n" );
00218   printf( "                                     information is currently only useful for the developers of Covered.\n" );
00219   printf( "      -g (<module>=)[1|2|3]        Selects generation of Verilog syntax that the parser will handle.  If\n" );
00220   printf( "                                     <module>= is present, only the specified module will use the provided\n" );
00221   printf( "                                     generation.  If <module>= is not specified, the entire design will use\n" );
00222   printf( "                                     the provided generation.  1=Verilog-1995, 2=Verilog-2001, 3=SystemVerilog\n" );
00223   printf( "                                     By default, the latest generation is parsed.\n" );
00224   printf( "      -cli (<filename>)            Causes the command-line debugger to be used during VCD/LXT dumpfile scoring.\n" );
00225   printf( "                                     If <filename> is specified, this file contains information saved in a previous\n" );
00226   printf( "                                     call to savehist on the CLI and causes the history contained in this file to be\n" );
00227   printf( "                                     replayed prior to the CLI command prompt.  If <filename> is not specified, the\n" );
00228   printf( "                                     CLI prompt will be immediately available at the start of simulation.  This option\n" );
00229   printf( "                                     is only available when Covered is configured with the --enable-debug option.\n" );
00230   printf( "      -m <message>                 Allows the user to specify information about this CDD file.  This information can\n" );
00231   printf( "                                     be anything (messages with whitespace should be surrounded by double-quotation marks),\n" );
00232   printf( "                                     but may include something about the simulation arguments to more easily link the\n" );
00233   printf( "                                     CDD file to its simulation for purposes of recreating the CDD file.\n" );
00234   printf( "      -conservative                If this option is specified, any logic blocks that contain code that could cause coverage\n" );
00235   printf( "                                     discrepancies leading to potentially inaccurate coverage results are removed from\n" );
00236   printf( "                                     coverage consideration.  See User's Guide for more information on what type of code\n" );
00237   printf( "                                     can lead to coverage inaccuracies.\n" );
00238   printf( "      -Wignore                     Suppress the output of warnings during code parsing and simulation.\n" );
00239   printf( "\n" );
00240   printf( "      +libext+.<extension>(+.<extension>)+\n" );
00241   printf( "                                   Extensions of Verilog files to allow in scoring\n" );
00242   printf( "\n" );
00243   printf( "   Race Condition Options:\n" );
00244   printf( "\n" );
00245   printf( "     If race condition checks are violated by one or more blocks in the design, the following options specify to Covered\n" );
00246   printf( "     how to handle them.\n" );
00247   printf( "\n" );
00248   printf( "      -rS                          Silent.  Remove the logic blocks from coverage consideration without reporting the information.\n" );
00249   printf( "      -rW                          Warning.  Remove the logic blocks from coverage consideration and report the information.  Default.\n" );
00250   printf( "      -rE                          Error.  Report the race condition violations and stop scoring.\n" );
00251   printf( "      -rI[=<module name>]          Ignore.  If =<module name> is not specified, do not perform race condition checking for the entire\n" );
00252   printf( "                                     design.  If =<module name> is specified, do not perform race condition checking on the specified module\n" );
00253   printf( "                                     only.  This option may be specified more than once.\n" );
00254   printf( "      -rP[=<name>]                 Use pragmas.  Skip race condition checking for all code surrounded by // racecheck off/on\n" );
00255   printf( "                                     embedded pragmas.  The \"racecheck\" keyword can be changed by specifying =<name> where <name>\n" );
00256   printf( "                                     is the new name for the race condition pragma keyword.\n" );
00257   printf( "\n" );
00258   printf( "   Optimization Options:\n" );
00259   printf( "      -e <block_name>              Name of module, task, function or named begin/end block to not score.\n" );
00260   printf( "      -ec                          Exclude continuous assignment blocks from coverage.\n" );
00261   printf( "      -ea                          Exclude always blocks from coverage.\n" );
00262   printf( "      -ei                          Exclude initial blocks from coverage.\n" );
00263   printf( "      -ef                          Exclude final blocks from coverage.\n" );
00264   printf( "      -ep [<name>]                 Exclude all code enclosed by pragmas.  By default, the pragmas are of\n" );
00265   printf( "                                     the format '// coverage (on|off)'; however, if <name> is specified for\n" );
00266   printf( "                                     this option, the pragma keyword 'coverage' will be replaced with that value.\n" );
00267   printf( "\n" );
00268   printf( "    Note:\n" );
00269   printf( "      The top-level module specifies the module to begin scoring.  All\n" );
00270   printf( "      modules beneath this module in the hierarchy will also be scored\n" );
00271   printf( "      unless these modules are explicitly stated to not be scored using\n" );
00272   printf( "      the -e flag.\n" );
00273   printf( "\n" );
00274   printf( "    Note:\n" );
00275   printf( "      Any plusargs that need to be passed to the score command can be added anywhere in the score command options.\n" );
00276   printf( "      Example:\n" );
00277   printf( "        covered score -t main -v top.v -vcd top.vcd +plusarg_option1 +plusarg_option2=13 -o top.cdd\n" );
00278   printf( "\n" );
00279 
00280 }


Variable Documentation

char* cdd_message = NULL

User-supplied message to include in the CDD database

Specifies the name of an input file to use for debugging

Contains the total number of bytes malloc'ed during the simulation run. This information is output to the user after simulation as a performance indicator.

If set to TRUE, causes debug information to be spewed to screen.

int delay_expr_type = DELAY_EXPR_DEFAULT

Value to use when a delay expression with min:typ:max

Referenced by score_parse_args().

Referenced by command_score().

char* dump_file = NULL [static]

Name of dumpfile to parse

Referenced by command_score(), and score_parse_args().

int dump_mode = DUMP_FMT_NONE [static]

Specifies dumpfile format to parse

Referenced by command_score(), and score_parse_args().

char* dumpvars_file = NULL

Name of dumpvars output file to write contents to

Referenced by command_score(), parse_design(), and score_parse_args().

Specifies if race condition checking should occur

Referenced by parse_design(), and score_parse_args().

Specifies if we should be conservative in our approach to simulation. If this flag is set, we will remove logic blocks from coverage consideration that contain supported functionality but functionality that might not be right depending on the design.

Referenced by score_parse_args().

bool flag_display_sim_stats = FALSE [static]

Specifies if simulation performance information should be output

Referenced by command_score(), and score_parse_args().

unsigned int flag_global_generation = GENERATION_SV

Specifies the supported global generation value

int flag_race_check = WARNING

Specifies how race conditions should be handled

Specifies whether the command-line debugger should be enabled

Pointer to the head of the generation module list

str_link* gen_mod_tail = NULL [static]

Pointer to the tail of the generation module list

Informational line for the CDD file.

Specifies if -i option was specified

Holds the largest number of bytes in allocation at one period of time.

char* lxt_file = NULL

Name of LXT dumpfile to parse

char* output_db = NULL [static]

Name of output score database file to generate

Referenced by command_score(), and score_parse_args().

char* ppfilename = NULL

Name of preprocessor filename to use

Referenced by command_score(), parse_design(), and score_parse_args().

Referenced by command_score(), and score_parse_args().

Referenced by command_score(), and score_parse_args().

Pointer to head of string list containing the names of modules that should be ignored for race condition checking.

Pointer to tail of string list containing the names of modules that should be ignored for race condition checking.

char score_run_path[4096]

Specifes the pathname where the score command was originally run from.

Referenced by args_db_read(), info_db_write(), and score_parse_args().

char* timescale = NULL [static]

Specifies the user-supplied timescale information for VPI

Referenced by command_score(), score_generate_top_dumpvars_module(), score_generate_top_vpi_module(), and score_parse_args().

uint64 timestep_update = 0

Specifies timestep increment to display current time

char* top_instance = NULL

Name of top-level instance name

char* top_module = NULL

Name of top-level module to score

Pointer to head element of used files list

char user_msg[USER_MSG_LENGTH]

Holds some output that will be displayed via the print_output command. This is created globally so that memory does not need to be reallocated for each function that wishes to use it.

char* vpi_file = NULL [static]

Name of VPI output file to write contents to

Referenced by command_score(), and score_parse_args().

If set to TRUE, suppresses all warnings from being displayed.

Referenced by print_output(), and score_parse_args().

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