As noted in white papers, posts on the Team Specman Blog, and the Specman documentation, IntelliGen is a totally new stimulus generator than the original "Pgen" and, as a result, there is some amount of effort needed to migrate an existing verification environment to fully leverage the power of IntelliGen. One of the main steps in migrating code is running the linters on your code and adressing the issues highlighted.
Included below is a simple utility you can include in your environment that allows you to collect some valuable statistics about your code base to allow you to better gauge the amount of work that might be required to migrate from Pgen to IntelliGen. The ICFS statistics reported are of particular benefit as the utility 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 included in the utility 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 (stored in the current working directory) containing relevant information for more detailed analysis.
- 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