CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::moore::PackedType Class Reference

A packed SystemVerilog type. More...

#include <MooreTypes.h>

Inheritance diagram for circt::moore::PackedType:
Collaboration diagram for circt::moore::PackedType:

Public Member Functions

Domain getDomain () const
 Get the value domain of this type.
std::optional< unsigned > getBitSize () const
 Get the size of this type in bits.
IntType getSimpleBitVector () const
 Get the simple bit vector type equivalent to this packed type.
bool containsTimeType () const
 Check if this is a TimeType, or an aggregate that contains a nested TimeType.
Public Member Functions inherited from circt::moore::UnpackedType
Domain getDomain () const
 Get the value domain of this type.
std::optional< unsigned > getBitSize () const
 Get the size of this type in bits.
void print (mlir::AsmPrinter &odsPrinter) const

Static Public Member Functions

static bool classof (Type type)
Static Public Member Functions inherited from circt::moore::UnpackedType
static bool classof (Type type)
static Type parse (mlir::AsmParser &odsParser)

Detailed Description

A packed SystemVerilog type.

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])

Note that every packed type is also a valid unpacked type. But unpacked types are not valid packed types.

Definition at line 155 of file MooreTypes.h.

Member Function Documentation

◆ classof()

bool circt::moore::PackedType::classof ( Type type)
inlinestatic

Definition at line 157 of file MooreTypes.h.

◆ containsTimeType()

bool PackedType::containsTimeType ( ) const

Check if this is a TimeType, or an aggregate that contains a nested TimeType.

Definition at line 199 of file MooreTypes.cpp.

Referenced by materializeSBVToPackedConversion().

◆ getBitSize()

std::optional< unsigned > PackedType::getBitSize ( ) const

Get the size of this type in bits.

Returns None if any of the type's dimensions is unsized.

Definition at line 155 of file MooreTypes.cpp.

Referenced by getSimpleBitVector().

◆ getDomain()

Domain PackedType::getDomain ( ) const

Get the value domain of this type.

Definition at line 140 of file MooreTypes.cpp.

References circt::moore::FourValued, and circt::moore::TwoValued.

Referenced by getSimpleBitVector().

◆ getSimpleBitVector()

IntType PackedType::getSimpleBitVector ( ) const

Get the simple bit vector type equivalent to this packed type.

Returns null if the type does not have a known bit size.

Definition at line 191 of file MooreTypes.cpp.

References getBitSize(), and getDomain().

Referenced by materializeSBVToPackedConversion().


The documentation for this class was generated from the following files: