Re: [sv-ec] dist operator and negative value used as weight

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Tue Sep 06 2011 - 06:39:31 PDT

This is similar but for dist LRM even do not say that weigth should be
positive valuei it just say that in can by any integral expression
IMHO another mantis should be added.
Should I add new mantis?
Or better add a note to mantis 262?

DANiel

On 9/6/2011 3:16 PM, Bresticker, Shalom wrote:
>
> See a related issue in Mantis 262.
>
> Shalom
>
> *From:*owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] *On Behalf Of
> *Daniel Mlynek
> *Sent:* Tuesday, September 06, 2011 4:10 PM
> *To:* sv-ec@eda.org
> *Subject:* [sv-ec] dist operator and negative value used as weight
>
> LRM defines only how should dist behave is 0 is used as weigth.
> What should happen if wigth expression is negative?
> IMHO it should be an error
>
> module top;
> int a;
> bit b;
> int arr[int];
> initial begin
> repeat (100)begin
> b=std::randomize (a) with {
> a dist {
> 1:=2,
> 5:=-1, //<<negative
> 10:=0,
> 100:=1
> };
> };
> arr[a]++;
> end
> foreach (arr[i])
> $display( i, arr[i]);
> end
> endmodule
>
> There can be more complicated cases as weigth can be a variable or
> parameter.
>
>
> DANiel
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Sep 6 06:39:04 2011

This archive was generated by hypermail 2.1.8 : Tue Sep 06 2011 - 06:39:07 PDT