parameter
type type bus_t
= $typeof(A_bus);
The $bits system function returns logic
X 0 when called with a dynamically
sized type that is currently empty. It is an error to use the $bits system function directly with a dynamically sized type
identifier.
SystemVerilog provides
system functions to return information about a particular dimension of an array
variable or type. The return type is integer, and the default for the
optional dimension expression is 1. The array dimension can specify any fixed
sized index (packed or unpacked), or any dynamically sized index (dynamic,
associative, or queue).
If an out-of-range
dimension is specified, these functions shall return a logic X ’x.
When used on a
dynamic array or queue dimension, these functions return information about the
current state of the array. If the dimension is currently empty, these
functions shall return a
logic X ’x. It is an error to use these functions
directly on a dynamically sized type identifier.
— $isunknown returns
true if any bit of the expression is X or Z. This is equivalent to ^expression
=== ’bx.
$readmemb and $readmemh are extended to packed data of 2-state type, such as int or enumerated types. For 2-state integer types, reading
proceeds the same as for conventional Verilog reg types (e.g. integer), with
the exception that X or Z data is converted to 0. For enumerated types, the
file data represents the ordinal value of the enumerated type. (Cross-reference LRM section See Section 3.10) If an enumeration ordinal is out of
range for a given type, then an error shall be issued and no further reading
shall take place.