Thursday, February 09, 2012     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: Contradiction only without collect gen
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
SomeDude
Posts: 12
Online: User is Offline
3/28/2008 8:34 AM  
Helle there,

I'm currently having a hard time figuring out some odd behaviour.

when I run a test in a certain configuration, specman throws a contradiction and request a rerun with collect gen. When running with collect gen on, the whole test runs flawlessly as it should.

I'm fresh out of ideas after battling the for some time now. The irritating thing is:

when I constrain a struct in two bool flags as true, a method randomly picks one and resets it. 

If I manually reset all of them in the function, everything works as well.
Having both on true also works out fine.

resetting one of them in the method with the code below breaks a list somewhere in a completely different struct of the environment with a contradiction I cannot see. So using the "random resetter" I coded below, Specman goes nuts.

while list_of_desired_errors.count(it == TRUE) > 1 <BR>{ <BR>    message(FULL,"list_of_desired_errors.size() is still > 1, randomly resetting desired errors"); <BR>    var tmp_err_index_list : list of uint; <BR>    tmp_err_index_list.clear(); <BR>    for each (err) using index (i) in list_of_desired_errors <BR>    { <BR>        if err == TRUE <BR>        { <BR>            tmp_err_index_list.add(i); <BR>        }; <BR>    }; <BR>    message(FULL,"tmp_err_index_list is: ",tmp_err_index_list); <BR>    var t_uint : uint; <BR>    message(FULL,"t_uint before random assignment is ",t_uint); <BR>    gen t_uint keeping { it in tmp_err_index_list; }; <BR>    message(FULL,"t_uint after random assignment is ",t_uint); <BR>    list_of_desired_errors[t_uint] = FALSE; <BR>    message(FULL, "SINGLE_FRAME_ERR resetting error index ",t_uint); };<BR>};<BR><BR>Ideas, anyone?<BR><BR>regards
SomeDude
Posts: 12
Online: User is Offline
3/28/2008 8:35 AM  
oh darn, I'm sorry for the screwed up layout. I swear it looked fine before...
ajeetha
Posts: 97
Online: User is Offline
3/31/2008 10:22 AM  
By any chance are you running the new "intelligent gen"? If so try using the time tested, golden old generator. This might be a new issue with the relatively new generator architecture. In any case, contact CDN support.

HTH
Ajeetha, CVC
www.noveldv.com
cgoss
Posts: 3
Online: User is Offline
3/31/2008 1:02 PM  
Hi SomeDude,

Ajeetha has a good question about which generation technology you are using and it is one that I have as well for you before I can offer you more advanced assistance. Are you using the current default generator (Pgen) or the new generator (IntelliGen)? If you are unsure, you can always type the command "show config gen" to see the results.

One thing I would like to mention is that IntelliGen has been used on many customer projects successfully over the past year empowering customers with increased ease of use, solvability and performance. The ease of use features including improved contradiction handling and the new Generation Debugger GUI have proved very useful for many customers.

I did take your example code and ran it however, I did not see any contradiction however, there may be other portions of your environment that are contributing to the contradiction. Could you clarify the below statement:
[quote]
when I constrain a struct in two bool flags as true, a method randomly picks one and resets it.
[/quote]

Did you mean when you constrain two bool flags in a struct to be TRUE?

Some other techniques for assistance with debug:
-> (Pgen) Use the "show constraints" command to list all constraints acting on the field causing the contradiction
-> (Pgen) Place a call to "specman("collect gen");" in procedural code (perhaps in a pre/post_generate() extension) at or near where the contradiction occurs rather than run with it on from the beginning of the simulation as this will localize the collection of generation information.
-> (Pgen or IntelliGen) The "trace gen" command will output generator solving steps to the screen to assist in debug
-> (IntelliGen) You can set a general breakpoint at or near where the contradiction occurs and then step into the generation results using the new Generation Debugger GUI by issuing the "gtree" command (there is no need for issuing a "collect gen" command in IntelliGen)

I hope this helps. If you can replicate the issue you are seeing in a smaller testcase, please repost here however, I would also follow Ajeetha's suggestion and start a support request in parallel with the Cadence support team.

regards,
Corey
SomeDude
Posts: 12
Online: User is Offline
3/31/2008 11:57 PM  
ok, sorry for the lack of info.

first, I'm using Pgen, IntelliGen cannot be used because of other eVC Incompatibility.

Second, what the code does is for the following scenario.

I want to generate a frame with a single valid error. Since up to 7 are theoretically possible, I do not constrain them at all and let Specman decide which to are true to begin with. As long as there is more than than one true flag, specman will reset one random set flag after another by generating t_uint out of the list in which the indices of the true flags are stored. And exactly that seems to be the problem. I recoded it in a different (read ugly) way and now it doesn't break the generation of the other field anymore.

this is the complete code snippet


