Quantcast
Channel: Cadence Functional Verification Forum
Viewing all articles
Browse latest Browse all 1074

Poor generation distribution results using count() method.

$
0
0

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. 


Viewing all articles
Browse latest Browse all 1074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>