[sv-ec] handling x's in expressions in constrants

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Wed Nov 16 2011 - 04:35:20 PST

I've doubts on how x's should be handled by solver. LRM say only that
x's are illegal in constraints but give no more detail on complex expr
behaviour

Please see examples - my questions are in comments

    class C;
      rand reg[1:0] a,b;
      constraint c1{(a/b==1) || (b==0);};
      function void post_randomize;
        $display("%d %d",a,b);
      endfunction
    endclass

    module top;
       C c =new;
       initial begin
         repeat (15)//should solver allow b==0 to be randomized or
    should not (bcos of x result in 2nd part of expr - a/b==1)??
           assert(c.randomize) else $display("failure");
         c.b=0;
         repeat (15) //should fail immediately bcos of x's or only x's
    on top level expr should results in runtime failure???
           assert(c.randomize(a)) else $display("failure");
       end
    endmodule

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Nov 16 04:35:12 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 16 2011 - 04:35:27 PST