Does uvm_top.find() have impact of simulation time?

Hi,
An observation during the simulation profiling of my SOC ENV is that, uvm_top.find() consumes lot of simulation time, like 80% of the sim time. This is being used to extract the handle of a component in our ENV.

Wanted to understand if uvm_top.fin() in general consumes such huge simulation times for any UVM ENV…?

And if so, what would be other mechanisms to achieve the same and improve simulation performance?

In reply to Byreddynaresh:

I believe it is hard to give you a clean answer. But all search processes might consume time and performance. For me it is unclear why you need the find command. I never use this command when constructing the testbench. In my eyes it is only required for debugging, when you are missing certain components.

In reply to Byreddynaresh:

Are you calling uvm_top.find() more than once?

In reply to dhserfer:

At SOC, I have been using uvm_top.find() to get the reference/instance of an IP level UVM component. I’m using this extracted hierarchy to invoke a function within that IP level UVM component.

I could have directly used the hierarchical path to refer to that IP UVM component instance and accessed its function, but being an SOC ENV, i didn’t want to hard-code the usage.

EX : Currently i’m using it as:
longint unsigned my_addr; // local variable to store address
byreddy_env abc; // byreddy_env is my IP UVM component
$cast(abc,uvm_top.find(“*u_byreddy_env”)); // u_byreddy_env is instance of byreddy_env
my_addr = abc.get_system_address();

@ dhserfer : yes i use this call to uvm_top.find() many times as the above code gets executed lot of times.

Could you please let me know better approach for the same.

BTW, thanks a lot for replying.

In reply to Byreddynaresh:

UVM is a very regular approach with a fixed architecture based on agents or sub-envs, i.e. there is always a well-dfined path to any component in this hierarchy. Using a hierarchical here is not a limitation.

In reply to Byreddynaresh:

Is there any reason why you can’t save the handle “abc”? If abc==null then do the ‘find’ and save the handle.

In reply to dhserfer:

@dhserfer : If i understood your comment rightly, this is the way your are suggesting:

class xyz

// …
// xyz class specific
// …
byreddy_env handle_byreddy;

function soc_get_address();
longint unsigned my_addr; // local variable to store address
if(handle_byreddy == null) begin
byreddy_env abc; // byreddy_env is my IP UVM component
if( !$cast(abc,uvm_top.find(“*u_byreddy_env”)) ) // u_byreddy_env is instance of byreddy_env
`uvm_fatal(//the object doesn’t exist)
handle_byreddy = abc;
my_addr = handle_byreddy.get_system_address();
end
endfunction // function soc_get_address();

endclass //class xyz

Please let me know.

In reply to Byreddynaresh:

Yes, except the component handle is returned by uvm_top.find(“*u_byreddy_env”)) and cast to abc, so there’s no reason to create another handle.

class xyz

  byreddy_env  abc;

  function soc_get_address();
    begin
       longint unsigned my_addr; 
       if(abc == null) 
         begin
            if( !$cast(abc,uvm_top.find("*u_byreddy_env")) ) 
             `uvm_fatal(...)
         end
       my_addr = abc.get_system_address();
    end
  endfunction 

endclass

In reply to dhserfer:

Your inputs really helped.
Thanks a lot Guys.