# Execution of connect phase twice in simulation

**URL:** <https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927>\
**Category:** UVM\
**Tags:** UVM, UVM-phases, phase-jump\
**Created:** [April 3, 2019, 6:06am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927 "2019-04-03T06:06:53Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 3, 2019, 6:06am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/1 "2019-04-03T06:06:53Z")

</div>

Hi All,

I have one scenario, on which i want to change connections of analysis port run time. so,i thought to use uvm phase jumping, i know this is not as per the guideline, but i have too.  
So, my question is, if i jump to connect phase from run phase, for changing the port connection, does uvm has any feature which removes all existing connection? and allow me to do new one.

Please provide any alternate solution as well if any one has,

Thanks and Regards,  
Mitesh Patel

---

<div class="post-metadata">

**Author:** ![tfitz](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tfitz/32/3025_2.png) [@tfitz](https://verificationacademy.com/forums/u/tfitz)\
**Post date:** [April 3, 2019, 1:19pm UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/2 "2019-04-03T13:19:23Z")

</div>

_In reply to [mitesh.patel](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927):_  
Before I answer that question, you’re going to have to explain exactly why you think you need to change your connections at runtime. You could make all your connections up front and then have your subscribers just ignore the data if you want them to act like they’re disconnected.

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 4, 2019, 5:07am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/3 "2019-04-04T05:07:49Z")

</div>

_In reply to [tfitz](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/2):_

I dont have a switch to disable consumer component(here, scoreboard) its always ON and I can not change it. Neither I can stop producer component(here, monitor) because its encrypted.

So to disable the scoreboard run time I can think of only one option as now. Which is to disconnect the connection of these two components. So the question is it possible to disconnect two components in run\_phase? If yes then how can I do that?

Please suggest if you have any better suggestion.

Thanks and Regards,  
Mitesh Patel

---

<div class="post-metadata">

**Author:** ![rajesh.deshpande](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@rajesh.deshpande](https://verificationacademy.com/forums/u/rajesh.deshpande)\
**Post date:** [April 4, 2019, 5:57am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/4 "2019-04-04T05:57:06Z")

</div>

_In reply to [mitesh.patel](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/3):_

You can add a control variable in the scoreboard which can enable/disable certain code and you can set the variable at run time by sending a transaction from monitor (or overridden monitor/new monitor). Care needs to be taken at what time to do this, not to loose any data

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 4, 2019, 6:09am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/5 "2019-04-04T06:09:52Z")

</div>

_In reply to [rajesh.deshpande](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/4):_

Hi Rajesh,

I can not change any existing code of monitor or scoreboard. i have only control of connection in my environment. so there is no point of adding the variable.  
Scoreboard and monitor is encrypted.

Please suggest something else.

---

<div class="post-metadata">

**Author:** ![tfitz](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tfitz/32/3025_2.png) [@tfitz](https://verificationacademy.com/forums/u/tfitz)\
**Post date:** [April 4, 2019, 1:38pm UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/6 "2019-04-04T13:38:21Z")

</div>

Since you can’t change connections at runtime, you could connect your monitor to a “forwarder” which would be a subscriber with an analysis port whose write() method would conditionally call ap.write() based on a control variable. Then you would connect forwarder.ap to your scoreboard.

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 5, 2019, 12:36pm UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/7 "2019-04-05T12:36:31Z")

</div>

_In reply to [tfitz](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/6):_

So, does it mean that we can not disconnect/change the connected connections in uvm?  
The suggestion is good for the problem. but i want to know about disconnection of existing connection.

Please provide your inputs on the same.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [April 5, 2019, 12:46pm UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/8 "2019-04-05T12:46:02Z")

</div>

_In reply to [mitesh.patel](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/7):_

The strategy UVM has is seperating test from testbench. But the test can customize the testbench. Any modification will be executed prior to the run\_phase. Then it is fix.  
If you want to modify connections in your envrionemnt (testbench) you can define a new test doing this.  
This approach is very structured and helpful for reuse.

---

<div class="post-metadata">

**Author:** ![tfitz](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tfitz/32/3025_2.png) [@tfitz](https://verificationacademy.com/forums/u/tfitz)\
**Post date:** [April 5, 2019, 2:00pm UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/9 "2019-04-05T14:00:31Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/8):_

Christoph is correct.

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 6, 2019, 5:54am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/10 "2019-04-06T05:54:53Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/9):_

Hi

“_If you want to modify connections in your environment (testbench) you can define a new test doing this_” What do you mean by creating new test? do you mean that for only this test i have add layer/component between monitor and scoreboard to control the write operations? for rest monitor-scoreboard connection should remains direct?  
But still the question is the same. can i disconnect existing connection in uvm?

Thanks  
Mitesh Patel

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [April 6, 2019, 7:10am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/11 "2019-04-06T07:10:14Z")

</div>

_In reply to [mitesh.patel](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/10):_

Creating a test means you are customizing your testbench to the actual needs and selecting a sequence which is running on this specific enviroonment.

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 6, 2019, 7:44am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/12 "2019-04-06T07:44:19Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/11):_

Thanks chr\_sue and tfitz  
I got your alternate ways of doing this.

But uvm does not support such disconnection of uvm\_components run time?

Thanks and Regards,  
Mitesh Patel

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [April 6, 2019, 10:51am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/13 "2019-04-06T10:51:31Z")

</div>

_In reply to [mitesh.patel](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/12):_

I do not see any need to have this functionality because the TLM modelling does not require such a behavior. In contrast to the RTL/pinlevel behavior no data are trasmitted from one component to another one automatically. You have always to make afunction call.

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [April 8, 2019, 1:17pm UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/14 "2019-04-08T13:17:06Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/13):_

Ohh Thanks, i got it.  
Thank you so much for giving such a valuable information.

Regards,  
Mitesh Patel

---

<div class="post-metadata">

**Author:** ![i\_m\_vennela](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/i/a88e4f/32.png) [@i\_m\_vennela](https://verificationacademy.com/forums/u/i_m_vennela)\
**Post date:** [May 17, 2024, 6:53am UTC](https://verificationacademy.com/forums/t/execution-of-connect-phase-twice-in-simulation/35927/15 "2024-05-17T06:53:29Z")

</div>

I got your alternate ways of doing this.  
@ mithesh.patel Can you explain the alternate ways for this
