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

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Tue Sep 06 2011 - 06:16:14 PDT

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:17:29 2011

This archive was generated by hypermail 2.1.8 : Tue Sep 06 2011 - 06:17:32 PDT