Included below is a simple utility you can cut & paste that allows you to collect some valuable statistics about your environment so you can better gauge the amount of work that might be required to migrate from PGEN to IntelliGen. The ICFS stats feature is of particular benefit as it not only identifies the approximate number of ICFSs in the environment, it also breaks the total number down according to generation contexts (structs/units and gen-on-the-fly statements) allowing you to better focus your migration efforts. IMPORTANT: Sometimes a given environment can trigger a large number of IntelliGen linting messages right off the bat. Don't let this freak you out! This does not mean that migration will be a long effort as quite often some slight changes to an environment remove a large number of identified issues. I recently encountered a situation where a simple change to three locations in the environment, removed 500+ ICFSs! The methods in the utility below can be used to report information on the following: - Number of e modules - Number of lines in the environment (including blanks and comments) - Number and type of IntelliGen Guidelines linting messages - Number of Inconsistently Connected Field Sets (ICFSs) - Number of ICFS contexts and how many ICFSs per context - Number of soft..select overlays found in the envioronment - Number of Laces identified in the environment To use the code below, simply load it before/after loading e-code and then you can execute any of the following methods: - sys.print_file_stats() : prints # of lines and files - sys.print_constraint_stats() : prints # of constraints in the environment - sys.print_guideline_stats() : prints # of each type of linting message - sys.print_icfs_stats() : prints # of ICFSs, contexts and #ICFS/context - sys.print_soft_select_stats(): prints # of soft select overlay issues - sys.print_lace_stats() : *Only works for SPMNv6.2s4 and later* prints # of laces identified in the environment Each of the above calls to methods produces it's own log files containing relevant information. - file_stats_log.elog : Output of "show modules" command - constraint_log.elog : Output of the "show constraint" command - guidelines_log.elog : Output of "gen lint -g" (with notification set to MAX_INT in order to get all warnings) - icfs_log.elog : Output of "gen lint -i" command - soft_select_log.elog: Output of the "gen lint -s" command - lace_log.elog : Output of the "show lace" command <' extend sys { // Prints out number of files in the environment and number of lines // of code in total (including comments and blank lines) print_file_stats() is { out(""); out("--- Environment Info ---"); // output into a separate log file specman("set log file_stats_log {show modules}"); var log_file: file; log_file = files.open("file_stats_log.elog", "r", "Text file"); var line_string: string; var line_count: uint; var num_files: uint; while files.read(log_file, line_string) { // look for lines which start with "nr." and report the second number if str_match(line_string,"/^[0-9]+\.\s+([a-zA-Z_0-9]+)\s+([0-9]+)/") { // add them up line_count += $2.as_a(uint); num_files += 1; }; }; // report number of lines - 268 (amount of lines in this file) out("Number of environment files is :",(num_files)); out("Number of environment lines is :",(line_count-268)," (including comments and blank lines)"); out("*Note: More file information can be found in the file_stats_log.elog file"); files.close(log_file); }; // Prints out the approximate number of constraints in the environment print_constraint_stats() is { out(""); out("--- Constraint Info ---"); // output "show constraints" into a separate log file specman("set log constraint_log {show constraints}"); var log_file: file; log_file = files.open("constraint_log.elog", "r", "Text file"); var line_string: string; var constraint_count: uint; while files.read(log_file, line_string) { // find constraint messages if str_match(line_string,"/keep/") { // add them up constraint_count += 1; }; }; // while files.rea... // out("Approximate number of constraints detected : ", constraint_count, "(unencrypted code only)"); out("*Note: Detailed constraint info can be found in the constraint_log.elog file"); files.close(log_file); }; // Print out the number of guidelines linting messages, broken down into categories print_guideline_stats() is { out(""); out("--- Guidelines Linting Info ---"); // output into a separate log file specman("set notify -max_messages=MAX_INT WARN_GEN_LINT*"); specman("set log guidelines_log {gen lint -g}"); var log_file: file; log_file = files.open("guidelines_log.elog", "r", "Text file"); var line_string: string; var g1_count: uint; var g2_count: uint; var g3_count: uint; var g4_count: uint; var g5_count: uint; while files.read(log_file, line_string) { // look for lines which have G1/G12 warnings if str_match(line_string,"...Warning: WARN_GEN_LINTER_G1...") { // add them up g1_count += 1; }; // look for lines which have G2/G22 warnings if str_match(line_string,"...Warning: WARN_GEN_LINTER_G2...") { // add them up g2_count += 1; }; // look for lines which have G3/G32 warnings if str_match(line_string,"...Warning: WARN_GEN_LINTER_G3...") { // add them up g3_count += 1; }; // look for lines which have G4/G42 warnings if str_match(line_string,"...Warning: WARN_GEN_LINTER_G4...") { // add them up g4_count += 1; }; // look for lines which have G5/G52 warnings if str_match(line_string,"...Warning: WARN_GEN_LINTER_G5...") { // add them up g5_count += 1; }; }; // out("number of G1/G12 warnings is: ", g1_count); out("number of G2/G22 warnings is: ", g2_count); out("number of G3/G32 warnings is: ", g3_count); out("number of G4/G42 warnings is: ", g4_count); out("number of G5/G52 warnings is: ", g5_count); out("*Note: Linting messages can be found in the guidelines_log.elog file"); files.close(log_file); }; // Print out the approximate number of ICFSs in the environment, organized according // to context print_icfs_stats() is { out(""); out("--- Inconsistency Linting Info ---"); // output into a separate log file specman("set notify -max_messages=MAX_INT WARN_GEN_LINT*"); specman("set log icfs_log {gen lint -i}"); var log_file: file; log_file = files.open("icfs_log.elog", "r", "Text file"); var line_string: string; var icfs_count: uint; var context_count: uint; var icfs_per_context_count: uint; var first_context : bool = TRUE; while files.read(log_file, line_string) { // find ICFSs if str_match(line_string,"/-- Inconsistent Connection --/") { // add them up icfs_count += 1; icfs_per_context_count += 1; }; // find contexts if str_match(line_string,"/Inconsistent Connections in context of/"){ // If this is the first occurrence of this message, we will not // have aquired any icfs_per_context_count yet, so do not print // this to screen if (!first_context) then { out("Number of ICFSs in this context: ",icfs_per_context_count); } else { first_context = FALSE; }; // ! if (!first_co... context_count += 1; // output the context to the screen. The count will be // printed when the next str_match occurs out(context_count,": ",line_string); icfs_per_context_count = 0; }; }; // while files.rea... out(""); out("Total number of ICFSs is : ", icfs_count); out("Total number of ICFS contexts: ", context_count); out("*Note: ICFS linting messages can be found in the icfs_log.elog file"); files.close(log_file); }; // Print out the number of soft..select warnings print_soft_select_stats() is { out(""); out("--- Soft..Select Linting Info ---"); // output into a separate log file specman("set notify -max_messages=MAX_INT WARN_GEN_LINT*"); specman("set log soft_select_log {gen lint -s}"); var log_file: file; log_file = files.open("soft_select_log.elog", "r", "Text file"); var line_string: string; var ss_count: uint; while files.read(log_file, line_string) { // find soft select messages if str_match(line_string,"/-- Inconsistent Select after Soft --/") { // add them up ss_count += 1; }; }; // while files.rea... // out("Number of soft..select overlay issues is: ", ss_count); out("*Note: Soft..Select linting messages can be found in the soft_select_log.elog file"); files.close(log_file); }; // Print out the total number of lace constraints found in the environment print_lace_stats() is { out(""); out("--- Lace Info ---"); // output "show lace" into a separate log file // the "show lace" command is only valid in v6.2s4 and later specman("set log lace_log {show lace}"); var log_file: file; log_file = files.open("lace_log.elog", "r", "Text file"); var line_string: string; var lace_count: uint; while files.read(log_file, line_string) { // find lace messages if str_match(line_string,"/LACE constraint:/") { // add them up lace_count += 1; }; }; // while files.rea... // out("Number of Laces detected : ", lace_count); if lace_count > 0 then { out("*Note: Lace messages can be found in the lace_log.elog file"); }; files.close(log_file); }; }; '>