What is the use of the type operator in SystemVerilog?
What is the use of the type operator in SystemVerilog?
Model answer
The type operator returns the type of an expression or data type. It lets code refer to a type without naming it explicitly. The expression is not evaluated; only its type is used. Declaring a variable with the same type as another variable or expression. Giving a default value to a type parameter. Comparing types at elaboration time, for example to select generate code based on a type parameter. It is different from typedef , which creates a new named type.