Home > Community > Blogs > Functional Verification > the new generation testcase utility
 
Login with a Cadence account.
Not a member yet?
Create a permanent login account to make interactions with Cadence more conveniennt.

Register | Membership benefits
Get email delivery of the Functional Verification blog (individual posts).
 

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

The New Generation Testcase Utility

Comments(0)Filed under: Functional Verification, Testbench simulation, IES, Incisive Enterprise Simulator (IES), e, Specman, Aspect Oriented Programming, AOP, IntelliGen

Specman's new Generation Engine, "IntelliGen", adopts an entirely new generation scheme compared to the previous engine, "Pgen".  It groups fields which are related via constraints into a Connected Field Set (CFS) and automatically determines the order in which all CFSs must be solved. All fields of the CFS are solved together (e.g. several fields can be reduced in one reduction step).  For the user, this means that coding your generation model (constraints) can be done in very natural manner, without the need to worry about generation ordering.

Some CFSs in your environment may only contain a couple of fields.  If any unintended generation behaviour surfaces in one of these CFSs, it would probably be pretty easy to debug using the new features of the Generation Debugger.  What happens if you have a contradiction during a long simulation run, or if you have contraditcions during your regression runs (batch mode)?  I would like to introduce a new feature that can save tons of debug time for these types of situations.

The Generation Testcase Utility was released as part of Specman 8.2 and makes use the built-in CFS knowledge of IntelliGen to create a simplified testcase for a particular CFS.  Through simply clicking an icon in the Generation Debugger GUI for the last/currently solved CFS, an e file is written to the directory in which you launched your simulation.  This e file contains a standalone, simplified version of the CFS of interest in which all inputs, fields and constraints to the CFS are replicated.  You can then use the simplified testcase for debugging, allowing you to very quickly and easily make changes and verify your generation results, before introducing your changes to the actual environment.

To make debugging easier, the Generation Testcase Utility breaks up complex inputs into simpler expressions.  For example, say we were attempting to debug a generation issue, such as a contradiction on the "has_coverage" field below, that involved the following constraint on line 77 of the data_poll.e testcase file.

 

keep read_only(direction == TX and active_passive == ACTIVE) => has_coverage == TRUE;

 

 

For this CFS, since the input expression read_only(direction == TX and active_passive == ACTIVE) was determined to be TRUE by IntelliGen, the Testcase Utility simplifies this down to the following:

 

keep test_case_method_1() => has_coverage == TRUE ; // line 77 in @data_poll
// replaced input: read_only(direction == TX and active_passive == ACTIVE) with: test_case_method_1()
test_case_method_1():bool is {
   return TRUE;
};

 

The above simplification removes the need for the user to have to probe both the "direction" and "active_passive" fields in order to determine the value of the LHS of the implication constraint, thus saving debug time.  This may seem trivial for this example however, imagine the time that could be saved if you had a CFS involving dozens of complex constraints and inputs.  Note that there is a pointer back to the original line in the environment in the comments as well as an explanation for the substitution. The Testcase Utility also defines any needed enumerated types, merges any CFS constraints existing in multiple extensions of a particular object into a single struct as well as includes any needed configuration options such as the seed information in an extension to the setup() method in sys.  Below is an example of a complete, self contained testcase generated with seed 881473306 for gen action 1, CFS 461.

 

Testcase.
This is an approximation utility for reconstructing a single CFS.
<'
struct cdn_uart_agent_u {
   has_coverage:bool;
   active_passive:erm_active_passive_t;
   keep read_only(active_passive == ACTIVE) => soft has_coverage == FALSE ;// line 46 in

@cdn_uart_agent
   keep has_coverage == FALSE ;// line 148 in @cdn_uart_apb_sve
   keep test_case_method_1() => has_coverage == TRUE ;// line 77 in @data_poll

   // replaced input: read_only(direction == TX and active_passive == ACTIVE) with:

test_case_method_1()\
   test_case_method_1():bool is{
      return TRUE;
   };
};

type erm_active_passive_t : [ ACTIVE = 0,
                              PASSIVE = 1 ];

extend cdn_uart_agent_u {
   keep read_only(active_passive == PASSIVE) => soft has_coverage == TRUE ;// line 48 in

@cdn_uart_agent
};

struct cdn_uart_apb_sve_u like any_env {
   cdn_uart_agent: cdn_uart_agent_u;
};

extend sys {
   !test_instance : cdn_uart_apb_sve_u;
   run() is also {

      for test_case_index from 1 to 50 { //loop for 50 times in case there is an error you want to

catch
         gen test_instance;
      };
   };
};

extend sys{
   setup() is also{
      --configuring the run to be with same important generation configs.
      --set_config(gen,seed,881473306); //this is the seed that the original environment used
      set_config(gen,exclude_contradicting_subtypes,FALSE);
   };
};
'>

 

Our R&D team has used the Generation Testcase Utility on some of the largest verification environments in the world to assist our leading edge customers with debugging complex verification environments that include millions of lines of e code!  Since the Testcase Utility extracts only the minimal needed information out of the environment, it has proved to be a huge timesaver.  It is also a great way for you to capture any generation issues that you would like our support team to take a closer look at.

1. If interactively using the Generation Debugger, you can click on the new TC Utility icon  in the Generation Debugger to automatically create a testcase with the default naming convention (see below for description of default name)

 

(Click on image for full view)

"IntelliGen's" Generation Debugger Screenshot

 

2. If stopped at a generation error, you can enter the command at the Specman command prompt:
      gen testcase [name]

The default name for the created file is sn_top-module_test_case_seed_gen-action-id_cfs-id.e

3. To automatically generate a testcase if ever an generation error is encountered, you can set the configuration option in Specman: 
      config gen -automatic_tc_util=TRUE

This is a very usful setting for running regressions when you anticipate contradictions (e.g. if you just migrated and environment to use IntelliGen).

For a full description of this new feature, please see the 8.2 Specman IntelliGen User Guide documentation, Section 9.0.

 

 

Happy New Year to all and happy verifying in 2009!

Corey

 

Comments(0)

Leave a Comment


Name
E-mail (will not be published)
Comment
 I have read and agree to the Terms of use and Community Guidelines.
Community Guidelines
The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.