Home > Community > Forums > Functional Verification > list generation

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: *

 list generation 

Last post Mon, Oct 8 2012 3:13 AM by hannes. 1 replies.
Started by guyl 20 Mar 2012 03:19 AM. Topic has 1 replies and 2287 views
Page 1 of 1 (2 items)
Sort Posts:
  • Tue, Mar 20 2012 3:19 AM

    • guyl
    • Not Ranked
    • Joined on Sun, Sep 18 2011
    • Raanana, Israel
    • Posts 1
    • Points 20
    list generation Reply

    Hi,

    I use the following code:

            var list : list of uint (bits:14);
            gen list keeping {
                it.size() == list_size_parameter;
                it.all_different(it);
            };

    to gen a list of indices, the size of a given parameter.

    list size can be up to 20K, and I get a WARN_GEN_BIG_LACE as a consequence.

    what may be the preferrabe way to do this in regards to memory and cpu resources?

    Thanks

     

     

    • Post Points: 20
  • Mon, Oct 8 2012 3:13 AM

    • hannes
    • Top 150 Contributor
    • Joined on Fri, Nov 14 2008
    • Bracknell, Berkshire
    • Posts 50
    • Points 895
    Re: list generation Reply
    Hello Guy,

    you can ignore this warning if you do get a result that is ok for you. We continue to improve the algorithms in the generator and this should work. We are making things like this more efficient in new releases.

    Alternatively, you could do something like this:
    var all_vals := all_values(uint(bits:14));var ordered_list:list of uint(bits:14);var prev_ind:int = -1;for i from 1 to list_size_parameter {

                    gen tmp_ind keeping {it > prev_ind;it < 1<<14}; // need to add some constraints for better distribution
                    prev_ind = tmp_ind;                ordered_list.add(all_vals[tmp_ind]);};gen list keeping {it.is_a_permutation(ordered_list)};

    But with this you need to make sure the distribution of tmp_ind is good enough to give you the amount of values you need.

    Regards,
    -hannes
    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by guyl at 20 Mar 2012 03:19 AM. Topic has 1 replies.