Analysis port connecting monitor to agent?

Hello,

If there is a monitor inside an agent with an AP, it has a run_phase task that “creates” packet transactions and uses a get_packet method to get the packet from the DUT and then writes it on the AP as
analysis_port.write(trans)…

When we connect this monitor Inside an agent, does the agent need to have AP or Analysis export?

mon.analysis_port.connect(this.analysis_port)?

Bottom line question : is AP to be used as a broadcast port or as a pass through also?

My understanding is AP is broadcast only. But the code I see in some training material, uses AP in agent also. So, confused.

In reply to UVM_beginner:

Ports can be passed through to other ports; exports can be passed through to other exports. But there can be only one port-to-export connection in any path.

In reply to dave_59:

In this above case, can we have Monitor’s AP connect to Agent’s Analysis export? What is the basis for determining if it needs to connect to agent’s Ap or analysis export?

In reply to UVM_beginner:

See How TLM Works | Advanced UVM | UVM/OVM Verification Methodology | Verification Academy

In reply to UVM_beginner:

In reply to dave_59:
In this above case, can we have Monitor’s AP connect to Agent’s Analysis export? What is the basis for determining if it needs to connect to agent’s Ap or analysis export?

On the same hierarchy level you can only connect analysis_ports with analysis_exports.
But you can connect analysis_ports with analysis_ports on different hierarchy level and also analysis_exports.

In reply to chr_sue:

In reply to UVM_beginner:
On the same hierarchy level you can only connect analysis_ports with analysis_exports.
But you can connect analysis_ports with analysis_ports on different hierarchy level and also analysis_exports.

Thank you, both the video and the summarized reply are very helpful.

From the video,

Highest level of hierarchy : port.connect(export)
If a component has a child, a) child_port.connect(parent_port) and b) parent_export.connect(child_export).

Thanks.