Re: [sv-ec] soft constraints and .size randomization

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Mon Feb 09 2015 - 07:09:24 PST
This is special case when is smth is random is decided basing on 
constraints.
Array size is random when .size is used in constraints.
All other variables are randomized if they are declared as random or 
used as argument to randomize method or function.


DANiel

W dniu 2/9/2015 3:53 PM, Mark Strickland (mastrick) pisze:
> Daniel,
>
> I would think it would have to be "remain to be random but constrain 
> on it should be removed".  Do you see text in the LRM that could 
> suggest soft constraints can control whether randomization happens?
>
> Mark
>
> From: Daniel Mlynek <danielm@aldec.com.pl <mailto:danielm@aldec.com.pl>>
> Date: Monday, February 9, 2015 6:52 AM
> To: "sv-ec@eda.org <mailto:sv-ec@eda.org>" <sv-ec@eda.org 
> <mailto:sv-ec@eda.org>>
> Subject: [sv-ec] soft constraints and .size randomization
>
> See example:
>
>     class D;
>         rand bit[2:0] arr[]='{1,2};
>        rand int a=1,b=10;
>         constraint con1 { soft arr.size < a && arr.size > b; }
>
>     endclass
>
>     D d = new;
>
>     module top;
>         initial repeat(10) begin
>                //d.arr = new[5];
>            // d.con1.constraint_mode(0); d.con2.constraint_mode(0);
>             assert(d.randomize() with {a<b;}) else
>     $fatal("Randomization failed.");
>             $display("%p",d.arr);
>         end
>     endmodule
>
>
> LRM is not clear what should happen in such case.
> "arr" size should not be randomized because soft constraints con1 is 
> discarded by inline constraint.
> or
> "arr" size should remain to be random but constrain on it should be 
> removed
>
>
>
> DANiel
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Feb 9 07:09:39 2015

This archive was generated by hypermail 2.1.8 : Mon Feb 09 2015 - 07:09:44 PST