How to use uvm_queue #(T)

I have a transaction class which contains a queue of:
bit[31:0]
The elemnt of the queue are bit[31:0].

I consider to use uvm_queue (uvm_queue #(T)), but I’m not sure if it’s recommended.

If it is, how I declare the queue inside my transaction (which extend uvm_sequence_item()?

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

In reply to mayurkubavat:

  1. For what is get_global_queue()?
  2. If I use the queue in my transaction shouldn’t I create it there?
    3.How I define the queue to be a queue of array of bit (bit[31:0])?
    4.What is the adventage of using uvm_queue over regular systemVerilog queue?