UVM/SV and virtual functions?

Hi

I believe that if a function is declared virtual in at least one class, then it is considered virtual in all its extended and superclasses?
example-

class A; function amI;endfunction; endclass;
class B extends A; function amI;endfunction; endclass;
class C extends B; virtual function amI;endfunction; endclass; //virtual here
class D extends C; function amI;endfunction; endclass;

Q1-So, in the above code, no matter which class variable I use, the function will be called based on the object type(polymorphism), right?

What happens if the class is like a tree? for example-

class A; function amI;endfunction; endclass;
class B extends A; function amI;endfunction; endclass;
class C extends A; virtual function amI;endfunction; endclass; //changed here
class D extends C; function amI;endfunction; endclass;

Q2-Does polymorphism work between objects of A and B, I think it shouldn’t.

Q3-I was also wondering if it is safe to assume that pretty much all user available UVM functions are declared virtual in uvm package? for example, all phases (build_phase, connect_phase, etc…), do_copy, do_compare, convert2string, response_handler? If yes, can you think of any function which might be declared virtual?

Thanks in advance!

In reply to possible:

Once virtual, always virtual in all extended classes. A bass class variable has no knowledge of extensions to it. It can only reference what the class type has defined up to that point.

Yes, almost all methods of the UVM library are virtual, but there are a few exception for methods they do not want you to override. (e.g. copy, print)

In reply to dave_59:

In reply to possible:
Once virtual, always virtual in all extended classes. A bass class variable has no knowledge of extensions to it. It can only reference what the class type has defined up to that point.
Yes, almost all methods of the UVM library are virtual, but there are a few exception for methods they do not want you to override. (e.g. copy, print)

Hi master,
May I confirm with you: Virtual method is called based on the Object type referenced by the handle variable. Unvirtual method is called based on the class type of the handle variable.
Is the statement right?
Thanks

In reply to shanghai1943:

Yes. I would add that in both cases you need to look at the class type of the class variable first to know of the method is virtual or not.