SYNAPTICADcolon VERILOGGER
 

VeriLogger Extreme - a fast, accurate, affordable, high-performance compiled-code Verilog 2001 simulator.SynaptiCAD, what's New!

Verilog2001 Grammar

Top level symbols:

1 Source text
1.1 Library source text
|
|
_file_path_
include file_path_spec ;
1.2 Configuration source text
design ( ( library_identifier . )? cell_identifier )* ;
|
|
|
|
default
instance inst_name
liblist ( ( library_identifier )* )?
use ( library_identifier . )? cell_identifier ( :config )?
1.3 Module and primitive source text
|
|
module | macromodule
1.4 Module parameters and ports
( port ( , port )* )
|
( )
port ::=
|
|
|
|
|
|
1.5 Module items
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 Declarations
2.1 Declaration types
2.1.1 Module parameter declarations
localparam ( signed )? ( range )? list_of_param_assignments ;
|
localparam integer list_of_param_assignments ;
|
localparam real list_of_param_assignments ;
|
localparam realtime list_of_param_assignments ;
|
localparam time list_of_param_assignments ;
parameter ( signed )? ( range )? list_of_param_assignments ;
|
parameter integer list_of_param_assignments ;
|
parameter real list_of_param_assignments ;
|
parameter realtime list_of_param_assignments ;
|
parameter time list_of_param_assignments ;
2.1.2 Port declarations
inout ( net_type )? ( signed )? ( range )? list_of_port_identifiers
input ( net_type )? ( signed )? ( range )? list_of_port_identifiers
output ( net_type )? ( signed )? ( range )? list_of_port_identifiers
|
output ( reg )? ( signed )? ( range )? list_of_port_identifiers
|
output reg ( signed )? ( range )? list_of_variable_port_identifiers
|
|
2.1.3 Type declarations
reg ( signed )? ( range )? list_of_variable_identifiers ;
|
|
trireg ( drive_strength )? ( signed )? ( delay3 )? list_of_net_decl_assignments ;
|
trireg ( charge_strength )? ( signed )? ( delay3 )? list_of_net_identifiers ;
|
trireg ( charge_strength )? ( vectored | scalared )? ( signed )? range ( delay3 )? list_of_net_identifiers ;
|
trireg ( drive_strength )? ( vectored | scalared )? ( signed )? range ( delay3 )? list_of_net_decl_assignments ;
|
net_type ( drive_strength )? ( vectored | scalared )? ( signed )? range ( delay3 )? list_of_net_decl_assignments ;
|
net_type ( vectored | scalared )? ( signed )? range ( delay3 )? list_of_net_identifiers ;
2.2 Declaration data types
2.2.1 Net and variable types
supply0 | supply1 | tri | triand | trior | tri0 | tri1 | wire | wand | wor
integer | time
|
|
2.2.2 Strengths
|
|
( strength0 , highz1 )
|
( strength1 , highz0 )
|
( highz0 , strength1 )
|
( highz1 , strength0 )
supply0 | strong0 | pull0 | weak0
supply1 | strong1 | pull1 | weak1
( small )
|
( medium )
|
( large )
2.2.3 Delays
delay3 ::=
|
# ( delay_value ( , delay_value ( , delay_value )? )? )
delay2 ::=
|
# ( delay_value ( , delay_value )? )
|
|
|
2.3 Declaration lists
2.4 Declaration assignments
|
PATHPULSE$ = ( reject_limit_value ( , error_limit_value )? ) ;
|
limit_value
limit_value
2.5 Declaration ranges
range ::=
2.6 Function declarations
|
|
range | integer | real | realtime | time
2.7 Task declarations
task ( automatic )? task_identifier ; ( task_item_declaration )* statement endtask
|
task ( automatic )? task_identifier ( task_port_list ) ; ( block_item_declaration )* statement endtask
|
|
|
|
|
input ( reg )? ( signed )? ( range )? list_of_port_identifiers
|
output ( reg )? ( signed )? ( range )? list_of_port_identifiers
|
inout ( reg )? ( signed )? ( range )? list_of_port_identifiers
|
time | real | realtime | integer
2.8 Block item declarations
|
|
|
|
|
|
|
|
3 Primitive instances
3.1 Primitive instantiation and instances
|
|
|
|
|
|
|
|
3.2 Primitive strengths
|
|
|
|
3.3 Primitive terminals
expression
expression
expression
expression
net_lvalue
net_lvalue
3.4 Primitive gate and switch types
cmos | rcmos
bufif0 | bufif1 | notif0 | notif1
nmos | pmos | rnmos | rpmos
and | nand | or | nor | xor | xnor
buf | not
tranif0 | tranif1 | rtranif1 | rtranif0
tran | rtran
4 Module and generated instantiation
4.1 Module instantiation
|
expression
|
4.2 Generated instantiation
generate ( generate_item )* endgenerate
generate_item | ;
|
|
|
|
|
default ( : )? generate_item_or_null
5 UDP declaration and instantiation
5.1 UDP declaration
|
5.2 UDP ports
|
|
|
5.3 UDP body
|
1'b0 | 1'b1 | 1'bx | 1'bX | 1'B0 | 1'B1 | 1'Bx | 1'BX | 1 | 0
|
|
level_symbol
output_symbol | -
0 | 1 | x | X
0 | 1 | x | X | ? | b | B
r | R | f | F | p | P | n | N | *
5.4 UDP instantiation
6 Behavioral statements
6.1 Continuous assignment statements
6.2 Procedural blocks and assignments
initial statement
always statement
|
deassign variable_lvalue
|
|
|
|
release net_lvalue
|
6.3 Parallel and sequential blocks
6.4 Statements
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6.5 Timing control statements
|
|
|
|
|
|
@ *
|
@ ( * )
|
|
posedge expression
|
negedge expression
|
|
6.6 Conditional statements
|
|
6.7 Case statements
case ( expression ) case_item ( case_item )* endcase
|
casez ( expression ) case_item ( case_item )* endcase
|
casex ( expression ) case_item ( case_item )* endcase
|
default ( : )? statement_or_null
|
|
|
6.8 Looping statements
|
|
|
forever statement
|
repeat ( expression ) statement
|
|
6.9 Task enable statements
7 Specify section
7.1 Specify block declaration
specify ( specify_item )* endspecify
|
|
|
|
pulsestyle_onevent list_of_path_outputs ;
|
pulsestyle_ondetect list_of_path_outputs ;
showcancelled list_of_path_outputs ;
|
noshowcancelled list_of_path_outputs ;
7.2 Specify path declarations
|
|
|
7.3 Specify block terminals
|
|
|
|
|
|
7.4 Specify path delays
|
|
|
|
|
|
expression
posedge | negedge
|
|
+ | -
7.5 System timing checks
7.5.1 System timing check commands
|
|
|
|
|
|
|
|
|
|
|
$setuphold ( reference_event , data_event , timing_check_limit , timing_check_limit ( , ( notify_reg )? ( , ( stamptime_condition )? ( , ( checktime_condition )? ( , ( delayed_reference )? ( , ( delayed_data )? )? )? )? )? )? ) ;
$recovery ( reference_event , data_event , timing_check_limit ( , ( notify_reg )? )? ) ;
$timeskew ( reference_event , data_event , timing_check_limit ( , ( notify_reg )? ( , ( event_based_flag )? ( , ( remain_active_flag )? )? )? )? ) ;
7.5.2 System timing check command arguments
|
|
expression
7.5.3 System timing check event definitions
posedge
|
negedge
|
|
01
|
10
|
|
0 | 1
z_or_x ::=
x | X | z | Z
|
|
|
|
|
|
1'b0 | 1'b1 | 1'B0 | 1'B1 | 'b0 | 'b1 | 'B0 | 'B1 | 1 | 0
8 Expressions
8.1 Concatenations
|
|
|
|
|
|
|
|
8.2 Function calls
8.3 Expressions
expression
|
|
|
|
|
|
|
|
expression
expression
expression
|
|
|
|
|
|
|
|
|
|
|
|
8.4 Primaries
|
|
|
|
|
|
|
|
|
|
|
|
|
|
primary ::=
|
|
|
|
|
|
|
|
|
|
8.5 Expression left-side values
|
|
|
|
|
|
|
|
8.6 Operators
+ | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~
+ | - | * | / | % | == | != | === | !== | && | || | ** | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<<
! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~
== | != | && | || | & | | | ^ | ^~ | ~^
8.7 Numbers
number ::=
|
|
|
|
|
exp ::=
e | E
|
|
|
sign ::=
+ | -
size ::=
' ( s | S )? d
|
' ( s | S )? D
' ( s | S )? b
|
' ( s | S )? B
' ( s | S )? o
|
' ( s | S )? O
hex_base a ::=
' ( s | S )? h
|
' ( s | S )? H
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
x_digit | z_digit | 0 | 1
x_digit | z_digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
x_digit | z_digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f | A | B | C | D | E | F
x_digit ::=
x | X
z_digit ::=
z | Z | ?
8.8 Strings
string ::=
" ( _any_ASCII_Character_except_new_line_ )* "
9 General
9.1 Attributes
(* attr_spec ( , attr_spec )* *)
|
identifier
9.2 Comments
comment ::=
|
// _comment_text_ \n
/* _comment_text_ */
( _any_ASCII_character_ )*
9.3 Identifiers
|
identifier
identifier
identifier
\ ( _any_ASCII_character_except_white_space_ )* _white_space_
identifier
identifier
identifier
identifier f
identifier
|
|
identifier
identifier
identifier
identifier
identifier
identifier
identifier
identifier
identifier
identifier
identifier
[a-zA-Z_] ( [a-zA-Z0-9_$] )*
identifier
$[a-zA-Z0-9_$] ( [a-zA-Z0-9_$] )*
$[a-zA-Z0-9_$] ( [a-zA-Z0-9_$] )*
identifier
identifier
identifier
identifier
identifier
9.4 Identifier branches
9.5 White space
_space_ | _tab_ | _newline_ | _eof_


Notes:
a) Embedded spaces are illegal.
b) The period in escaped_hierarchical_identifier and escaped_hierarchical_branch shall be preceded by white_space, but shall not be followed by white_space.
c) The period (.) in simple_hierarchical_identifier and simple_hierarchical_branch shall not be preceded or followed by white_space.
d) A simple_identifier shall start with an alpha or underscore (_) character, shall have at least one character, and shall not have any spaces.
e) The $ character in a system_function_identifier or system_task_identifier shall not be followed by white_space. A system_function_identifier or system_task_identifier shall not be escaped.
f) Hierarchy disallowed!