The uvm_link_base class, and its extensions, are provided as a mechanism to allow for compile-time safety when trying to establish links between records within a uvm_tr_database.
| UVM Links | The uvm_link_base class, and its extensions, are provided as a mechanism to allow for compile-time safety when trying to establish links between records within a uvm_tr_database. |
| uvm_link_base | The uvm_link_base class presents a simple API for defining a link between any two objects. |
| uvm_parent_child_link | The uvm_parent_child_link is used to represent a Parent/Child relationship between two objects. |
| uvm_cause_effect_link | The uvm_cause_effect_link is used to represent a Cause/Effect relationship between two objects. |
| uvm_related_link | The uvm_related_link is used to represent a generic “is related” link between two objects. |
The uvm_link_base class presents a simple API for defining a link between any two objects.
Using extensions of this class, a uvm_tr_database can determine the type of links being passed, without relying on “magic” string names.
virtual function void do_establish_link(uvm_link_base link);
uvm_parent_child_link pc_link;
uvm_cause_effect_link ce_link;
if ($cast(pc_link, link)) begin
// Record the parent-child relationship
end
else if ($cast(ce_link, link)) begin
// Record the cause-effect relationship
end
else begin
// Unsupported relationship!
end
endfunction : do_establish_link
| uvm_link_base | ||||
| The uvm_link_base class presents a simple API for defining a link between any two objects. | ||||
| Class Hierarchy | ||||
| ||||
| Class Declaration | ||||
| ||||
| new | Constructor | |||
| Accessors | ||||
| set_lhs | Sets the left-hand-side of the link | |||
| get_lhs | Gets the left-hand-side of the link | |||
| set_rhs | Sets the right-hand-side of the link | |||
| get_rhs | Gets the right-hand-side of the link | |||
| set | Convenience method for setting both sides in one call. | |||
| Implementation Callbacks | ||||
| do_set_lhs | Callback for setting the left-hand-side | |||
| do_get_lhs | Callback for retrieving the left-hand-side | |||
| do_set_rhs | Callback for setting the right-hand-side | |||
| do_get_rhs | Callback for retrieving the right-hand-side | |||
function void set_lhs( uvm_object lhs )
Sets the left-hand-side of the link
Triggers the do_set_lhs callback.
function uvm_object get_lhs()
Gets the left-hand-side of the link
Triggers the do_get_lhs callback
function void set_rhs( uvm_object rhs )
Sets the right-hand-side of the link
Triggers the do_set_rhs callback.
function uvm_object get_rhs()
Gets the right-hand-side of the link
Triggers the do_get_rhs callback
function void set( uvm_object lhs, rhs )
Convenience method for setting both sides in one call.
Triggers both the do_set_rhs and do_set_lhs callbacks.
pure virtual function void do_set_lhs( uvm_object lhs )
Callback for setting the left-hand-side
pure virtual function void do_set_rhs( uvm_object rhs )
Callback for setting the right-hand-side
pure virtual function uvm_object do_get_rhs()
Callback for retrieving the right-hand-side
The uvm_parent_child_link is used to represent a Parent/Child relationship between two objects.
| uvm_parent_child_link | |||||
| The uvm_parent_child_link is used to represent a Parent/Child relationship between two objects. | |||||
| Class Hierarchy | |||||
| |||||
| Class Declaration | |||||
| |||||
| new | Constructor | ||||
| get_link | Constructs a pre-filled link | ||||
| Implementation Callbacks | |||||
| do_set_lhs | Sets the left-hand-side (Parent) | ||||
| do_get_lhs | Retrieves the left-hand-side (Parent) | ||||
| do_set_rhs | Sets the right-hand-side (Child) | ||||
| do_get_rhs | Retrieves the right-hand-side (Child) | ||||
function new( string name = "unnamed-uvm_parent_child_link" )
Constructor
| name | Instance name |
static function uvm_parent_child_link get_link( uvm_object lhs, uvm_object rhs, string name = "pc_link" )
Constructs a pre-filled link
This allows for simple one-line link creations.
my_db.establish_link(uvm_parent_child_link::get_link(record1, record2));
| lhs | Left hand side reference |
| rhs | Right hand side reference |
| name | Optional name for the link object |
The uvm_cause_effect_link is used to represent a Cause/Effect relationship between two objects.
| uvm_cause_effect_link | |||||
| The uvm_cause_effect_link is used to represent a Cause/Effect relationship between two objects. | |||||
| Class Hierarchy | |||||
| |||||
| Class Declaration | |||||
| |||||
| new | Constructor | ||||
| get_link | Constructs a pre-filled link | ||||
| Implementation Callbacks | |||||
| do_set_lhs | Sets the left-hand-side (Cause) | ||||
| do_get_lhs | Retrieves the left-hand-side (Cause) | ||||
| do_set_rhs | Sets the right-hand-side (Effect) | ||||
| do_get_rhs | Retrieves the right-hand-side (Effect) | ||||
function new( string name = "unnamed-uvm_cause_effect_link" )
Constructor
| name | Instance name |
static function uvm_cause_effect_link get_link( uvm_object lhs, uvm_object rhs, string name = "ce_link" )
Constructs a pre-filled link
This allows for simple one-line link creations.
my_db.establish_link(uvm_cause_effect_link::get_link(record1, record2));
| lhs | Left hand side reference |
| rhs | Right hand side reference |
| name | Optional name for the link object |
The uvm_related_link is used to represent a generic “is related” link between two objects.
| uvm_related_link | |||||
| The uvm_related_link is used to represent a generic “is related” link between two objects. | |||||
| Class Hierarchy | |||||
| |||||
| Class Declaration | |||||
| |||||
| new | Constructor | ||||
| get_link | Constructs a pre-filled link | ||||
| Implementation Callbacks | |||||
| do_set_lhs | Sets the left-hand-side | ||||
| do_get_lhs | Retrieves the left-hand-side | ||||
| do_set_rhs | Sets the right-hand-side | ||||
| do_get_rhs | Retrieves the right-hand-side | ||||
static function uvm_related_link get_link( uvm_object lhs, uvm_object rhs, string name = "ce_link" )
Constructs a pre-filled link
This allows for simple one-line link creations.
my_db.establish_link(uvm_related_link::get_link(record1, record2));
| lhs | Left hand side reference |
| rhs | Right hand side reference |
| name | Optional name for the link object |
The uvm_link_base class presents a simple API for defining a link between any two objects.
virtual class uvm_link_base extends uvm_object
The uvm_tr_database class is intended to hide the underlying database implementation from the end user, as these details are often vendor or tool-specific.
virtual class uvm_tr_database extends uvm_object
The uvm_parent_child_link is used to represent a Parent/Child relationship between two objects.
class uvm_parent_child_link extends uvm_link_base
The uvm_cause_effect_link is used to represent a Cause/Effect relationship between two objects.
class uvm_cause_effect_link extends uvm_link_base
The uvm_related_link is used to represent a generic “is related” link between two objects.
class uvm_related_link extends uvm_link_base
The uvm_void class is the base class for all UVM classes.
virtual class uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_object extends uvm_void
Constructor
function new( string name = "unnamed-uvm_link_base" )
Sets the left-hand-side of the link
function void set_lhs( uvm_object lhs )
Gets the left-hand-side of the link
function uvm_object get_lhs()
Sets the right-hand-side of the link
function void set_rhs( uvm_object rhs )
Gets the right-hand-side of the link
function uvm_object get_rhs()
Convenience method for setting both sides in one call.
function void set( uvm_object lhs, rhs )
Callback for setting the left-hand-side
pure virtual function void do_set_lhs( uvm_object lhs )
Callback for retrieving the left-hand-side
pure virtual function uvm_object do_get_lhs()
Callback for setting the right-hand-side
pure virtual function void do_set_rhs( uvm_object rhs )
Callback for retrieving the right-hand-side
pure virtual function uvm_object do_get_rhs()
Constructor
function new( string name = "unnamed-uvm_parent_child_link" )
Constructs a pre-filled link
static function uvm_parent_child_link get_link( uvm_object lhs, uvm_object rhs, string name = "pc_link" )
Sets the left-hand-side (Parent)
virtual function void do_set_lhs( uvm_object lhs )
Retrieves the left-hand-side (Parent)
virtual function uvm_object do_get_lhs()
Sets the right-hand-side (Child)
virtual function void do_set_rhs( uvm_object rhs )
Retrieves the right-hand-side (Child)
virtual function uvm_object do_get_rhs()
Constructor
function new( string name = "unnamed-uvm_cause_effect_link" )
Constructs a pre-filled link
static function uvm_cause_effect_link get_link( uvm_object lhs, uvm_object rhs, string name = "ce_link" )
Sets the left-hand-side (Cause)
virtual function void do_set_lhs( uvm_object lhs )
Retrieves the left-hand-side (Cause)
virtual function uvm_object do_get_lhs()
Sets the right-hand-side (Effect)
virtual function void do_set_rhs( uvm_object rhs )
Retrieves the right-hand-side (Effect)
virtual function uvm_object do_get_rhs()
Constructor
function new( string name = "unnamed-uvm_related_link" )
Constructs a pre-filled link
static function uvm_related_link get_link( uvm_object lhs, uvm_object rhs, string name = "ce_link" )
Sets the left-hand-side
virtual function void do_set_lhs( uvm_object lhs )
Retrieves the left-hand-side
virtual function uvm_object do_get_lhs()
Sets the right-hand-side
virtual function void do_set_rhs( uvm_object rhs )
Retrieves the right-hand-side
virtual function uvm_object do_get_rhs()