UVM ports max_size argument

In reply to kerulmodi:

I didn’t thought from perspective of changing m_if pointer. Thanks for the insight.

Just a small query. ;-) Here, in the pseudo code, the test class knows how many interfaces are there. But let’s say we have three agents in env. Agent 1 has put port and Agent 2,3 have their respective imp ports. So, Agent 1 port will be created with max_size=2. Agent 1 wants to send a specific packet to Agent 2 (let’s say good packets) and some other specific packet to Agent 3 (let’s say erroneous packets). Now, how does Agent 1 come to know that what should be the index value to propagate a packet to Agent 2 or Agent 3? Since, the interface index depends upon the alphabetical order (ASCII value) of the object name of Agent 2 and Agent 3 (whose information is available in env).

I believe there can be many workarounds to this scenario like taking two ports or sending the packet to all consumers and let the consumers decide what to do with the packets etc. But, setting default implementation by considering a get_full_name() of objects seemed a bit bewildering to me.