13 #ifndef CIRCT_DIALECT_SYSTEMC_SYSTEMCTYPES_H
14 #define CIRCT_DIALECT_SYSTEMC_SYSTEMCTYPES_H
17 #include "mlir/IR/Attributes.h"
18 #include "mlir/IR/Types.h"
31 class BitVectorBaseType;
33 class LogicVectorBaseType;
34 class LogicVectorType;
70 bool isSigned() {
return mlir::isa<SignedType, IntBaseType>(*
this); }
82 :
public Type::TypeBase<IntBaseType, ValueBaseType, DefaultTypeStorage> {
85 return type.getTypeID() ==
getTypeID() || llvm::isa<IntType>(type);
88 static constexpr StringLiteral
getMnemonic() {
return "int_base"; }
90 static constexpr StringLiteral
name =
"systemc.int_base";
101 class IntType :
public Type::TypeBase<IntType, IntBaseType,
102 systemc::detail::IntegerWidthStorage> {
108 static constexpr StringLiteral
name =
"systemc.int";
120 :
public Type::TypeBase<UIntBaseType, ValueBaseType, DefaultTypeStorage> {
123 return type.getTypeID() ==
getTypeID() || llvm::isa<UIntType>(type);
127 static constexpr StringLiteral
getMnemonic() {
return "uint_base"; }
129 static constexpr StringLiteral
name =
"systemc.uint_base";
140 class UIntType :
public Type::TypeBase<UIntType, UIntBaseType,
141 systemc::detail::IntegerWidthStorage> {
148 static constexpr StringLiteral
name =
"systemc.uint";
160 :
public Type::TypeBase<SignedType, ValueBaseType, DefaultTypeStorage> {
163 return type.getTypeID() ==
getTypeID() || llvm::isa<BigIntType>(type);
169 static constexpr StringLiteral
name =
"systemc.signed";
180 class BigIntType :
public Type::TypeBase<BigIntType, SignedType,
181 systemc::detail::IntegerWidthStorage> {
187 static constexpr StringLiteral
name =
"systemc.bigint";
199 :
public Type::TypeBase<UnsignedType, ValueBaseType, DefaultTypeStorage> {
202 return type.getTypeID() ==
getTypeID() || llvm::isa<BigUIntType>(type);
206 static constexpr StringLiteral
getMnemonic() {
return "unsigned"; }
208 static constexpr StringLiteral
name =
"systemc.unsigned";
220 :
public Type::TypeBase<BigUIntType, UnsignedType,
221 systemc::detail::IntegerWidthStorage> {
226 static constexpr StringLiteral
getMnemonic() {
return "biguint"; }
228 static constexpr StringLiteral
name =
"systemc.biguint";
243 :
public Type::TypeBase<BitVectorBaseType, Type, DefaultTypeStorage> {
246 return type.getTypeID() ==
getTypeID() || llvm::isa<BitVectorType>(type);
249 static constexpr StringLiteral
getMnemonic() {
return "bv_base"; }
251 static constexpr StringLiteral
name =
"systemc.bv_base";
263 :
public Type::TypeBase<BitVectorType, BitVectorBaseType,
264 systemc::detail::IntegerWidthStorage> {
271 static constexpr StringLiteral
name =
"systemc.bv";
282 :
public Type::TypeBase<LogicVectorBaseType, Type, DefaultTypeStorage> {
285 return type.getTypeID() ==
getTypeID() || llvm::isa<LogicVectorType>(type);
288 static constexpr StringLiteral
getMnemonic() {
return "lv_base"; }
290 static constexpr StringLiteral
name =
"systemc.lv_base";
303 :
public Type::TypeBase<LogicVectorType, LogicVectorBaseType,
304 systemc::detail::IntegerWidthStorage> {
311 static constexpr StringLiteral
name =
"systemc.lv";
321 #define GET_TYPEDEF_CLASSES
322 #include "circt/Dialect/SystemC/SystemCTypes.h.inc"
Represents a finite word-length signed integer in SystemC as described in IEEE 1666-2011 §7....
static constexpr StringLiteral name
static BigIntType get(MLIRContext *context, unsigned width)
static constexpr StringLiteral getMnemonic()
Represents a finite word-length unsigned integer in SystemC as described in IEEE 1666-2011 §7....
static constexpr StringLiteral getMnemonic()
static BigUIntType get(MLIRContext *context, unsigned width)
static constexpr StringLiteral name
Represents a finite word-length bit vector in SystemC as described in IEEE 1666-2011 §7....
static constexpr StringLiteral getMnemonic()
static BitVectorBaseType get(MLIRContext *context)
static constexpr StringLiteral name
static bool classof(Type type)
Represents a finite word-length bit vector in SystemC as described in IEEE 1666-2011 §7....
static constexpr StringLiteral name
static constexpr StringLiteral getMnemonic()
static BitVectorType get(MLIRContext *context, unsigned width)
Represents a limited word-length signed integer in SystemC as described in IEEE 1666-2011 §7....
static constexpr StringLiteral name
static bool classof(Type type)
static constexpr StringLiteral getMnemonic()
static IntBaseType get(MLIRContext *context)
Represents a limited word-length signed integer in SystemC as described in IEEE 1666-2011 §7....
static constexpr StringLiteral getMnemonic()
static IntType get(MLIRContext *context, unsigned width)
static constexpr StringLiteral name
Represents a finite word-length bit vector in SystemC as described in IEEE 1666-2011 §7....
static LogicVectorBaseType get(MLIRContext *context)
static bool classof(Type type)
static constexpr StringLiteral getMnemonic()
static constexpr StringLiteral name
Represents a finite word-length bit vector (of four-state values) in SystemC as described in IEEE 166...
static LogicVectorType get(MLIRContext *context, unsigned width)
static constexpr StringLiteral getMnemonic()
static constexpr StringLiteral name
Represents a finite word-length signed integer in SystemC as described in IEEE 1666-2011 §7....
static SignedType get(MLIRContext *context)
static constexpr StringLiteral getMnemonic()
static constexpr StringLiteral name
static bool classof(Type type)
Represents a limited word-length unsigned integer in SystemC as described in IEEE 1666-2011 §7....
static UIntBaseType get(MLIRContext *context)
static bool classof(Type type)
static constexpr StringLiteral getMnemonic()
static constexpr StringLiteral name
Represents a limited word-length unsigned integer in SystemC as described in IEEE 1666-2011 §7....
static UIntType get(MLIRContext *context, unsigned width)
static constexpr StringLiteral getMnemonic()
static constexpr StringLiteral name
Represents a finite word-length unsigned integer in SystemC as described in IEEE 1666-2011 §7....
static bool classof(Type type)
static constexpr StringLiteral getMnemonic()
static constexpr StringLiteral name
static UnsignedType get(MLIRContext *context)
This provides a common base class for all SystemC integers.
static bool classof(Type type)
StringAttr getTypeID(Type t)
Type getSignalBaseType(Type type)
Get the type wrapped by a signal or port (in, inout, out) type.
std::optional< size_t > getBitWidth(Type type)
Return the bitwidth of a type.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Integer Type Storage and Uniquing.
A struct containing minimal information for a systemc module port.