So here is an example of where a soft constraint cannot be met, but not because it conflicts with an another explicitly declared constraint.
So in this case, my understanding is that the soft constraint 'c2' will be discarded.
class my_class;
rand int x;
rand int y;
constraint c1 { soft x == 10;}
constraint c2 { soft y == 5;}
endclass
module test();
my_class my_class_handle = new();
initial begin
if(my_class_handle.randomize(x)) //Only randomizing x therefore y is not considered a state variable
$display("Randomize worked");
else
$display("Randomize failed");
end
endmodule
~Alex
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Arturo Salz
Sent: Monday, September 26, 2011 1:19 AM
To: 'sv-ec@eda.org' (sv-ec@eda.org)
Subject: [sv-ec] soft constraint proposal
I have uploaded a new proposal for Mantis 2987. The new write-up incorporates all the feedback we’ve had, including the following:
- Makes soft a keyword.
- Uses the suggested “disable soft” instead of empty dist to reset soft constraints.
- Decouples the disable functionality from the soft-dist. Now the two features can be specified separately.
- Includes the BNF change from solve_before_primary to constraint_primary.
Arturo
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Sep 26 12:14:23 2011
This archive was generated by hypermail 2.1.8 : Mon Sep 26 2011 - 12:14:28 PDT