13#ifndef CIRCT_DIALECT_MOORE_MOORETYPES_H
14#define CIRCT_DIALECT_MOORE_MOORETYPES_H
17#include "mlir/IR/Attributes.h"
18#include "mlir/IR/BuiltinAttributes.h"
19#include "mlir/IR/Location.h"
20#include "mlir/IR/Types.h"
21#include "mlir/Interfaces/MemorySlotInterfaces.h"
34class OpenUnpackedArrayType;
44class UnpackedArrayType;
45class UnpackedStructType;
46class UnpackedUnionType;
71bool isIntType(Type type,
unsigned width, Domain domain);
106 return llvm::isa<
PackedType, StringType, ChandleType, EventType, RealType,
107 UnpackedArrayType, OpenUnpackedArrayType, AssocArrayType,
108 QueueType, UnpackedStructType, UnpackedUnionType, RefType,
109 NetType, ClassHandleType>(type);
123 static Type
parse(mlir::AsmParser &odsParser);
124 void print(mlir::AsmPrinter &odsPrinter)
const;
158 return llvm::isa<VoidType, IntType, ArrayType, OpenArrayType, StructType,
159 UnionType, TimeType>(type);
179 using UnpackedType::UnpackedType;
188 static bool classof(Type type) {
return llvm::isa<RefType, NetType>(type); }
197 using UnpackedType::UnpackedType;
218 return llvm::hash_combine(x.
name, x.
type);
225#define GET_TYPEDEF_CLASSES
226#include "circt/Dialect/Moore/MooreTypes.h.inc"
A packed SystemVerilog type.
bool containsTimeType() const
Check if this is a TimeType, or an aggregate that contains a nested TimeType.
std::optional< unsigned > getBitSize() const
Get the size of this type in bits.
Domain getDomain() const
Get the value domain of this type.
static bool classof(Type type)
IntType getSimpleBitVector() const
Get the simple bit vector type equivalent to this packed type.
An unpacked SystemVerilog type.
std::optional< unsigned > getBitSize() const
Get the size of this type in bits.
Domain getDomain() const
Get the value domain of this type.
static bool classof(Type type)
static Type parse(mlir::AsmParser &odsParser)
void print(mlir::AsmPrinter &odsPrinter) const
static bool classof(Type type)
UnpackedType getNestedType() const
Get the wrapped type.
WrapperType withNestedType(UnpackedType nestedType) const
Get a wrapper of the same kind around a different nested type.
llvm::hash_code hash_value(const StructLikeMember &x)
bool isRealType(Type type, unsigned width)
Check if a type is a RealType type of the given width.
Domain
The number of values each bit of a type can assume.
@ FourValued
Four-valued types such as logic or integer.
@ TwoValued
Two-valued types such as bit or int.
bool isIntType(Type type, unsigned width)
Check if a type is an IntType type of the given width.
RealWidth
The type of floating point / real number behind a RealType.
@ f32
A standard 32-Bit floating point number ("float").
@ f64
A 64-bit double-precision floation point number ("double").
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
UnpackedType type
The type of this member.
StringAttr name
The name of this member.
bool operator==(const StructLikeMember &other) const