sep_com Posted December 7, 2015 Report Share Posted December 7, 2015 The code is : interface block_if_wrapper #(type T=j_interface) (input clk, input rst_n); T j_if(clk, rst_n); endinterface Then there will be an syntax error, but I read the section of 8.25 parameterized classes of the IEEE_Std_1800-2012 Systemverilog, there is no description to show that the interface could not be the type of the other parameterized interface class. Could anyone help to explain that? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted December 7, 2015 Report Share Posted December 7, 2015 The BNF does not allow it An interface is not a data_type (A.2.2.1 Net and variable types). A virtual interface is a data type, but not the interface itself. Quote Link to comment Share on other sites More sharing options...
sep_com Posted December 10, 2015 Author Report Share Posted December 10, 2015 The BNF does not allow it An interface is not a data_type (A.2.2.1 Net and variable types). A virtual interface is a data type, but not the interface itself. Thank you very much to reply. But the BNF of the section 8.26.1 Interface class syntax in IEEE Std 1800-2012 System Verilog is interface_class_declaration ::= interface class class_identifier[parameter_port_list] [extends interface_class_type {, interface_class_type} ]; ........ Could you please provide which section has the description that the parameterized class only allow the data_type to be parameterized type? Thank you very much. Quote Link to comment Share on other sites More sharing options...
dave_59 Posted December 10, 2015 Report Share Posted December 10, 2015 An interface class is not the same as a plain interface. The interface keyword in front of a class type definition is special modifier, like the virtual keyword that defines a special type of class. The BNF shows you the syntax that is possible to express, but not all of it is necessarily legal. Any syntax that is not expressible is illegal. If you scan through this series of BNF items, you will observe that there is no way to assign an interface/module/program to a type parameter. parameter_declaration ::= parameter data_type_or_implicit list_of_param_assignments | parameter type list_of_type_assignments list_of_type_assignments ::= type_assignment { , type_assignment } type_assignment ::= type_identifier [ = data_type ] data_type ::= integer_vector_type [ signing ] { packed_dimension } | integer_atom_type [ signing ] | non_integer_type | struct_union [ packed [ signing ] ] { struct_union_member { struct_union_member } } { packed_dimension }13 | enum [ enum_base_type ] { enum_name_declaration { , enum_name_declaration } } { packed_dimension } | string | chandle | virtual [ interface ] interface_identifier [ parameter_value_assignment ] [ . modport_identifier ] | [ class_scope | package_scope ] type_identifier { packed_dimension } | class_type | event | ps_covergroup_identifier | type_reference If you go through the list of data_type items, there is nothing that allows an interface_identifier unless it is preceded by the virtual keyword. Quote Link to comment Share on other sites More sharing options...
sep_com Posted December 10, 2015 Author Report Share Posted December 10, 2015 Thanks a lot,Dave. It is reasonable. To be honest, I haven't pay so much attention to the section of "A.2 Declarations" before. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.