InterviewSolution
| 1. |
Can We Have User Defined Phase In Uvm? |
|
Answer» In addition to the predefined PHASES available in uvm , the user has the option to add his own phase to a component. This is typically done by extending the uvm_phase class the constructor needs to call super. new which has three ARGUMENTS.
The call task or call_func and get_type_name need to be implemented to complete the addition of new phase. Below is a simple example Example: Class custom phase extends uvm_phase; Function new (); Super. New (“custom”, 1, 1); End function Task call task (uvm_component parent); My_comp_type comp; If ( $cast(comp, parent) ) comp.custom phase (); End task Virtual function STRING get_type_name (); Return “custom”; End function End class In addition to the predefined phases available in uvm , the user has the option to add his own phase to a component. This is typically done by extending the uvm_phase class the constructor needs to call super. new which has three arguments. The call task or call_func and get_type_name need to be implemented to complete the addition of new phase. Below is a simple example Example: Class custom phase extends uvm_phase; Function new (); Super. New (“custom”, 1, 1); End function Task call task (uvm_component parent); My_comp_type comp; If ( $cast(comp, parent) ) comp.custom phase (); End task Virtual function string get_type_name (); Return “custom”; End function End class |
|