14 #ifndef CIRCT_DIALECT_HW_TYPES_H
15 #define CIRCT_DIALECT_HW_TYPES_H
21 #include "mlir/IR/BuiltinTypes.h"
22 #include "mlir/IR/Types.h"
41 ModuleType
fnToMod(Operation *op, ArrayRef<Attribute> inputNames,
42 ArrayRef<Attribute> outputNames);
43 ModuleType
fnToMod(FunctionType fn, ArrayRef<Attribute> inputNames,
44 ArrayRef<Attribute> outputNames);
62 #define GET_TYPEDEF_CLASSES
63 #include "circt/Dialect/HW/HWTypes.h.inc"
96 template <
typename...
BaseTy>
103 if (
auto alias = type.dyn_cast<TypeAliasType>())
110 template <
typename...
BaseTy>
117 template <
typename BaseTy>
119 assert(type_isa<BaseTy>(type) &&
"type must convert to requested type");
123 return type.cast<
BaseTy>();
126 return type_cast<BaseTy>(type.cast<TypeAliasType>().getInnerType());
129 template <
typename BaseTy>
131 if (!type_isa<BaseTy>(type))
134 return type_cast<BaseTy>(type);
140 template <
typename... Types>
145 mlir::TypeStorage>::Base::Base;
152 template <
typename BaseTy>
157 mlir::TypeStorage>::Base::Base;
161 static bool classof(Type other) {
return type_isa<BaseTy>(other); }
164 operator BaseTy()
const {
return type_cast<BaseTy>(*
this); }
assert(baseType &&"element must be base type")
This stores lookup tables to make manipulating and working with the IR more efficient.
static bool classof(Type other)
Utility type that wraps a type that may be one of several possible Types.
static bool classof(Type other)
ModuleType fnToMod(Operation *op, ArrayRef< Attribute > inputNames, ArrayRef< Attribute > outputNames)
BaseTy type_cast(Type type)
bool isHWIntegerType(mlir::Type type)
Return true if the specified type is a value HW Integer type.
bool type_isa_and_nonnull(Type type)
BaseTy type_dyn_cast(Type type)
bool isHWValueType(mlir::Type type)
Return true if the specified type can be used as an HW value type, that is the set of types that can ...
int64_t getBitWidth(mlir::Type type)
Return the hardware bit width of a type.
bool isHWEnumType(mlir::Type type)
Return true if the specified type is a HW Enum type.
mlir::Type getCanonicalType(mlir::Type type)
bool hasHWInOutType(mlir::Type type)
Return true if the specified type contains known marker types like InOutType.
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Struct defining a field. Used in structs.
Struct defining a field with an offset. Used in unions.