How to use uvm_queue #(T)

In reply to saritr:

You can use it like normal queue, but as its class based data type, it needs to be created. This queue then can be passed to different object/components through config_db. Queue access methods are similar to SV queue with few additional methods.

class env extends uvm_env;

  uvm_queue#(string) my_queue;

  //Build
  function void buil_phase(uvm_phase phase);
    my_queue = uvm_queue#(string)::type_id::create("my_queue");

    //Or, returns singleton instance of global queue with string data type
    my_queue = get_global_queue();
  endfunction

endclass