LRM Syntax 25-5 quotes :
data_type ::=
virtual [ interface ] interface_identifier [ parameter_value_assignment ] [ . modport_identifier ]
So essentially keyword "interface" and .modport_name are optional.
This would mean within a driver component these 3 would be equivalent
virtual interface intf.master_cb vif ; // (a)
virtual intf.master_cb vif ; // (b)
virtual interface intf vif // (c)
For any one of the above 3 handle declaration I wanted to know the legal ways to set and get the interface .
(1) What would be the correct way to set the virtual interface for above driver component ?
// Within top_tb ::
intf intf_instance ( clk , rst ) ;
initial // Keyword "interface" used as specialization along with interface_type.modport
uvm_config_db #( virtual interface intf.master_cb ) :: set ( null , "uvm_test_top.env_h.agent_h.drvr_h" , "vif_intf" , intf_instance ) ;
initial // Specialization is interface_type.modport
uvm_config_db #( virtual intf.master_cb ) :: set ( null , "uvm_test_top.env_h.agent_h.drvr_h" , "vif_intf" , intf_instance ) ;
initial // Specialization is only interface_type
uvm_config_db #( virtual intf ) :: set ( null , "uvm_test_top.env_h.agent_h.drvr_h" , "vif_intf" , intf_instance ) ;
Are all 3 cases for uvm_config_db set equivalent ?
Can anyone of these 3 set be used for all 3 cases of handle declaration [ (a) , (b) and (c) ] interchangeably ?
(2) What would be the correct way to get the virtual interface for the driver component ?
// Within driver component's build_phase() ::
// (i) Keyword "interface" used as specialization along with interface_type.modport
uvm_config_db #( virtual interface intf.master_cb ) :: get ( this , "" , "vif_intf" , vif ) ;
// (ii) Specialization is interface_type.modport
uvm_config_db #( virtual intf.master_cb ) :: get ( this , "" , "vif_intf" , vif ) ;
// (iii) Specialization is only interface_type
uvm_config_db #( virtual intf ) :: get ( this , "" , "vif_intf" , vif ) ;
Are all 3 cases for uvm_config_db get equivalent ?
Can anyone of these 3 get be used for all 3 cases (a) , (b) and (c) interchangeably ?