# Is there a problem with connecting analysis ports, exports, implementations via direct assignment?

**URL:** <https://verificationacademy.com/forums/t/is-there-a-problem-with-connecting-analysis-ports-exports-implementations-via-direct-assignment/33800>\
**Category:** UVM\
**Tags:** analysis-port-connectionconnect\_phase, UVM\
**Created:** [December 8, 2017, 9:42pm UTC](https://verificationacademy.com/forums/t/is-there-a-problem-with-connecting-analysis-ports-exports-implementations-via-direct-assignment/33800 "2017-12-08T21:42:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael\_g1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@michael\_g1](https://verificationacademy.com/forums/u/michael_g1)\
**Post date:** [December 8, 2017, 9:42pm UTC](https://verificationacademy.com/forums/t/is-there-a-problem-with-connecting-analysis-ports-exports-implementations-via-direct-assignment/33800/1 "2017-12-08T21:42:00Z")

</div>

Let’s say we have a UVM monitor instantiated inside of a UVM agent and we want to connect the analysis ports as shown in the image below:

![](https://www.dropbox.com/s/nuozch1tkyedid3/example.jpg?dl=0)

Normally to connect these two, I would do the following in the connect\_phase() of the agent:

```verilog

my_agent_ap.connect(my_uvm_monitor.my_monitor_ap);

```

But in someone’s code I see him/her doing this:

```verilog

//export port on monitor to the agent

my_agent_ap = my_uvm_monitor.my_monitor_ap;

```

It seems to work. I would rather that they do the former connection method. Are there any downsides to do the later method?

---

<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:** [December 9, 2017, 9:50am UTC](https://verificationacademy.com/forums/t/is-there-a-problem-with-connecting-analysis-ports-exports-implementations-via-direct-assignment/33800/2 "2017-12-09T09:50:56Z")

</div>

_In reply to [michael\_g1](https://verificationacademy.com/forums/t/is-there-a-problem-with-connecting-analysis-ports-exports-implementations-via-direct-assignment/33800):_

The question is not ‘it seems to work’. Some Simulator versions are tolerating Things which are not compliant with the Standard, like semicolon after a macro. With a new version ist is not tolerating this at all. For this reason: follow the rules!!! And this is the using the connect statement:

```verilog
my_agent_ap.connect(my_uvm_monitor.my_monitor_ap);

```
