Systemverilog Datstypes
Systemverilog Datstypes
TYPES:
What is data type?
The declarations for wire and reg signals are inside a module but outside any
initial or always block.
BEHAVIORAL DATA TYPES
INTEGER, REAL, AND TIME
An integer declares one or more variables of type integer. These variables can hold values ranging from -
2^31 to (2^31)-1.
Integer Syntax:
integer integer_variable_name;
A real declaration declares one or more variables of type real. The real variables are stored as 64-bit
quantities, and store the real values. Real numbers can be specified in either decimal notation (for example,
14.72) or in scientific notation (for example, 39e8).
Time is a 64-bit quantity that can be used in conjunction with the $time system task to hold simulation time.
Time is not supported for synthesis and hence is used only for simulation purposes.
Syntax
time time_variable_name;
LOGIC
parameter size = 16 ;
VOID
DATA
TYPE:
▶ void is used in functions to return no value.
▶ Void data type represents non-existent data.
▶ This type can be specified as the return type of function, including no return
value.
Syntax:
Literals are the constant values assigned to the constant variables. We can say that
the literals represent the fixed values that cannot be modified. It also contains
memory but does not have references as variables. For example, const int =10; is a
constant integer expression in which 10 is an integer literal.
Types of literals
•Integer literal
•Float literal
•Character literal
•String literal