In reply to dave_59:
Yes, classA and classB both inherited from uvm_reg.
and in common part, I use methods of classA and classB.
Actually, I can’t figure out how can I use methods. Even though I don’t use new or create to make object. (I didn’t make this code…)
So, relation between classA and classB is not parents and child. In this case, Can I cuse $cast?
+) I consider another solution… That is using fuction. But, in this case, function argument are different because handle class types are different… Is there any way to use different(or may be ambiguous) argument type in fuction?
case(usedClass) begin
classA : begin
classA handle;
func_comm(handle);
end
classB : begin
classB handle;
func_comm(handle);
end
…
end
funcion func_comm()
common_part;
endfunction
Thanks for your help!!