Basic Data Types

In SystemVerilog, variables serve as containers to store data, which can be of different data types. The type of data that a variable can hold is determined by its data type. SystemVerilog supports various data types, each with its unique properties and usage.

Let's explore some of the basic ones.

Below is a high level summary of the basic data types in SystemVerilog and Verilog.

All Verilog data types are supported in SystemVerilog.

Language

Category

Data Type

Description

Verilog

Net

wire

Connects different elements.

Verilog

Variable

reg

Data storage element, can hold a value.

Verilog

Variable

integer

32-bit 2-state integer.

Verilog

Variable

time

Used to represent simulation time.

Verilog

Variable

real

Double-precision floating-point number.

Verilog

Variable

realtime

Time data type in floating-point format.

Verilog

Variable

event

Used for synchronization between processes.

SystemVerilog

Integral

bit

2-state (0 or 1).

SystemVerilog

Integral

logic

4-state (0, 1, X, Z), can be used as both reg and wire.

SystemVerilog

Integral

byte

8-bit 2-state signed integer.

SystemVerilog

Integral

int

32-bit 2-state signed integer.

SystemVerilog

String

string

Dynamic-sized string, automatically resized.

Data Types

  • Reg

  • Int

  • Time

  • Logic

  • Real

  • Realtime


In this tutorial, we've covered some of the basic data types in SystemVerilog. In the next tutorial, we'll delve into operators and expressions in SystemVerilog. As always, remember that this is a simple introduction and real-world designs can be significantly more complex.

Have a Question?

Feel free to ask your question in the comments below.

Please Login to ask a question.

Login Now