while list_of_desired_errors.count(it == TRUE) > 1
               <br>{
                   <br>    message(FULL,"list_of_desired_errors.count(it == TRUE) is still > 1, randomly resetting desired errors");
                   <br>    var tmp_err_index_list : list of uint;
                   <br>    tmp_err_index_list.clear();
                   
                   <br>    for each (err) using index (i) in list_of_desired_errors 
                   <br>    {
                       <br>        if err == TRUE { tmp_err_index_list.add(i); };
                   <br>    };
                   <br>    message(FULL,"tmp_err_index_list is: ",tmp_err_index_list);
                   
                   <br><br>    --Option 1, NOT WORKING!!!!!                    <br>--    var t_uint_reset_to_single : uint;                    <br>--    message(FULL,"t_uint_reset_to_single before random assignment is ",t_uint_reset_to_single);
<br>--    gen t_uint_reset_to_single keeping { it in tmp_err_index_list; };
<br>--    message(FULL,"t_uint after random assignment is ",t_uint_reset_to_single);
<br>--    list_of_desired_errors[t_uint_reset_to_single] = FALSE;
                   <br>    --Option 1, NOT WORKING!!!!!

                   <br><br>    --Option 2
                   working, but ugly<br>    var t_uint_reset_to_single : uint;
                   <br>    repeat 
                   <br>    {
                       <br>        message(FULL,"generating new t_uint_reset_to_single");<br>        message(FULL,"read_only(list_of_desired_errors.size() is: ",list_of_desired_errors.size());<br>        gen t_uint_reset_to_single keeping <br>        { <br>              soft it >= 0 and soft it < read_only(list_of_desired_errors.size()) <br>        };
                       <br>        message(FULL,"t_uint_reset_to_single was generated to ",t_uint_reset_to_single);
                   <br>    } until list_of_desired_errors[t_uint_reset_to_single] == TRUE;
                   <br>    message(FULL, "SINGLE_FRAME_ERR resetting error index ",t_uint_reset_to_single);  <br>    list_of_desired_errors[t_uint_reset_to_single] = FALSE;  
               <br>};<br><br>
It's working properly now, hundreds of frames without any contradiction. So it seems to be the "keeping in a list" that breaks Specman. But before I file a bug report, I want to try it in Specman 6.20.003. Since I have to wait till our admin finds some time installing it, that will take a few days though.

Regards
cgoss
Posts: 3
Online: User is Offline
4/01/2008 4:19 PM  
Hi SomeDude,

Thanks for clarifying what you are seeing. Do you see a contradiction in the code example that you have displayed? I have tried to replicate a contradiction on my side using SPMN 6.2-s003 using several hundres seeds however, I could not (I limited the list_of_desired_errors size to 7 and had to wrap some context around your example).

I am not sure if you have code that processes each of these errors as you reset the bools however, I am curious as to why you would use a procedural loop to perform this task considering that similar functionality can be implemented using pure generation. Consider the example below:

<'
extend sys {

// testwriter can constrain the error location
error_location: uint;
keep soft error_location in range Ύ..6]

// testwriter can constrain whether frames are errored or not
errored_frame: bool;

list_of_desired_errorsΕ]: list of bool;

keep for each in list_of_desired_errors {
soft it == FALSE; // default no errors
}; // keep for each i...

// if frame is to be errored, pick a single random error location
keep errored_frame => list_of_desired_errors[error_location] == TRUE;

}; // extend sys

'>

As coded above, we are only targeting one location however I have coded random error generation schemes many times in the past that inserts any number of faults in any number of locations, allowing complete control to the testwriter to constrain the behaviour from the testcase.

Would something like this work in your situation?

regards,
Corey
cgoss
Posts: 3
Online: User is Offline
4/01/2008 4:24 PM  
Let me try to post that code example again:


<'
extend sys {
   
   // testwriter can constrain the error location
   error_location: uint;
   keep error_location in range Ύ..6]
   
   // testwriter can constrain whether frames are errored or not
   errored_frame: bool;

   list_of_desired_errorsΕ]: list of bool;
   keep for each in list_of_desired_errors {
      soft it == FALSE;
   }; // keep for each i...

   // if frame is to be errored, pick a single random error location
   keep errored_frame => list_of_desired_errors[error_location] == TRUE;

   // This code is simply to print the results out to the screen and NOT used to
   // generate the errors
   run() is also {
      print errored_frame;
      if (errored_frame) then {  
         print error_location;
         print list_of_desired_errors;
      }; // if (errored_fra...
   }; // run() is also

}; // extend sys

'>


Hope it helps!
SomeDude
Posts: 12
Online: User is Offline
4/01/2008 11:52 PM  
thx for your reply!

I'll try to clarify a bit more. The frame is driven over different interfaces and has various formats. Depending on those interfaces and formats, some errors are valid and some are not. As the testwriters want it very easy, they constrain for example three errors to true and all the others to false. Additionally they set the error_mode to single_error (as opposed to no_error and multi_error). So the model has to check if the picked errors are even possible, if not it resets them. The remaining errors are randomly reset resulting in only one set error flag. So much for directed testing.

In random unconstrained mode all flags are completely randomly generated. Then again, the impossible ones will be reset and the remaining possible flags considered. In multi-error-mode at least 2 random/valid flags will be set, in single-err-mode at least one will be set and if more than one are set, they will randomly be reset.

The reason to jump through all these hoops is the goal to get the most possible random distribution of errors depending on interface and frame_type.

The generator based approach works fine if the test writer knows what the interface and/or frame_type can do. Unfortunatley I cannot rely on that. You how how it works: As soon as the eVC throws a constraint-contradiction it's not the user's but the eVC's fault. :/

I'm still waiting for Spm 6.20.003 to be installed, it's moving up in the admin's pipeline. IF the problem still shows in the newer version, I will file a bug report. Till then, the ugly (Option 2), but working version has not failed me once over hundreds of frames. I presume it's a false memory handling that influences something it shouldn't influence. But that's pure speculation, unfortunately Specman is not Open-Source or we could debug all the way. The fact that is works flawlessly in Collect-Gen Mode is indicator enough that it might be a tool problem.

by the way, the code tags here suck whole lemons. If one could edit own posts, one could post by try and error, but it really discourages posting code snippets.

Will keep you updated
Posting to forums is available to community members only.
Login or Register

Forums > Functional Verification > e > Contradiction only without collect gen


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.