• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Poor generation distribution results using count() method...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 13246
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Poor generation distribution results using count() method.

myonlyscreen
myonlyscreen over 11 years ago

Hi

I am facing some  problem using the count() method in list generation.

I have summarized it to the test case shown in the next code:

 <'
struct tc_s {
    name    : string;
    active  : bool;
    keep soft not active;
};


extend sys {
    l : list of  tc_s;
    keep l.size() == 10;
    keep for each in l {
        it.name == index.to_string();
    };

    keep l.count(it.active == TRUE) == 2;

    run() is also {
        for i from 0 to 20 {
            gen l;
            print l;
        };
    };
};
'>

When examining  the  generation results, I got all the items in the list to look like this:

item   type        name        active    
                                                                                                                                                
0.     tc_s        "0"         FALSE      
1.     tc_s        "1"         FALSE      
2.     tc_s        "2"         FALSE      
3.     tc_s        "3"         FALSE      
4.     tc_s        "4"         FALSE      
5.     tc_s        "5"         FALSE      
6.     tc_s        "6"         FALSE      
7.     tc_s        "7"         FALSE      
8.     tc_s        "8"         TRUE       
9.     tc_s        "9"         TRUE

The 2 last items always got the TRUE'active and the others not, why isn't it distributed over all the list items ?

Regards.

E.M. 

  • Cancel
  • hannes
    hannes over 11 years ago

    This has to do with the soft constraint on active. The solver is trying to enforce the soft as much as possible, and only when it gets to the end of the list it MUST violate it, to enforce the count. The distribution would look better without the soft constraint.

    -hannes 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • myonlyscreen
    myonlyscreen over 11 years ago

     Thanks a lot !

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information