In instance overriding, as name indicates it substitutes only a particular instance of the component. In UVM, below are the methods by which we can override the instance of particular class:
In below example, our purpose is to override driver instance without making change in existing environment, so we created extended class which is extended from the original driver class.
Factory Code:
In test, we can override the driver class by using "set_inst_override_by_type" function.
Output:
In test, we can override the driver class by using "set_inst_override_by_name" function.
Output:
- set_inst_override_by_type
- set_inst_override_by_name
In below example, our purpose is to override driver instance without making change in existing environment, so we created extended class which is extended from the original driver class.
Factory Code:
Driver Code:
Extended driver Code:
In test, we can override the driver class by using "set_inst_override_by_type" function.
Overriding in Test:
Output:
In test, we can override the driver class by using "set_inst_override_by_name" function.
Overriding in Test:
Output:
No comments:
Post a Comment