Mantis 1035

P1800-2008 Draft 3a

Section 11.3, Syntax 11-7, Table 8-1

Fix operator classifications

In Section 11.3, Syntax 11-7:

CHANGE

 

assignment_operator ::=                                               // from A.6.2

= | += | -= | *= | /= | %= | &= | |= | ^= | <<= | >>= | <<<= | >>>=

 

conditional_expression ::=                                          // from A.8.3

cond_predicate ? { attribute_instance } expression : expression

 

unary_operator ::=                                                         // from A.8.6

+ | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~

 

binary_operator ::=

+ | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | **

| < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<<

 

inc_or_dec_operator ::= ++ | --

 

unary_module_path_operator ::=

! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~

 

binary_module_path_operator ::=

== | != | && | || | & | | | ^ | ^~ | ~^

Syntax 11-7—Operator syntax (excerpt from Annex A)

TO

 

assignment_operator ::=                                               // from A.6.2

= | += | -= | *= | /= | %= | &= | |= | ^= | <<= | >>= | <<<= | >>>=

 

conditional_expression ::=                                          // from A.8.3

cond_predicate ? { attribute_instance } expression : expression

 

unary_operator ::=                                                         // from A.8.6

+ | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~

 

binary_operator ::=

+ | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | **

| < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<<

 

inc_or_dec_operator ::= ++ | --

 

unary_module_path_operator ::=

! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~

 

binary_module_path_operator ::=

== | != | && | || | & | | | ^ | ^~ | ~^

 

stream_operator ::= >> | <<                                         // from A.8.1

Syntax 11-7—Operator syntax (excerpt from Annex A)

 

CHANGE
Table 11-1: Operators and data types

Operator token

Name

Data types

=

assignment operator

any

+= -= /= *=

arithmetic assignment operators

integral, real, shortreal

%= &= |= ^= <<= >>= <<<= >>>=

binary logical assignment operators

integral

?:

conditional expression

any

+ -

unary arithmetic operators

integral, real, shortreal

!

unary logical operator

integral, real, shortreal

~ & ~& | ~| ^ ~^ ^~

unary logical reduction operators

integral

+ - * / **

arithmetic binary operators

integral, real, shortreal

% & | ^ ^~ ~^ >> << >>> <<<

binary logical operators

integral

&& ||

other binary logical operators

integral, real, shortreal

< <= > >=

relational operators

integral, real, shortreal

=== !==

case equality operators

any except real and shortreal

== !=

logical equality operators

any

==? !=?

wildcard equality operators

integral

++ --

increment, decrement operators

integral, real, shortreal

inside

set membership operator

singular for the left operand

{} {{}}

concatenation, replication operators

integral

dist

distribution operator

integral

TO

Table 11-1: Operators and data types

Operator token

Name

Operand Data types

=

binary assignment operator

any

<=

binary nonblocking assignment operator

any

+= -= /= *=

binary arithmetic assignment operators

integral, real, shortreal

%=

binary arithmetic modulus assignment operator

integral

%= &= |= ^= <<= >>= <<<= >>>=                       

binary logical bit-wise assignment operators

integral

>>= <<=                    

binary logical shift assignment operators

integral

>>>= <<<=                  

binary arithmetic shift assignment operators

integral

?:

ternary conditional expression operator

any

+ -

unary arithmetic operators

integral, real, shortreal

!

unary logical negation operator

integral, real, shortreal

~ & ~& | ~| ^ ~^ ^~

unary logical reduction operators

integral

+ - * / **

binary arithmetic binary operators

integral, real, shortreal

%

binary arithmetic modulus operator

integral

% & | ^ ^~ ~^ >> << >>> <<<

binary logical bit-wise operators

integral

>> <<                      

binary logical shift operators

integral

>>> <<<                    

binary arithmetic shift operators

integral

&& ||

other binary logical operators

integral, real, shortreal

< <= > >=

binary relational operators

integral, real, shortreal

=== !==

binary case equality operators

any except real and shortreal

== !=

binary logical equality operators

any

==? !=?

binary wildcard equality operators

integral

++ --

unary increment, decrement operators

integral, real, shortreal

inside

binary set membership operator

singular for the left operand

dist                       

binary distribution operator

integral

{} {{}}

concatenation, replication operators

integral

dist                       

binary distribution operator

integral

{<<{}} {>>{}}

stream operators

integral

 

 

CHANGE

 

11.3.1 Operators with real operands

 

The operators shown in Table 11-2 shall be legal when applied to real operands. All other operators shall be

considered illegal when used with real operands.

 

Table 11-2—Legal operators for use in real expressions

 

unary + unary

unary operators

+ - * / **

arithmetic operators

++ --

increment and decrement operators (increments or decrements by 1.0)

+= -= *= /=

arithmetic assignment operators

> >= < <=

Relational operators

! && ||

logical operators

== !=

logical equality operators

?:

conditional operators

 

The result of using logical or relational operators on real numbers shall be a single-bit scalar value.

 

Table 11-3 lists operators that shall not be used to operate on real numbers.

 

Table 11-3—Operators not allowed for real expressions

{} {{}}

concatenate, replicate operators

%

modulus operator

=== !==

case equality operators

==? !=?

wildcard equality operators

~ & | ^ ^~ ~^

bitwise operators

^ ^~ ~^ & ~& | ~|

Reduction operators

<< >> <<< >>>

shift operators

%= &= |= ^= <<= >>= <<<= >>>=

assignment operators

inside

set membership operator

dist

distribution operator

 

If any operand, except before the ? in the ternary operator, is real, the result is real. Otherwise, if any

operand, except before the ? in the ternary operator, is shortreal, the result is shortreal.

 

Real operands can also be used in the following expressions:

str.realval // structure or union member

realarray[intval] // array element

See 6.12.1 for more information on use of real numbers.

 

TO

11.3.1 Operators with real operands

 

Table 11-1 shows what operators may be applied to real operands.

The operators shown in Table 11-2 shall be legal when applied to real operands. All other operators shall be

considered illegal when used with real operands.

 

Table 11-2—Legal operators for use in real expressions

 

unary + unary

unary operators

+ - * / **

arithmetic operators

++ --

increment and decrement operators (increments or decrements by 1.0)

+= -= *= /=

arithmetic assignment operators

> >= < <=

Relational operators

! && ||

logical operators

== !=

logical equality operators

?:

conditional operators

 

The result of using logical or relational operators on real numbersoperands shall be a single-bit scalar value.

 

Table 11-3 lists operators that shall not be used to operate on real numbers.

 

Table 11-3—Operators not allowed for real expressions

{} {{}}

concatenate, replicate operators

%

modulus operator

=== !==

case equality operators

==? !=?

wildcard equality operators

~ & | ^ ^~ ~^

bitwise operators

^ ^~ ~^ & ~& | ~|

Reduction operators

<< >> <<< >>>

shift operators

%= &= |= ^= <<= >>= <<<= >>>=

assignment operators

inside

set membership operator

dist

distribution operator

 

If any operand, except before the ? in the ternary operator, is real, the result is real. Otherwise, if any

operand, except before the ? in the ternary operator, is shortreal, the result is shortreal.

 

Real operands can also be used in the following expressions:

str.realval // structure or union member

realarray[intval] // array element

See 6.12.1 for more information on use of real numbers.

 

In Section 11.4.1 Assignment operators

ADD at the end of the section

SystemVerilog also includes the procedural nonblocking assignment operator, <=. See 10.4.2.

 

In Section 11.4.2 Increment and decrement operators

ADD at the end of the section

The increment and decrement operators, when applied to real operands, increment or decrement the operand by 1.0.