ovm_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
ovm_pool #(KEY,T)
Implements a class-based dynamic associative array.
Class Hierarchy
ovm_pool#(KEY,T)
Class Declaration
class ovm_pool #(type KEY = int,
 T = ovm_void) extends ovm_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 a 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.

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 a 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.

ovm_object_string_pool #(T)

This provides a specialization of the generic ovm_pool #(KEY,T) class for an associative array of ovm_object-based objects indexed by string.  Specializations of this class include the ovm_event_pool and ovm_barrier_pool classes.

Summary
ovm_object_string_pool #(T)
This provides a specialization of the generic ovm_pool #(KEY,T) class for an associative array of ovm_object-based objects indexed by string.
Class Hierarchy
ovm_pool#(string,T)
ovm_object_string_pool#(T)
Class Declaration
class ovm_object_string_pool #(
   type T = ovm_object
) extends ovm_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.

virtual class ovm_object extends ovm_void
The ovm_object class is the base class for all OVM data and hierarchical classes.
class ovm_pool #(type KEY = int,
 T = ovm_void) extends ovm_object
Implements a class-based dynamic associative array.
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 a 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.
class ovm_object_string_pool #(type T = ovm_object) extends ovm_pool #(string,T)
This provides a specialization of the generic ovm_pool #(KEY,T) class for an associative array of ovm_object-based objects indexed by string.
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.