Can we disconnect the already connected tlm ports and make a new connection?

Hi ,
I want to disconnect tlm port connection which is established in parent class and make a new connection in child class.

Thanks
CB Singh

If by parent you mean the base class, and child is the extended class (not another child component), you can override the connect_phase in the extended class. The extended class can either not call super.connect_phase, or change some setting before calling super.connect_phase so that it does not make the original connection.

These are the condition i already tried

When i am trying to override, its giving run time error, and I do not want to make any changes in base class and i have to call super.connect because i want to modify only few connection only in extended class.

Thanks
CB Singh

In reply to Chandra Bhushan Singh:

That is too bad; not very re-usable code. Given those requirements, you only option is to cut & paste the connections in the base class and not call super.connect_phase().

Maybe if you could explain more about why you need to move the connection to different port and someone could suggest how the code should have been written in the first place.

I am extended my env_e from other env_b .And env_b is given by some other person so i cant do any changes in enb_b . That env_b already have all component and connection , i want to modify only few connections within those component in extended class . If i am able to disconnect tlm port connection then it is reusable otherwise i have to copy paste the connection. Thats why i asked for it.

In reply to Chandra Bhushan Singh:

I also want to know the answer that Mr. Singh asked with the same reason.
Is there anyone who can answer it?

In reply to freezer:

The UVM does not provide a facility to disconnect TLM ports. What you can do is provide settings in the build phase that can be overridden before the connect phase begins. Then the connect phase can determine which connections need to be made.