Pool Classes

This section defines the uvm_pool #(KEY, T) class and derivative.

Contents
Pool ClassesThis section defines the uvm_pool #(KEY, T) class and derivative.
uvm_pool #(KEY,T)Implements a class-based dynamic associative array.
uvm_object_string_pool #(T)This provides a specialization of the generic uvm_pool #(KEY,T) class for an associative array of uvm_object-based objects indexed by string.

uvm_pool #(KEY,T)

Implements a class-based dynamic associative array.  Allows sparse arrays to be allocated on demand, and passed and stored by reference.

Summary
uvm_pool #(KEY,T)
Implements a class-based dynamic associative array.
Class Hierarchy
uvm_pool#(KEY,T)
Class Declaration
class uvm_pool #(
    type  KEY  =  int,
      T  =  uvm_void
) extends uvm_object
Methods
newCreates a new pool with the given name.
get_global_poolReturns the singleton global pool for the item type, T.
get_globalReturns the specified item instance from the global item pool.
getReturns the item with the given key.
addAdds the given (key, item) pair to the pool.
numReturns the number of uniquely keyed items stored in the pool.
deleteRemoves the item with the given key from the pool.
existsReturns 1 if an item with the given key exists in the pool, 0 otherwise.
firstReturns the key of the first item stored in the pool.
lastReturns the key of the last item stored in the pool.
nextReturns the key of the next item in the pool.
prevReturns the key of the previous item in the pool.

new

function new (
    string  name  =  ""
)

Creates a new pool with the given name.

get_global_pool

static function this_type get_global_pool ()

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

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

get_global

static function T get_global (
    KEY  key
)

Returns the specified item instance from the global item pool.

get

virtual function T get (
    KEY  key
)

Returns the item with the given key.

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

add

virtual function void add (
    KEY  key,
    item
)

Adds the given (key, item) pair to the pool.  If an item already exists at the given key it is overwritten with the new item.

num

virtual function int num ()

Returns the number of uniquely keyed items stored in the pool.

delete

virtual function void delete (
    KEY  key
)

Removes the item with the given key from the pool.

exists

virtual function int exists (
    KEY  key
)

Returns 1 if an item with the given key exists in the pool, 0 otherwise.

first

virtual function int first (
    ref  KEY  key
)

Returns the key of the first item stored in the pool.

If the pool is empty, then key is unchanged and 0 is returned.

If the pool is not empty, then key is key of the first item and 1 is returned.

last

virtual function int last (
    ref  KEY  key
)

Returns the key of the last item stored in the pool.

If the pool is empty, then 0 is returned and key is unchanged.

If the pool is not empty, then key is set to the last key in the pool and 1 is returned.

next

virtual function int next (
    ref  KEY  key
)

Returns the key of the next item in the pool.

If the input key is the last key in the pool, then key is left unchanged and 0 is returned.

If a next key is found, then key is updated with that key and 1 is returned.

prev

virtual function int prev (
    ref  KEY  key
)

Returns the key of the previous item in the pool.

If the input key is the first key in the pool, then key is left unchanged and 0 is returned.

If a previous key is found, then key is updated with that key and 1 is returned.

uvm_object_string_pool #(T)

This provides a specialization of the generic uvm_pool #(KEY,T) class for an associative array of uvm_object-based objects indexed by string.  Specializations of this class include the uvm_event_pool (a uvm_object_string_pool storing uvm_event#(uvm_object)) and uvm_barrier_pool (a uvm_obejct_string_pool storing uvm_barrier).

Summary
uvm_object_string_pool #(T)
This provides a specialization of the generic uvm_pool #(KEY,T) class for an associative array of uvm_object-based objects indexed by string.
Class Hierarchy
uvm_pool#(string,T)
uvm_object_string_pool#(T)
Class Declaration
class uvm_object_string_pool #(
    type  T  =  uvm_object
) extends uvm_pool #(string,T)
Methods
newCreates a new pool with the given name.
get_type_nameReturns the type name of this object.
get_global_poolReturns the singleton global pool for the item type, T.
get_globalReturns the specified item instance from the global item pool.
getReturns the object item at the given string key.
deleteRemoves the item with the given string key from the pool.

new

function new (
    string  name  =  ""
)

Creates a new pool with the given name.

get_type_name

virtual function string get_type_name()

Returns the type name of this object.

get_global_pool

static function this_type get_global_pool ()

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

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

get_global

static function T get_global (
    string  key
)

Returns the specified item instance from the global item pool.

get

virtual function T get (
    string  key
)

Returns the object item at the given string key.

If no item exists by the given key, a new item is created for that key and returned.

delete

virtual function void delete (
    string  key
)

Removes the item with the given string key from the pool.

class uvm_pool #(
    type  KEY  =  int,
      T  =  uvm_void
) extends uvm_object
Implements a class-based dynamic associative array.
class uvm_object_string_pool #(
    type  T  =  uvm_object
) extends uvm_pool #(string,T)
This provides a specialization of the generic uvm_pool #(KEY,T) class for an associative array of uvm_object-based objects indexed by string.
virtual class uvm_object extends uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_void
The uvm_void class is the base class for all UVM classes.
function new (
    string  name  =  ""
)
Creates a new pool with the given name.
static function this_type get_global_pool ()
Returns the singleton global pool for the item type, T.
static function T get_global (
    KEY  key
)
Returns the specified item instance from the global item pool.
virtual function T get (
    KEY  key
)
Returns the item with the given key.
virtual function void add (
    KEY  key,
    item
)
Adds the given (key, item) pair to the pool.
virtual function int num ()
Returns the number of uniquely keyed items stored in the pool.
virtual function void delete (
    KEY  key
)
Removes the item with the given key from the pool.
virtual function int exists (
    KEY  key
)
Returns 1 if an item with the given key exists in the pool, 0 otherwise.
virtual function int first (
    ref  KEY  key
)
Returns the key of the first item stored in the pool.
virtual function int last (
    ref  KEY  key
)
Returns the key of the last item stored in the pool.
virtual function int next (
    ref  KEY  key
)
Returns the key of the next item in the pool.
virtual function int prev (
    ref  KEY  key
)
Returns the key of the previous item in the pool.
function new (
    string  name  =  ""
)
Creates a new pool with the given name.
virtual function string get_type_name()
Returns the type name of this object.
static function this_type get_global_pool ()
Returns the singleton global pool for the item type, T.
static function T get_global (
    string  key
)
Returns the specified item instance from the global item pool.
virtual function T get (
    string  key
)
Returns the object item at the given string key.
virtual function void delete (
    string  key
)
Removes the item with the given string key from the pool.
class uvm_barrier extends uvm_object
The uvm_barrier class provides a multiprocess synchronization mechanism.