How ,to get type of instance_name

In reply to uvm_share:

That really does not explain what you are trying to accomplish. ahb_interface appears on the line above the if statement. How could you not know it is an ahb_interface?