Subject: [sv-bc] Proposal for SV-BC-69
From: Jacobi, Dan (dan.jacobi@intel.com)
Date: Thu Mar 06 2003 - 15:39:56 PST
SV-BC listing
=============
This E-mail deals with the issue labeled as SV-BC-69 (P-0478)
Motivation
==========
See attachment (also attached to P-0478)
In General
==========
We will enable the use of empty statements, model items and interface items
within
all the declaration scopes.
The following RTL will be considered legal.
// $ROOT
; // this is an empty statement
module m1(input p1);
; // this is an empty module item
reg a,g,l;
generate ; // this is an empty generate item
assign l = 1;
endgenerate
assign a = 1;
; // this is an empty module item
begin
reg c;
; // this is an empty statement
c = 1;
end ; // An empty module item follows the seq-block
function foo(input f1);
; // this is an empty function statement
endfunction ; // An empty module item follows the function
declaration
task tas(input f1);
; // this is an empty function statement
endtask ; // An empty module item follows the task declaration
fork
g = 1;
; // this is an empty statement
join ; // An empty module item follows the fork-join block
endmodule ; // An empty statement following the module declaration
interface i1 (); // An empty interface item after the interface
header
; // An empty interface item
endinterface
Still illegal
=============
The proposal still keeps the following illegal
1. empty ports in port lists or port declaration lists such as :
module (p1 , , p2); // syntax error
interface (input p1 , , output p2); // syntax error
2. empty declarations
; // this is O.K. because it is an empty module item
module dj();
reg a;
; // this is O.K. because it is an empty module item
reg c;
begin
reg d;
; // an empty declaration - syntax error
reg e;
; // this is O.K. because it is an empty module item
end
function foo(input a)
reg d;
; // an empty declaration - syntax error
reg e;
; // this is O.K. because it is an empty module item
end unction
Proposal (BNF changes)
======================
Main idea :
-----------
Segment 1. Replace the use of the 'statement' token with the
'statement_or_null' token
Segment 2. Replace the use of the 'function_statement' token with the
'function_statement_or_null' token.
Segment 3. Add a null item to module_or_generate_item and
interafce_or_generate_item
Segment 4. Remove the generate_module_item_or_null and
generate_interface_item_or_null tokens and
use the module_or_generate_item and interafce_or_generate_item
tokens instead
Segment 1
-----------
Under A.1.3
REPLACE
description ::=
module_declaration
| udp_declaration
| module_root_item
| statement
WITH
description ::=
module_declaration
| udp_declaration
| module_root_item
| statement_or_null
--
Under A.2.7
REPLACE
task_declaration ::=
'task' [ 'automatic' ] [ interface_identifier '.' ]
task_identifier ';'
{ task_item_declaration }
{ statement }
'endtask' [ ':' task_identifier ]
| 'task' [ 'automatic' ] [ interface_identifier '.' ]
task_identifier '(' task_port_list ')' ';'
{ block_item_declaration }
{ statement }
'endtask' [ ':' task_identifier ]
WITH
task_declaration ::=
'task' [ 'automatic' ] [ interface_identifier '.' ]
task_identifier ';'
{ task_item_declaration }
{ statement_or_null }
'endtask' [ ':' task_identifier ]
| 'task' [ 'automatic' ] [ interface_identifier '.' ]
task_identifier '(' task_port_list ')' ';'
{ block_item_declaration }
{ statement_or_null }
'endtask' [ ':' task_identifier ]
--
Under A.6.2
REPLACE
initial_construct ::= 'initial' statement
always_construct ::= 'always' statement
combinational_statement ::= 'always_comb' statement
latch_statement ::= 'always_latch' statement
ff_statement ::= 'always_ff' statement
WITH
initial_construct ::= 'initial' statement_or_null
always_construct ::= 'always' statement_or_null
combinational_statement ::= 'always_comb' statement_or_null
latch_statement ::= 'always_latch' statement_or_null
ff_statement ::= 'always_ff' statement_or_null
--
Under A.6.3
REPLACE
par_block ::=
'fork' [ ':' block_identifier ] { block_item_declaration } { statement }
'join' [ ':' block_identifier ]
seq_block ::=
'begin' [ ':' block_identifier ] { block_item_declaration } { statement }
'end' [ ':' block_identifier ]
WITH
par_block ::=
'fork' [ ':' block_identifier ] { block_item_declaration } {
statement_or_null } 'join' [ ':' block_identifier ]
seq_block ::=
'begin' [ ':' block_identifier ] { block_item_declaration } {
statement_or_null } 'end' [ ':' block_identifier ]
--
Under A.6.4 (assuming the process rule was not removed by the EC)
REPLACE
statement_item ::=
{ attribute_instance } blocking_assignment ';'
| { attribute_instance } nonblocking_assignment ';'
| { attribute_instance } procedural_continuous_assignments
';'
| { attribute_instance } case_statement
| { attribute_instance } conditional_statement
| { attribute_instance } inc_or_dec_expression ';'
| { attribute_instance } function_call ';'
| { attribute_instance } disable_statement
| { attribute_instance } event_trigger
| { attribute_instance } loop_statement
| { attribute_instance } jump_statement
| { attribute_instance } par_block
| { attribute_instance } procedural_timing_control_statement
| { attribute_instance } seq_block
| { attribute_instance } system_task_enable
| { attribute_instance } task_enable
| { attribute_instance } wait_statement
| { attribute_instance } 'process' statement
| { attribute_instance } proc_assertion
WITH
statement_item ::=
{ attribute_instance } blocking_assignment ';'
| { attribute_instance } nonblocking_assignment ';'
| { attribute_instance } procedural_continuous_assignments
';'
| { attribute_instance } case_statement
| { attribute_instance } conditional_statement
| { attribute_instance } inc_or_dec_expression ';'
| { attribute_instance } function_call ';'
| { attribute_instance } disable_statement
| { attribute_instance } event_trigger
| { attribute_instance } loop_statement
| { attribute_instance } jump_statement
| { attribute_instance } par_block
| { attribute_instance } procedural_timing_control_statement
| { attribute_instance } seq_block
| { attribute_instance } system_task_enable
| { attribute_instance } task_enable
| { attribute_instance } wait_statement
| { attribute_instance } 'process' statement_or_null
| { attribute_instance } proc_assertion
--
Under A.6.8
REPLACE
loop_statement ::=
'forever' statement
| 'repeat' '(' expression ')' statement_or_null
| 'while' '(' expression ')' statement_or_null
| 'for' '(' variable_decl_or_assignment ';' expression ';'
variable_assignment ')' statement_or_null
| 'do' statement 'while' '(' expression ')' ';'
WITH
loop_statement ::=
'forever' statement_or_null
| 'repeat' '(' expression ')' statement_or_null
| 'while' '(' expression ')' statement_or_null
| 'for' '(' variable_decl_or_assignment ';' expression ';'
variable_assignment ')' statement_or_null
| 'do' statement_or_null 'while' '(' expression ')' ';'
Segment 2
-----------
Under A.2.6
REPLACE
function_declaration ::=
'function' [ 'automatic' ] [ signing ] [ range_or_type ]
[ interface_identifier '.' ] function_identifier ';'
{ function_item_declaration }
{ function_statement }
'endfunction' [ ':' function_identifier ]
| 'function' [ 'automatic' ] [ signing ] [ range_or_type ]
[ interface_identifier '.' ] function_identifier '('
function_port_list ')' ';'
{ block_item_declaration }
{ function_statement }
'endfunction' [ ':' function_identifier ]
WITH
'function' [ 'automatic' ] [ signing ] [ range_or_type ]
[ interface_identifier '.' ] function_identifier ';'
{ function_item_declaration }
{ function_statement_or_null }
'endfunction' [ ':' function_identifier ]
| 'function' [ 'automatic' ] [ signing ] [ range_or_type ]
[ interface_identifier '.' ] function_identifier '('
function_port_list ')' ';'
{ block_item_declaration }
{ function_statement_or_null }
'endfunction' [ ':' function_identifier ]
--
Under A.6.3
REPLACE
function_seq_block ::=
'begin' [ ':' block_identifier { block_item_declaration } ] {
function_statement } 'end'
WITH
'begin' [ ':' block_identifier { block_item_declaration } ] {
function_statement_or_null } 'end'
--
Under A.6.8
function_loop_statement ::=
'forever' function_statement
| 'repeat' '(' expression ')' function_statement_or_null
| 'while' '(' expression ')' function_statement_or_null
| 'for' '(' variable_decl_or_assignment ';' expression ';'
variable_assignment ')'
function_statement_or_null
| 'do' function_statement 'while' '(' expression ')' ';'
WITH
function_loop_statement ::=
'forever' function_statement_or_null
| 'repeat' '(' expression ')' function_statement_or_null
| 'while' '(' expression ')' function_statement_or_null
| 'for' '(' variable_decl_or_assignment ';' expression ';'
variable_assignment ')'
function_statement_or_null
| 'do' function_statement_or_null 'while' '(' expression ')' ';'
Segment 3
-----------
Under A.1.5
REPLACE
module_or_generate_item ::=
{ attribute_instance } parameter_override
| { attribute_instance } continuous_assign
| { attribute_instance } gate_instantiation
| { attribute_instance } udp_instantiation
| { attribute_instance } module_instantiation
| { attribute_instance } initial_construct
| { attribute_instance } always_construct
| { attribute_instance } combinational_statement
| { attribute_instance } latch_statement
| { attribute_instance } ff_statement
| module_common_item
WITH
module_or_generate_item ::=
{ attribute_instance } parameter_override
| { attribute_instance } continuous_assign
| { attribute_instance } gate_instantiation
| { attribute_instance } udp_instantiation
| { attribute_instance } module_instantiation
| { attribute_instance } initial_construct
| { attribute_instance } always_construct
| { attribute_instance } combinational_statement
| { attribute_instance } latch_statement
| { attribute_instance } ff_statement
| module_common_item
| { attribute_instance } ';'
--
Under A.1.6
REPLACE
interface_or_generate_item ::=
{ attribute_instance } continuous_assign
| { attribute_instance } initial_construct
| { attribute_instance } always_construct
| { attribute_instance } combinational_statement
| { attribute_instance } latch_statement
| { attribute_instance } ff_statement
| { attribute_instance } local_parameter_declaration
| { attribute_instance } parameter_declaration ';'
| module_common_item
| { attribute_instance } modport_declaration
WITH
interface_or_generate_item ::=
{ attribute_instance } continuous_assign
| { attribute_instance } initial_construct
| { attribute_instance } always_construct
| { attribute_instance } combinational_statement
| { attribute_instance } latch_statement
| { attribute_instance } ff_statement
| { attribute_instance } local_parameter_declaration
| { attribute_instance } parameter_declaration ';'
| module_common_item
| { attribute_instance } modport_declaration
| { attribute_instance } ';'
Segment 4
---------
Under A.4.2.1
REMOVE
generate_module_item_or_null ::= generate_module_item | ';'
--
REPLACE
generate_module_conditional_statement ::=
'if' ( constant_expression ) generate_module_item_or_null [ 'else'
generate_module_item_or_null ]
...
genvar_module_case_item ::=
constant_expression { , constant_expression } ':'
generate_module_item_or_null
| 'default' [ ':' ] generate_module_item_or_null
WITH
generate_module_conditional_statement ::=
'if' ( constant_expression ) generate_module_item [ 'else'
generate_module_item ]
...
genvar_module_case_item ::=
constant_expression { ',' constant_expression } ':'
generate_module_item
| 'default' [ ':' ] generate_module_item
--
Under A.4.2.2
REMOVE
generate_interface_item_or_null ::= generate_interface_item | ';'
--
REPLACE
generate_interface_conditional_statement ::=
'if' ( constant_expression ) generate_interface_item_or_null [ 'else'
generate_interface_item_or_null ]
...
genvar_interface_case_item ::=
constant_expression { ',' constant_expression } ':'
generate_interface_item_or_null
| 'default' [ ':' ] generate_interface_item_or_null
WITH
generate_interface_conditional_statement ::=
'if' ( constant_expression ) generate_interface_item [ 'else'
generate_interface_item ]
...
genvar_interface_case_item ::=
constant_expression { ',' constant_expression } ':'
generate_interface_item
| 'default' [ ':' ] generate_interface_item
--
<<VerilogMacrosSemicolons.ZIP (Compressed)>>
Dan Jacobi
Phone : (972)-4-8655855
This archive was generated by hypermail 2b28 : Thu Mar 06 2003 - 18:08:31 PST