Implements a class-based dynamic associative array. Allows sparse arrays to be allocated on demand, and passed and stored by reference.
| ovm_pool #(KEY,T) | |||||||||||||
| Implements a class-based dynamic associative array. | |||||||||||||
| Class Hierarchy | |||||||||||||
| |||||||||||||
| Class Declaration | |||||||||||||
| |||||||||||||
| Methods | |||||||||||||
| new | Creates a new pool with the given name. | ||||||||||||
| get_global_pool | Returns the singleton global pool for the item type, T. | ||||||||||||
| get_global | Returns the specified item instance from the global item pool. | ||||||||||||
| get | Returns the item with the given key. | ||||||||||||
| add | Adds the given (key, item) pair to the pool. | ||||||||||||
| num | Returns the number of uniquely keyed items stored in the pool. | ||||||||||||
| delete | Removes the item with the given key from the pool. | ||||||||||||
| exists | Returns 1 if a item with the given key exists in the pool, 0 otherwise. | ||||||||||||
| first | Returns the key of the first item stored in the pool. | ||||||||||||
| last | Returns the key of the last item stored in the pool. | ||||||||||||
| next | Returns the key of the next item in the pool. | ||||||||||||
| prev | Returns the key of the previous item in the 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.
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.
If no item exists by that key, a new item is created with that key and returned.
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.
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.
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.
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.
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.
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.
| 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 | |||||||||||||||||
| |||||||||||||||||
| Class Declaration | |||||||||||||||||
| |||||||||||||||||
| Methods | |||||||||||||||||
| new | Creates a new pool with the given name. | ||||||||||||||||
| get_type_name | Returns the type name of this object. | ||||||||||||||||
| get_global_pool | Returns the singleton global pool for the item type, T. | ||||||||||||||||
| get_global | Returns the specified item instance from the global item pool. | ||||||||||||||||
| get | Returns the object item at the given string key. | ||||||||||||||||
| delete | Removes the item with the given string key from the 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.
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.
If no item exists by the given key, a new item is created for that key and returned.
virtual function void delete ( string key )
Removes the item with the given string key from the pool.
The ovm_object class is the base class for all OVM data and hierarchical classes.
virtual class ovm_object extends ovm_void
Implements a class-based dynamic associative array.
class ovm_pool #( type KEY = int, T = ovm_void ) extends ovm_object
Creates a new pool with the given name.
function new ( string name = "" )
Returns the singleton global pool for the item type, T.
static function this_type get_global_pool ()
Returns the specified item instance from the global item pool.
static function T get_global ( KEY key )
Returns the item with the given key.
virtual function T get ( KEY key )
Adds the given (key, item) pair to the pool.
virtual function void add ( KEY key, T item )
Returns the number of uniquely keyed items stored in the pool.
virtual function int num ()
Removes the item with the given key from the pool.
virtual function void delete ( KEY key )
Returns 1 if a item with the given key exists in the pool, 0 otherwise.
virtual function int exists ( KEY key )
Returns the key of the first item stored in the pool.
virtual function int first ( ref KEY key )
Returns the key of the last item stored in the pool.
virtual function int last ( ref KEY key )
Returns the key of the next item in the pool.
virtual function int next ( ref KEY key )
Returns the key of the previous item in the pool.
virtual function int prev ( ref KEY key )
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 ovm_object_string_pool #( type T = ovm_object ) extends ovm_pool #(string,T)
Creates a new pool with the given name.
function new ( string name = "" )
Returns the type name of this object.
virtual function string get_type_name()
Returns the singleton global pool for the item type, T.
static function this_type get_global_pool ()
Returns the specified item instance from the global item pool.
static function T get_global ( string key )
Returns the object item at the given string key.
virtual function T get ( string key )
Removes the item with the given string key from the pool.
virtual function void delete ( string key )