Specman-e BNF Grammar

Posted on 2004-03-19 by Sigasi
Tagged as: ebnf
Up to date as of Fri Mar 19 2004.
module
statement_list
statement_list
statements
statements
statement
| statements ; statement
statement
package_statement
| struct_statement
| extend_struct_statement
| type_statement
| extend_type_statement
| routine_statement
| simulator_statement
| unit_statement
| sequence_statement
| method_type_statement
| c_export_statement
package_statement
package id
struct_statement
package_or_null struct id like_opt { struct_member_list }
like_opt
[ like id ]
extend_struct_statement
extend struct_type { struct_member_list }
type_statement
package_or_null type id : scalar_type
extend_type_statement
extend id : [ enum_item_list ]
routine_statement
package_or_null routine id ( parameter_list ) type_opt routine_name_opt
routine_name_opt
[ is c routine id ]
last_semi_opt
[ ; ]
c_export_statement
c export id c_export_opt
c_export_opt
[ . id ( ) ]
package_or_null
[ package ]
encap
[ package | private | protected ]
sequence_statement
package_or_null sequence id sequence_opt
sequence_opt
[ using seq_name_pair_list ]
seq_name_pair_list
seq_name_pair
| seq_name_pair_list , seq_name_pair
seq_name_pair
id = struct_type
method_type_statement
package_or_null method type id ( parameter_list ) opt_return opt_event
opt_return
[ : type ]
opt_event
[ @ event ]
struct_member_list
struct_members
struct_members
struct_member
| more_struct_members struct_member
struct_member
[ field_declaration | method_declaration | subtype_declaration | constraint_declaration | coverage_declaration | temporal_declaration | simulator_member | attribute | cvl_declaration ]
field_declaration
encap id field_type_specifier opt_instance
| encap field_property id field_type_specifier opt_instance
field_property
!
| %
| ! %
| % !
field_type_specifier
[ [ expr ] : list_type | : type ]
method_declaration
encap method_name ( parameter_list ) type_opt method_specifier action_block
| encap method_name ( parameter_list ) type_opt is empty
| encap method_name ( parameter_list ) type_opt is undefined
| encap method_name ( parameter_list ) type_opt is c routine id
| encap method_name ( parameter_list ) type_opt @ event method_specifier action_block
| encap method_name ( parameter_list ) type_opt @ event is empty
| encap method_name ( parameter_list ) type_opt @ event is undefined
| encap method_name ( parameter_list ) type_opt method_specifier foreign_opt dynamic c routine libname_opt
method_name
method_id
parameter_list
[ parameters ]
parameters
parameter
| parameters ,
parameter
id
| id : type
| id : * type
type_opt
[ : type ]
method_specifier
member_specifier
| is inline
| is inline only
foreign_opt
[ foreign ]
member_specifier
is
| is also
| is first
| is only
libname_opt
[ id : | id | id : id ]
subtype_declaration
encap when struct_subtype { struct_member_list }
constraint_declaration
keep constraint_spec
list_of_constraint_spec_or_null
[ list_of_constraint_spec last_semi_opt ]
list_of_constraint_spec
constraint_spec
| list_of_constraint_spec ; constraint_spec
constraint_spec
constraint_expr gen before subtypes ( field_list ) reset gen before subtypes ( )
field_list
id field_list , id
attribute
attribute id id = attribute_expr
attribute_expr
id
unit_statement
package_or_null unit id like_unit_opt { struct_member_list }
like_unit_opt
[ like id ]
opt_instance
[ is instance ]
cvl_declaration
cvl_method
| cvl_call
| cvl_callback
cvl_method
cvl method opt_async method_name ( parameter_list ) opt_event cvl_routine
cvl_call
cvl call opt_async method_name ( parameter_list ) opt_event cvl_routine
cvl_callback
cvl callback opt_async method_name ( parameter_list ) opt_event cvl_routine
opt_async
[ async ]
cvl_routine
[ is c routine target_struct ]
target_struct
id
| id . id
hdl_path
' hdl_pathname'
simulator_statement
simulator_member
| simulator_restricted_member
simulator_member
verilog simulator id
| vhdl simulator id
| verilog task hdl_path ( vtask_parameter_list )
| verilog function hdl_path ( vfunc_parameters ) v_size_opt
| verilog variable hdl_path options_opt
| verilog code expr
| vhdl code { verilog_command_list last_semi_opt }
| vhdl procedure hdl_path options_opt
| vhdl function ' id ' options_opt
| vhdl driver hdl_path options_opt
| vhdl object hdl_path
simulator_restricted_member
verilog time verilog_timescale
| vhdl time vhdl_timescale
verilog_command_list
verilog_command
| verilog_command_list ; verilog_command
verilog_command
STRING_LITERAL
vtask_parameter_list
[ vtask_parameters ]
vtask_parameters
vtask_parameter
| vtask_parameters , vtask_parameter
vtask_parameter
id : expr vtask_parameter_options_opt
vtask_parameter_options_opt
[ : vtask_io ]
vtask_io
in
| id
| inout
vfunc_parameters
[ vfunc_parameter_list ]
vfunc_parameter_list
vfunc_parameter
| vfunc_parameter_list , vfunc_parameter
vfunc_parameter
id v_size_opt
v_size_opt
[ : expr ]
verilog_action
force hdl_path = force_rhs
| release hdl_path
force_rhs
expr
| verilog_literal
verilog_timescale
NUMERIC_LITERALid / NUMERIC_LITERALid
vhdl_timescale
NUMERIC_LITERALid
action_block
{ action_list }
action_list
actions
actions
action
| actions ; action
action
e_action
e_action
[ var_action | assign_action | conditional_action | iterative_action | method_call_action | start_tcm_action | compute_action | return_action | try_action | check_action | gen_action | emit_action | time_consuming_action | print_action | verilog_action | debug_action | dut_error_action | do_seq_action | action_block ]
var_action
var id type_opt init_opt
| var id := expr
init_opt
[ = expr ]
conditional_action
break
| continue
| if_action
| case_action
if_action
if expr then_opt action_block else_part_opt
then_opt
[ then ]
else_part_opt
[ else action_block | else if_action ]
case_action
case { case_list }
| case binary_expr { case_list }
case_list
cases last_semi_opt
cases
case
| cases ; case
case
expr colon_opt action_block
| default
colon_opt
[ : ]
default
default colon_opt action_block
iterative_action
repeat do_opt action_block until expr
| while expr do_opt action_block
| for id from expr up_down binary_expr step_opt do_opt action_block
| for { action ; expr ; action } do_opt action_block
| for each iterated_type_opt itemname_opt indexname_opt in expr do_opt action_block
| for each iterated_type_opt itemname_opt indexname_opt in reverse expr do_opt action_block
| for each file itemname_opt matching expr do_opt action_block
| for each line itemname_opt in file expr do_opt action_block
up_down
to
| down to
iterated_type_opt
[ struct_type | enumerated_type ]
itemname_opt
[ ( id ) ]
indexname_opt
[ using index ( id ) ]
do_opt
[ do ]
step_opt
[ step expr ]
try_action
try action_block else_try_opt
else_try_opt
[ else action_block ]
check_action
check name_opt that_opt expr opt_block dut_error_opt
| assert expr else_error_opt
name_opt
[ < id > ]
that_opt
[ that ]
dut_error_opt
[ else dut_error ( argument_list ) opt_block ]
dut_error
dut error
| dut errorf
else_error_opt
[ else error ( exprs ) ]
method_call_action
method_invocation
| method_port_invocation
action_opt
action_block
| with_opt
expr_or_default
expr
| default
opt_config_param
[ , exprs ]
compute_action
compute expr
return_action
return expr_opt
assign_action
Ival_expr assign_operator expr
assign_operator
= +=
| -=
| *=
| /= %=
| <<=
| >>=
| &=
| ^=
| l=
| and=
| or=
| <=
| &&=
| ||=
gen_action
gen reduced_gen_action_item itemname_opt keeping_opt
| gen qualified_id itemname_opt keeping_opt
keeping_opt
[ keeping { constraint_list } ]
print_action
print exprs options_opt
do_seq_action
do when_qualified_id itemname_opt keeping_opt
debug_action
message ( argument_list ) opt_block
| messagef ( argument_list ) opt_block
dut_error_action
dut error ( argument_list ) opt_block
| dut errorf ( argument_list ) opt_block
opt_block
[ action_block when qualified ]
id
id
| struct_qualifier when_qualified_id
qualified_id
path_id
| struct_qualifier qualified_id
path_id
id
| id [ expr ]
| me
| path_id . id
| path_id . id [ expr ]
| path_id . as_a ( type )
reduced_gen_action_item
. id
| . id [ expr ]
| reduced_gen_action_item . id
| reduced_gen_action_item . id [ expr ]
| reduced_gen_action_item . as_a ( type )
coverage_declaration
cover id opt_cov_field coverage_group_option
coverage_group_option
options_opt member_specifier { cover_item_list }
| is empty
| using also options opt_cover_item_list
cover_item_list
[ cover_items last_semi_opt ]
opt_cover_item_list
[ is also { cover_item_list } ]
cover_items
cover_item
| cover_items ; cover_item
cover_item
item id item_options_opt
| item id : type = expr options_opt
| transition id item_options_opt
| cross item_name_list item_options_opt
item_name_list
id
| item_name_list , id
opt_cov_field
[ ( expr ) ]
item_options_opt
[ using options | using also options ]
temporal_declaration
encap event id event_option
| on id opt_defer do_opt action_block
| encap expect_declaration
opt_defer
[ $ ]
event_option
[ is temporal_expr | is only temporal_expr ]
expect_declaration
expect id
| expect temporal_expr dut_error_opt
| expect id expect_specifier temporal_expr dut_error_opt
| assume id
| assume temporal_expr dut_error_opt
| assume id expect_specifier temporal_expr dut_error_opt
expect_specifier
is
| is only
emit_action
emit event
start_tcm_action
[ start method_invocation | start method_port_invocation ]
time_consuming_action
all of action_block
| first of action_block
| wait
| wait until_opt temporal_expr
| sync
| sync temporal_expr
| state machine expr until_state_opt { transition_list }
until_opt
[ until ]
until_state_opt
[ until id ]
transition_list
last_semi_opt
| transitions last_semi_opt
transitions
transition
| transitions ; transition
transition
id => id action_block
| * => id action_block
| id action_block
event
id
| field_access
| primitive_expr $
temporal_expr
temporal_inclusive_expression
| temporal_expr @ event
temporal_inclusive_expression
temporal_or_expression
| temporal_inclusive_expression => temporal_or_expression
temporal_or_expression
temporal_and_expression
| temporal_or_expression or temporal_and_expression
temporal_and_expression
temporal_exec_expression
| temporal_and_expression and temporal_exec_expression
temporal_exec_expression
temporal_sampling_expression
| temporal_sampling_expression exec action_block
temporal_sampling_expression
temporal_eventual_expression
| temporal_eventual_expression @
temporal_eventual_expression
temporal_repeat_expr
| eventual temporal_repeat_expr
| not temporal_eventual_expression
temporal_repeat_expr
temporal_unaryexpr
| [ range ] temporal_repeat_opt
| [ expr ] temporal_repeat_opt
| ~ [ range ] temporal_repeat_opt
temporal_primitive
cycle
| detach ( temporal_expr )
| true ( expr )
| rise ( expr )
| fall ( expr )
| change ( expr )
| delay ( expr )
| ( temporal_expr )
| { temporal_sequence last_semi_opt }
| consume ( @ event )
temporal_sequence
temporal_expr
| temporal_sequence ; temporal_expr
temporal_repeat_opt
[ * temporal_exec_expression ]
temporal_unaryexpr
temporal_primitive
| @ event
| fail temporal_unaryexpr )
type
non_port_type
| port_type
non_port_type
regular_type
| list_type
regular_type
scalar_type
| struct_subtype
scalar_type
id
| enumerated_type
| scalar_type scalar_modifier
enumerated_type
[ enum_item_list ]
scalar_modifier
[ ranges ]
| ( scalar_unit : expr )
| ( scalar_unit : * )
enum_item_list
[ enum_items ]
enum_items
enum_item
| enum_items , enum_item
enum_item
id enum_num_opt
enum_num_opt
[ = expr ]
scalar_unit
bits
| bytes
struct_type
id
| struct_subtype
struct_subtype
struct_qualifier struct_type
struct_qualifier
id
| id ' id
| FALSE' id
| TRUE' id
list_type
list of type
| list ( id : id ) of type
port_type
io_type simple of non_port_type
| io_type buffer of non_port_type
| io_type event
| serve_client call of non_port_type
| io_type method of id
io_type
[ id | in | inout ]
serve_client
id
constraint_expr
binary_expr
select
select { selection_list last_semi_opt }
selection_list
selection
| selection_list ; selection
selection
expr : expr
port_binding
bind ( expr , port_bind_target port_constraint )
port_bind_target
expr
| UNDEFINED
port_constraint
[ , { constraint_list } ]
Ival_expr
id
| field_access
| primitive_expr [ range_element ]
| hdl_path
| bit_extract
| bit_concat
| primitive_expr $
primitive_expr
lval_expr
| me
| literal
| ( binary_expr )
| new
| method_invocation
| method_port_invocation
| [ ranges ]
| cast
| select
| port_binding
new
new
| new struct_type itemname_opt with_opt
with_opt
[ with action_block ]
field_access
primitive_expr . when_field_access
| . when_field_access
| when_field_access_pair
when_field_access
id
| when_field_access_pair
when_field_access_pair
FALSE' id
| TRUE' id
| when_field_access ' id
bit_extract
primitive_expr [ expr_opt : expr_opt slice_opt ]
slice_opt
[ : scalar_type ]
bit_concat
% { bit_elements }
bit_elements
expr
| bit_elements , expr
method_port_invocation
primitive_expr $ ( argument_list )
method_invocation
primitive_expr . called_method_name ( argument_list )
| . called_method_name ( argument_list )
| id_or_special_method ( argument_list )
| hdl_path ( argument_list )
| all_values ( scalar_type )
| get all units ( struct_type )
| primitive_expr . get enclosing unit ( struct_type )
| get enclosing unit ( struct_type )
| primitive_expr . try enclosing unit ( struct_type )
| try enclosing unit ( struct_type )
| primitive_expr . seq_method ( type ) itemname_opt
| . seq_method ( type ) itemname_opt
| seq_method ( type ) itemname_opt
called_method_name
method_name
id_or_special_method
method_id
seq_method
in sequence
| in unit
argument_list
[ exprs ]
cast
primitive_expr . as_a ( type )
| . as_a ( type )
ranges
range_element
| ranges , range_element
range_element
expr
| range
range
expr_opt .. expr_opt
list_elements_or_null
[ list_elements last_semi_opt ]
list_elements
expr
| list_elements ; expr
unary_expr
primitive_expr
| now @ event
| { list_elements_or_null }
| { list_elements_or_null } [ range_element ]
| { list_elements_or_null } . id ( argument_list )
| unary_operator unary_expr
| primitive_expr unary_post_operator
| Ival_expr time_unit
| literal time_unit
| constraint_for_each_expr
| text_expansion_exp
| << STRING_LITERAL
unary_operator
not
| |
| &
| ^
| nor
| nand
| nxor
| +
| -
| ~
| !
unary_post_operator
is empty
| is not empty
binary_expr
boolean_imp_expression
| boolean_imp_expression ? expr : expr
boolean_imp_expression
logical_OR_expression
| boolean_imp_expression => logical_OR_expression
logical_OR_expression
logical_AND_expression
| logical_OR_expression boolor_operator logical_AND_expression
boolor_operator
||
| or
logical_AND_expression
inclusive_OR_expression
| logical_AND_expression booland_operator inclusive_OR_expression
booland_operator
and
| &&
inclusive_OR_expression
exclusive_OR_expression
| inclusive_OR_expression | exclusive_OR_expression
exclusive_OR_expression
AND_expression
| exclusive_OR_expression exclusive_operator AND_expression
exclusive_operator
^
| nxor
AND_expression
in_expression
| AND_expression & in_expression
in_expression
match_expression
| in_expression IN_operator match_expression
IN_operator
in
| in range
| not in
match_expression
relational_expression
| match_expression match_operator relational_expression
match_operator
~
| !~
relational_expression
member_expression
| relational_expression neq_operator relational_rhs
| verilog_literal neq_operator member_expression
relational_rhs
member_expression
| verilog_literal
neq_operator
==
| !=
| verilog_operator
verilog_operator
===
| !==
member_expression
equality_expression
| member_expression is a struct_type
| member_expression is a struct_type ( id )
| member_expression is not a struct_type
equality_expression
soft_expression
| equality_expression eq_operator soft_expression
soft_expression
shift_expression
| soft shift_expression
eq_operator
<=
| >=:
| <
| >
shift_expression
additive_expression
| shift_expression shift_operator additive_expression
| gen ( gen_item_list ) before ( gen_item_list )
shift_operator
<<
additive_expression
multiplicative_expression
| additive_expression additive_operator multiplicative_expression
additive_operator
-
multiplicative_expression
unary_expr
| multiplicative_expression multiplicative_operator unary_expr
multiplicative_operator
*
| /
| %
| within
exprs
expr
| exprs , expr
expr
binary_expr
expr_opt
[ expr ]
opt_index
[ Index ( id ) ]
opt_prev
[ prev ( id ) ]
constraint_for_each_expr
for each itemname_opt in gen_item do_opt { constraint_list }
| for each itemname_opt using opt_index opt_prev in gen_item do_opt { constraint_list }
gen_item_list
gen_item
| gen_item_list , gen_item
| >>
| +
gen_item
primitive_expr
constraint_list
[ constraints last_semi_opt ]
constraints
constraint_expr
| constraints ; constraint_expr
verilog_literal
BASED_LITERAL
time_unit
hr
| min
| sec
| ms
| us
| ns
| ps
| fs
text_expansion_exp
text begin text_list text end
text_list
( expr )
| STRING_LITERAL
| text_list ( expr )
| text_list STRING_LITERAL
options_opt
[ using options ]
options
option
| options , option
option
id
| id = expr
| when = expr
| range_option
range_option
ranges = { cover_ranges last_semi_opt }
cover_ranges
cover_range
| cover_ranges ; cover_range
cover_range
range ( [ ranges ] optional_range_param )
| range ( id optional_range_param )
optional_range_param
[ , exprs ]
literal
STRING_LITERAL
| NUMERIC_LITERAL
| CHAR LITERAL
| TRUE
| FALSE
| NULL
| UNDEF
| MAX_INT
| MIN_INT
id
id

See also

comments powered by Disqus