[sv-bc] modports proposal


Subject: [sv-bc] modports proposal
From: Jacobi, Dan (dan.jacobi@intel.com)
Date: Wed Jan 29 2003 - 12:27:54 PST


Attached id the proposal I was asked to suggest regarding the modports.
Please note that parts of this proposal are quoted from brads proposal
(SV-BC-60).

----- SV-BC Issues -----
This proposal replaces / overlaps / corrects the following SV-BC issues:
- SV-BC-19-69 single declaration definition in modport decls - P-0318
- SV-BC-22-1 BNF Issue
- P-0096
- SV-BC-60 Modport syntax issues
- P-0358

------ Motivation ------
 1) In an hierarchical interface, modport ports can
       themselves be from modports of interface instances.
       And those instances can be arrayed or generated,
       just like module instances. So rather than

              interface_identifier . port_identifer

       we need

              interface_instance_identifier {[...]}
                         . modport_identifier

   2) The current BNF uses an ANSI-C style in modports that
       would require repetitive declarations of direction and
       import/export, such as,

           modport master ( input a,
                            input b,
                            output c,
                            output d,
                            import task masterRead(),
                            import task masterWrite() ) ;

       but the SystemVerilog language uses a style consistent
       with Verilog 2001, extending the ANSI-C style to
       something like --

           modport master ( input a, b,
                            output c, d,
                            import task masterRead(),
                                   task masterWrite() ) ;

   3) As noted in http://www.eda.org/sv-bc/hm/0221.html
       the [port_type] should not have been in modport_port
       in the existing BNF.

        
-------- Proposal -------
1) replace A.2.9 with

  modport_declaration
           ::=
               'modport' modport_item { ',' modport_item } ';'

  modport_item
           ::=
               modport_identifier '(' modport_ports_declaration
                           { ',' modport_ports_declaration } ')'

  modport_ports_declaration
           ::=
               modport_simple_ports_declaration
             | modport_hierarchical_ports_declaration
             | modport_tf_ports_declaration

  modport_simple_ports_declaration
           ::=
               'input' list_of_modport_port_identifiers
             | 'output' list_of_modport_port_identifiers
             | 'inout' list_of_modport_port_identifiers

  modport_hierarchical_ports_declaration
           ::=
               interface_instance_identifier
                              [ '[' constant_expression ']' ]
                      . modport_identifier

  modport_tf_ports_declaration
           ::=
               import_export modport_tf_port
                              
  modport_tf_port
           ::=
               'task' named_task_proto { ',' named_task_proto }
             | 'function' named_function_proto { ',' named_function_proto }
             | task_or_function_identifier { ',' task_or_function_identifier
}
}

  import_export
           ::=
               'import'
             | 'export'

2) Add to A.9.3 --

  interface_instance_identifier
           ::=
               identifier
3) Add to A.2.3 --

  list_of_modport_port_identifiers
           ::=
               port_identifier { ',' port_identifier }

4) under A.2.6
 REPLACE
    named_function_proto ::= 'function' data_type function_identifier '('
list_of_function_proto_formals ')'
 WITH
    named_function_proto ::= data_type function_identifier '('
list_of_function_proto_formals ')'

5) under A.2.7
 REPLACE
    named_task_proto ::= 'task' task_identifier '(' task_proto_formal { ','
task_proto_formal } ')'
 WITH
    named_task_proto ::= task_identifier '(' task_proto_formal { ','
task_proto_formal } ')'

---- One more question ---
Does any body know where the terminal "task_prototype" is used in the BNF

Can we remove the following production from A.2.7 ?
        task_prototype ::=
        'task' '(' { attribute_instance } task_proto_formal { ',' {
attribute_instance } task_proto_formal } ')'

Dan Jacobi
Phone : (972)-4-8655855



This archive was generated by hypermail 2b28 : Wed Jan 29 2003 - 12:28:37 PST