Build_phase order for scoreboard

I have a scoreboard which needs to be builtlast after all the agents have been built. The scoreboard refers to information within the agents in the build_phase.

In my current simulation the env builds the scoreboard and only way to build the scoreboard last is to have its name last in the alphabetical order. Is there a way I can force it to build the scoreboard after all the agents have finished their build phases.

Thanks

Don’t do that.

Can you explain what information your scoreboard needs from the agent?

Why not use the connect() or end_of_elaboration() phases to access other components when you know everything is already built?

In reply to dave_59:

Sure, Dave. The scoreboard has an associative array of analysis ports. The array size is determined by the number of agents/monitors installed by the user. Each time an agent gets built it increases the monitor count. So the updated monitor count is only available when all the agents are built.

I tried newing analysis_imps in connect phase but uvm requires uvm components to be built in build_phase only.

The scoreboard code looks like this:

uvm_analysis_imp monitor_imp[*];

task build_phase();

for(int i=0; i< monitor_count; i++)
monitor_imp[i] = new($sformatf(“monitorImp%0d”,i), this);

endtask

In reply to techridge:

Do you really need an array of analysis ports? Can all the monitors be connected to the same analysis_imp? The transaction would have to indicate which monitor it came from.

Also, if you know how many agents are going to be built, why can’t you use the same information to set how many analysis ports to build?

In reply to dave_59:

I never knew I can connect single imp port to multiple analysis ports. In my case it may be possible to do that since all ports are of same types. Let me give it a try. If it works it will be the best solution.

In my VIP I have to allow the user to configure at the run time how many agents will be installed. So it has to be dynamic.

Thanks a ton,

In reply to techridge:

Dave,

A quick update. I just tried connecting multiple analysis ports from different instances of the same monitor to an imp port in a scoreboard and it works perfectly. I am happy with this solution ( rather than having to depend on simulator for alphabetical build).

Thanks again for the insight,