what is the difference between the static functions and virtual functions
static function able to be called without creating object first.
class a;
virtual function print();
$display("this is a");
endfunction
endclass
class b extends a;
virtual function print();
$display("this is b");
endfunction
endclass
initial begin
a a_h;
b b_h = new();
a_h = b_h;
a_h.print(); // a handle point to b object, and print "this is b" because of virtual
end
In reply to vinayks:
These are fundamental concepts of OOP. Please see one of the many courses on SystemVerilog OOP.
http://go.mentor.com/SV-OOP