返回介绍

A.8 Expressions

发布于 2020-09-09 22:56:12 字数 6260 浏览 868 评论 0 收藏 0

主题

描述

A.8.1 Concatenations

concatenation ::=
{ expression { , expression } }
| { struct_member_label : expression { , struct_member_label : expression } }
| { array_member_label : expression { , array_member_label : expression } }
constant_concatenation ::=
{ constant_expression { , constant_expression } }
| { struct_member_label : constant_expression { , struct_member_label : constant_expression } }
| { array_member_label : constant_expression { , array_member_label : constant_expression } }
struct_member_label ::=
default
| type_identifier
| variable_identifier
array_member_label ::=
default
| type_identifier
| constant_expression
constant_multiple_concatenation ::= { constant_expression constant_concatenation }
module_path_concatenation ::= { module_path_expression { , module_path_expression } }
module_path_multiple_concatenation ::= { constant_expression module_path_concatenation... more

A.8.2 Subroutine calls

constant_function_call ::= function_subroutine_call25
tf_call ::= ps_or_hierarchical_tf_identifier { attribute_instance } [ ( list_of_arguments ) ]
system_tf_call ::= system_tf_identifier [ ( list_of_arguments ) ]
subroutine_call ::=
tf_call
| system_tf_call
| method_call
| randomize_call
function_subroutine_call ::= subroutine_call
list_of_arguments ::=
[ expression ] { , [ expression ] } { , . identifier ( [ expression ] ) }
| . identifier ( [ expression ] ) { , . identifier ( [ expression ] ) }
method_call ::= method_call_root . method_call_body
method_call_body ::=
method_identifier { attribute_instance } [ ( list_of_arguments ) ]
| built_in_method_call
built_in_method_call ::=
array_manipulation_call
| randomize_call
array_manipulation_call ::=
array_method_name {... more

A.8.3 Expressions

inc_or_dec_expression ::=
inc_or_dec_operator { attribute_instance } variable_lvalue
| variable_lvalue { attribute_instance } inc_or_dec_operator
conditional_expression ::= cond_predicate ? { attribute_instance } expression : expression
constant_expression ::=
constant_primary
| unary_operator { attribute_instance } constant_primary
| constant_expression binary_operator { attribute_instance } constant_expression
| constant_expression ? { attribute_instance } constant_expression : constant_expression
constant_mintypmax_expression ::=
constant_expression
| constant_expression : constant_expression : constant_expression
constant_param_expression ::=
constant_mintypmax_expression | data_type | $
param_expression ::= mintypmax_expression | data_type
constant_range_expression ::=
constant_expression
| constant_part_select_range
constant_part_select_range ::=
constant_range
| constant_indexed_range
constant_range ::= constant_expression : constant_expression
constant_indexed_range ::=
constant_expression +: constant_expression
| constant_expression -: constant_expression
expression ::=
primary
| unary_operator { attribute_instance... more

A.8.4 Primaries

constant_primary ::=
primary_literal
| ps_parameter_identifier
| ps_specparam_identifier
| genvar_identifier
| [ package_scope | class_scope ] enum_identifier
| constant_concatentation
| constant_multiple_concatenation
| constant_function_call
| ( constant_mintypmax_expression )
| constant_cast
module_path_primary ::=
number
| identifier
| module_path_concatenation
| module_path_multiple_concatenation
| function_subroutine_call
| ( module_path_mintypmax_expression )
primary ::=
primary_literal
| [ implicit_class_handle . | class_scope | package_scope ] hierarchical_identifier select
| empty_queue
| concatenation
| multiple_concatenation
| function_subroutine_call
| ( mintypmax_expression )
| cast
| streaming_expression
| sequence_method_call
| $23
| null
time_literal5 ::=
unsigned_number time_unit
| fixed_point_number time_unit
time_unit ::= s | ms | us | ns | ps | fs |... more

A.8.5 Expression left-side values

net_lvalue ::=
ps_or_hierarchical_net_identifier constant_select
| { net_lvalue { , net_lvalue } }
variable_lvalue ::=
[ implicit_class_handle . | package_scope ] hierarchical_variable_identifier select
| { variable_lvalue { , variable_lvalue } }

A.8.6 Operators

unary_operator ::=
+ | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~
binary_operator ::=
+ | - | * | / | % | == | != | === | !== | =?= | !?= | && | || | **
| < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<<
inc_or_dec_operator ::= ++ | --
unary_module_path_operator ::=
! | ~ | & | ~& | | | ~| | ^ | ~^... more

A.8.7 Numbers

number ::=
integral_number
| real_number
integral_number ::=
decimal_number
| octal_number
| binary_number
| hex_number
decimal_number ::=
unsigned_number
| [ size ] decimal_base unsigned_number
| [ size ] decimal_base x_digit { _ }
| [ size ] decimal_base z_digit { _ }
binary_number ::= [ size ] binary_base binary_value
octal_number ::= [ size ] octal_base octal_value
hex_number ::= [ size ] hex_base hex_value
sign ::= + | -
size ::= non_zero_unsigned_number
non_zero_unsigned_number1 ::= non_zero_decimal_digit { _ | decimal_digit}
real_number1 ::=
fixed_point_number
| unsigned_number [ . unsigned_number ] exp [ sign ] unsigned_number
fixed_point_number1 ::= unsigned_number . unsigned_number
exp ::= e |... more

A.8.8 Strings

string_literal ::= " { Any_ASCII_Characters }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文