Section 1.5, 6.10, 11.3.3, 24.2, 24.3, A.2.2.1, A.2.4, Syntax 4-1,
Syntax 19-4, Syntax 22-1
Type references
In A.2.2.1 and Syntax 4-1,
ADD
type_reference
::=
type
( expression28
)
|
type
(
data_type
)
The expression that is used as the argument to the
$typeof system function shall contain no hierarchical references.
WITH
The An expression that is used as the argument to the $typeof system function in a type_reference shall
contain no hierarchical references shall
not contain any hierarchical references or references to elements of dynamic
objects.
In A.2.2.1 and Syntax 4-1, in
data_type, ADD
|
type_reference
type_assignment
::=
type_identifier
=
data_type
|
type_identifier = $typeof
( expression28
)
|
type_identifier = $typeof
( data_type
)
WITH
type_assignment
::=
type_identifier
=
data_type
|
type_identifier = $typeof ( expression28
)
|
type_identifier = $typeof ( data_type
)
and ADD the following
footnote,
It
shall be legal to use a type_reference constant_primary as the casting_type in a
static cast. It shall be illegal for a type_reference constant_primary to be
used with any operators except the equality/inequality and case
equality/inequality operators.
In 1.5, REPLACE
Clause
24—System Tasks and System Functions: This
clause describes several extensions to Verilog system tasks and system
functions, including a $typeof function, $typename function, $bits size
function, range function, array querying functions, assertion control tasks,
random number functions, program control tasks, coverage functions, and
enhancements to Verilog system tasks and system functions.
WITH
Clause
24—System Tasks and System Functions: This
clause describes several extensions to Verilog system tasks and system
functions, including a $typeof function,
$typename function, $bits size function, range function, array querying
functions, assertion control tasks, random number functions, program control
tasks, coverage functions, and enhancements to Verilog system tasks and system
functions.
In 6.10, ADD
The
type
operator
provides a way to refer to the data type of an expression. A type reference can be used like a type
name or local type parameter, for example, in casts, data object declarations,
and type parameter assignments and overrides. It can also be used in
equality/inequality and case equality/inequality comparisons with other type
references, and such comparisons are considered to be constant expressions. When a type reference is used in a net
declaration, it shall be preceded by a net type keyword, and when it is used in
a variable declaration, it shall be preceded by the var
keyword.
var
type(a+b)
c, d;
c = type(i+3)'(v[15:0]);
The
type
operator applied to an expression shall represent the self-determined result
type of that expression. The expression shall not be evaluated and shall not
contain any hierarchical references or references to elements of dynamic
objects.
The
type
operator can also be applied to a data type.
localparam
type
T = type(bit[12:0]);
When
a type reference is used in an equality/inequality or case equality/inequality
comparison, it shall only be compared with another type reference. Two type references shall be considered
equal in such comparisons if and only if the types they refer to match (see
6.9.1).
bit
[12:0]
A_bus, B_bus;
parameter
type bus_t
= type(A_bus);
generate
case
(type(bus_t))
type(bit[12:0]):
addfixed_int #(bus_t) (A_bus,B_bus);
type(real):
add_float #($typeof(A_bus)) (A_bus,B_bus);
endcase
endgenerate
In 11.3.3,
REPLACE
A
constant function may call any system function that may be called in a constant
expression. This includes $bits,
the array query functions and $typeof.
WITH
A
constant function may call any system function that may be called in a constant
expression. This includes $bits
and,
the array query functions and
$typeof.
In 24.3, REPLACE
This
process is similar to the way that type equality is computed, except that array
ranges and built-in equivalent types are not normalized in the generated string.
Thus $typename
can
be used in string comparisons for stricter type-checking of arrays than
$typeof.
WITH
This
process is similar to the way that type equality matching (see
6.9.1) is computed, except that array ranges
and built-in equivalent types are not normalized simple bit vectors types with predefined widths are
distinguished from those with user-defined widths in the generated string. Thus $typename
can
be used in string comparisons for stricter type-checking type
comparison of arrays than with type
references $typeof.
In 24.3, REPLACE
the
expression shall not contain any hierarchical identifiers or references to
elements of dynamic objects
WITH
the
expression shall not contain any hierarchical identifiers
references or references to elements of dynamic
objects
In Syntax 19-4, update footnote 32 to
be consistent with A.10.32 – specifically, REPLACE
When
a net_port_type contains a data_type, it shall only be legal to omit the
explicit net_type_or_implicit when declaring an inout
port.
WITH
When
a net_port_type contains a data_type, it shall only be legal to omit the
explicit net_type net_type_or_implicit when declaring an inout
port.