User guide

22-8
SystemVerilog Design Constructs
endmodule
Results from the VCS simulation are as follows:
Type Colors:
name value total previous next last first
red 0 4 3 1 3 0
green 1 4 0 2 3 0
blue 2 4 1 3 3 0
yellow 3 4 2 0 3 0
The $typeof System Function
The $typeof SystemVerilog system function returns the data type
of its argument, and its argument can be either of the following:
A primary expression. In this case a primary expression is a net
or variable, bit or part select of a net or variable, or a member of
a structure or union.
A data type
The expression cannot be a cross module reference such as a
hierarchal name of a signal outside of the module definition or an
element in a dynamic array.
The actual returned value is not accessible to you. You can’t display
the value. You use the returned value when comparing the data types
of various signals.
The following are some examples of the use of this system function: