[sv-ec] rand_mode called on a handle

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Fri Dec 17 2010 - 00:29:22 PST

IMO there is ambiguity in LRM about rand mode called on a handle nested
inside class.
See below code:

class C;
         rand int x;
endclass

class D;
         rand C c;

         task t;
                 c.rand_mode(0); *//this turn off rand for c.x* but do
not change rand mode of c itself???
         endtask
endclass

module top;
         D d;

initial begin
         d = new;
         d.c = new;
         d.c.rand_mode(0); *//this should turn off rand for d.c.x????*
and do not chanfe rand mode of d.c???
         $display(d.c.x.rand_mode());
end

endmodule

*The question is if we will call rand_mode on handle should we change
rand_mode of of this handle or should we go recursively inside the
handle and change rand_mode of its objects.*

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Dec 17 00:29:28 2010

This archive was generated by hypermail 2.1.8 : Fri Dec 17 2010 - 00:29:49 PST