Module moore_svlog::ty [−][src]
Expand description
A generalized SystemVerilog type system.
This module covers all types that may arise in a SystemVerilog source file, plus some additional things like modules/interfaces to streamline the handling of hierarchical names and interface signals/modports throughout the compiler.
Packed Types
Packed types are the core types of SystemVerilog. They combine a core packed type with an optional sign and zero or more packed dimensions. The core packed types are:
- Integer vector types:
bit
,logic
,reg
- Integer atom types:
byte
,shortint
,int
,longint
,integer
,time
- Packed structs and unions
- Enums
- Packed named types
- Packed type references
The packed dimensions can be:
- Unsized (
[]
) - Ranges (
[x:y]
)
Packed types are implemented by the PackedType
struct.
Unpacked Types
Unpacked types are a second level of types in SystemVerilog. They extend a core unpacked type with a variety of unpacked dimensions, depending on which syntactic construct generated the type (variable or otherwise). The core unpacked types are:
- Packed types
- Non-integer types:
shortreal
,real
,realtime
- Unpacked structs and unions
string
,chandle
,event
- Virtual interfaces
- Class types
- Covergroups
- Unpacked named types
- Unpacked type references
- Modules and interfaces
The unpacked dimensions are:
- Unsized (
[]
) - Arrays (
[x]
) - Ranges (
[x:y]
) - Associative (
[T]
or[*]
) - Queues (
[$]
or[$:x]
)
Unpacked types are implemented by the UnpackedType
struct.
Simple Bit Vector Types
Some packed types may be converted into an equivalent Simple Bit Vector Type (SBVT), which has an identical bit pattern as the original type, but consists only of an integer vector type with a single optional packed dimension. An SBVT can be converted back into a packed type. SBVTs can be range-cast, which changes the width of their single dimension.
SBVTs track whether the original packed type explicitly had a dimension or used an integer atom type, or was named. When converting back to a packed type, the SBVT attempts to restore this information, depending on how many changes were applied.
Sign
All packed types have an associated sign, indicating whether they are signed or unsigned. The types have a default sign, which means that the sign may have been omitted in the source file. Packed types can be sign-cast, which changes only their sign.
Domain
All packed types consist of bits that can either carry two or four values. An aggregate type is two-valued iff all its constituent types are two-valued, otherwise it is four-valued. Packed types can be domain-cast, which changes only their value domain.
Structs
An enum type.
An interface instance.
A module instance.
A packed type.
The [a:b]
part in a vector/array type such as logic [a:b]
.
A simple bit vector type.
A member of a struct type.
A struct type.
An arena that can internalize type data.
An unpacked type.
Enums
A packed or unpacked dimension.
The number of values each bit of a type can assume.
An integer atom type.
An integer vector type.
A core packed type.
A packed dimension.
Which side is greater in a range [a:b]
.
A real type.
Whether a type is signed or unsigned.
A core unpacked type.
An unpacked dimension.
Traits
An object that has type storage.
A container for type operations.