ovm_queue #(T)

Implements a class-based dynamic queue.  Allows queues to be allocated on demand, and passed and stored by reference.

Summary
ovm_queue #(T)
Implements a class-based dynamic queue.
Class Hierarchy
ovm_queue#(T)
Class Declaration
class ovm_queue #(type T = int) extends ovm_object
Methods
newCreates a new queue with the given name.
get_global_queueReturns the singleton global queue for the item type, T.
get_globalReturns the specified item instance from the global item queue.
getReturns the item at the given index.
sizeReturns the number of items stored in the queue.
insertInserts the item at the given index in the queue.
deleteRemoves the item at the given index from the queue; if index is not provided, the entire contents of the queue are deleted.
pop_frontReturns the first element in the queue (index=0), or null if the queue is empty.
pop_backReturns the last element in the queue (index=size()-1), or null if the queue is empty.
push_frontInserts the given item at the front of the queue.
push_backInserts the given item at the back of the queue.

new

function new (string name = "")

Creates a new queue with the given name.

get_global_queue

static function this_type get_global_queue ()

Returns the singleton global queue for the item type, T.

This allows items to be shared amongst components throughout the verification environment.

get_global

static function T get_global (int index)

Returns the specified item instance from the global item queue.

get

virtual function T get (int index)

Returns the item at the given index.

If no item exists by that key, a new item is created with that key and returned.

size

virtual function int size ()

Returns the number of items stored in the queue.

insert

virtual function void insert (int index,
item)

Inserts the item at the given index in the queue.

delete

virtual function void delete (int index = -1)

Removes the item at the given index from the queue; if index is not provided, the entire contents of the queue are deleted.

pop_front

virtual function T pop_front()

Returns the first element in the queue (index=0), or null if the queue is empty.

pop_back

virtual function T pop_back()

Returns the last element in the queue (index=size()-1), or null if the queue is empty.

push_front

virtual function void push_front(item)

Inserts the given item at the front of the queue.

push_back

virtual function void push_back(item)

Inserts the given item at the back of the queue.

virtual class ovm_object extends ovm_void
The ovm_object class is the base class for all OVM data and hierarchical classes.
class ovm_queue #(type T = int) extends ovm_object
Implements a class-based dynamic queue.
function new (string name = "")
Creates a new queue with the given name.
static function this_type get_global_queue ()
Returns the singleton global queue for the item type, T.
static function T get_global (int index)
Returns the specified item instance from the global item queue.
virtual function T get (int index)
Returns the item at the given index.
virtual function int size ()
Returns the number of items stored in the queue.
virtual function void insert (int index,
item)
Inserts the item at the given index in the queue.
virtual function void delete (int index = -1)
Removes the item at the given index from the queue; if index is not provided, the entire contents of the queue are deleted.
virtual function T pop_front()
Returns the first element in the queue (index=0), or null if the queue is empty.
virtual function T pop_back()
Returns the last element in the queue (index=size()-1), or null if the queue is empty.
virtual function void push_front(item)
Inserts the given item at the front of the queue.
virtual function void push_back(item)
Inserts the given item at the back of the queue.