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

From: Mark Strickland (mastrick) <mastrick@cisco.com>
Date: Mon Feb 09 2015 - 06:53:42 PST
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 06:53:53 2015

This archive was generated by hypermail 2.1.8 : Mon Feb 09 2015 - 06:54:00 PST