Hello everyone ,
I have a small code ::
module Main ;
class Base
rand bit [1:0] a ;
endclass
class Ext extends Base ;
rand bit [1:0 ] b;
endclass
Ext e ;
Base b ;
initial begin
e = new() ;
b = e ; // Up-Casting
if ( b.randomize() ) // randomize() is Virtual
$display(" b is %p ",b);
end
endmodule
Should the Output Ideally have 2 Properties ( a && b ) OR Only 1 ( Only a ) ??
I tried this on different Simulators and got 2 Different Results
Thanks in advance ,
Himanshu V