16 #ifndef CIRCT_C_DIALECT_FIRRTL_H
17 #define CIRCT_C_DIALECT_FIRRTL_H
19 #include "mlir-c/IR.h"
165 MlirType element,
size_t count);
192 MLIR_CAPI_EXPORTED
bool
197 MLIR_CAPI_EXPORTED
unsigned
204 MLIR_CAPI_EXPORTED MlirType
firrtlTypeGetRef(MlirType target,
bool forceable);
253 MLIR_CAPI_EXPORTED MlirType
266 MLIR_CAPI_EXPORTED MlirAttribute
278 MlirAttribute value);
291 MlirIdentifier filename,
300 MLIR_CAPI_EXPORTED MlirAttribute
308 MlirType type,
unsigned numBits, MlirStringRef str, uint8_t radix);
332 MLIR_CAPI_EXPORTED
bool
334 MlirStringRef annotationsStr,
335 MlirAttribute *importedAnnotationsArray);
struct FIRRTLBundleField FIRRTLBundleField
Describes a field in a bundle type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetSInt(MlirContext ctx, int32_t width)
Creates a signed integer type with the specified width.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAUInt(MlirType type)
Checks if this type is a unsigned integer type.
MLIR_CAPI_EXPORTED bool firrtlTypeIsABoolean(MlirType type)
Checks if this type is a property boolean type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger(MlirContext ctx)
Creates a property integer type.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs(MlirContext ctx, size_t count, const FIRRTLDirection *dirs)
Creates a DenseBoolArrayAttr with the specified port directions.
MLIR_CAPI_EXPORTED bool firrtlTypeIsConst(MlirType type)
Returns true if this is a const type whose value is guaranteed to be unchanging at circuit execution ...
MLIR_CAPI_EXPORTED bool firrtlTypeIsAInteger(MlirType type)
Checks if this type is a property integer type.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetEventControl(MlirContext ctx, FIRRTLEventControl eventControl)
Creates a EventControlAttr with the specified value.
MLIR_CAPI_EXPORTED bool firrtlTypeIsABundle(MlirType type)
Returns true if the specified type is a bundle type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnalog(MlirContext ctx, int32_t width)
Creates an analog type with the specified width.
struct FIRRTLClassElement FIRRTLClassElement
Describes an element in a class type.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAString(MlirType type)
Checks if this type is a property string type.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAList(MlirType type)
Checks if this type is a property list type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetReset(MlirContext ctx)
Creates a reset type.
FIRRTLValueFlow
Flow of value.
@ FIRRTL_VALUE_FLOW_SOURCE
@ FIRRTL_VALUE_FLOW_DUPLEX
MLIR_CAPI_EXPORTED bool firrtlTypeIsAPath(MlirType type)
Checks if this type is a property path type.
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(FIRRTL, firrtl)
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath(MlirContext ctx)
Creates a property path type.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef(MlirType type)
Checks if this type is an anyref type.
FIRRTLNameKind
Name preservation.
@ FIRRTL_NAME_KIND_DROPPABLE_NAME
@ FIRRTL_NAME_KIND_INTERESTING_NAME
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAsyncReset(MlirType type)
Checks if this type is an async reset type.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAVector(MlirType type)
Checks if this type is a vector type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetConstType(MlirType type, bool isConst)
Returns a const or non-const version of this type.
FIRRTLMemDir
Memory port direction.
@ FIRRTL_MEM_DIR_READ_WRITE
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetConvention(MlirContext ctx, FIRRTLConvention convention)
Creates an ConventionAttr with the specified value.
MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble(MlirType type)
Checks if this type is a property double type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetRef(MlirType target, bool forceable)
Creates a ref type.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetNameKind(MlirContext ctx, FIRRTLNameKind nameKind)
Creates a NameKindEnumAttr with the specified name preservation semantic.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetUInt(MlirContext ctx, int32_t width)
Creates a unsigned integer type with the specified width.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAOpenBundle(MlirType type)
Returns true if the specified type is an open bundle type.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetRUW(MlirContext ctx, FIRRTLRUW ruw)
Creates a RUWAttr with the specified Read-Under-Write Behaviour.
MLIR_CAPI_EXPORTED size_t firrtlTypeGetVectorNumElements(MlirType vec)
Returns the number of elements in a vector type.
MLIR_CAPI_EXPORTED unsigned firrtlTypeGetBundleFieldIndex(MlirType type, MlirStringRef fieldName)
Returns the index of the field with the specified name in the bundle type.
MLIR_CAPI_EXPORTED size_t firrtlTypeGetBundleNumFields(MlirType bundle)
Returns the number of fields in the bundle type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetString(MlirContext ctx)
Creates a property string type.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemInit(MlirContext ctx, MlirIdentifier filename, bool isBinary, bool isInline)
Creates a MemoryInitAttr with the specified memory initialization information.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnalog(MlirType type)
Checks if this type is an analog type.
FIRRTLEventControl
Edge control trigger.
@ FIRRTL_EVENT_CONTROL_AT_POS_EDGE
@ FIRRTL_EVENT_CONTROL_AT_NEG_EDGE
@ FIRRTL_EVENT_CONTROL_AT_EDGE
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemDir(MlirContext ctx, FIRRTLMemDir dir)
Creates a MemDirAttr with the specified memory port direction.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetParamDecl(MlirContext ctx, MlirIdentifier name, MlirType type, MlirAttribute value)
Creates a ParamDeclAttr with the specified name, type, and value.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList(MlirContext ctx, MlirType elementType)
Creates a property list type with the specified element type.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAReset(MlirType type)
Checks if this type is a reset type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVectorElement(MlirType vec)
Returns the element type of a vector type.
MLIR_CAPI_EXPORTED int64_t firrtlTypeGetBitWidth(MlirType type, bool ignoreFlip)
Gets the bit width for this type, returns -1 if unknown.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVector(MlirContext ctx, MlirType element, size_t count)
Creates a vector type with the specified element type and count.
MLIR_CAPI_EXPORTED bool firrtlTypeGetBundleFieldByIndex(MlirType type, size_t index, FIRRTLBundleField *field)
Returns the field at the specified index in the bundle type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBundle(MlirContext ctx, size_t count, const FIRRTLBundleField *fields)
Creates a bundle type with the specified fields.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAsyncReset(MlirContext ctx)
Creates an async reset type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetDouble(MlirContext ctx)
Creates a property double type.
FIRRTLDirection
Port direction.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetMaskType(MlirType type)
Returns this type with all ground types replaced with UInt<1>.
MLIR_CAPI_EXPORTED bool firrtlImportAnnotationsFromJSONRaw(MlirContext ctx, MlirStringRef annotationsStr, MlirAttribute *importedAnnotationsArray)
Deserializes a JSON value into FIRRTL Annotations.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass(MlirType type)
Checks if this type is a class type.
MLIR_CAPI_EXPORTED FIRRTLValueFlow firrtlValueFoldFlow(MlirValue value, FIRRTLValueFlow flow)
Computes the flow for a Value, value, as determined by the FIRRTL specification.
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClock(MlirType type)
Checks if this type is a clock type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClock(MlirContext ctx)
Creates a clock type.
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetIntegerFromString(MlirType type, unsigned numBits, MlirStringRef str, uint8_t radix)
Creates an IntegerAttr from a string representation of integer.
MLIR_CAPI_EXPORTED bool firrtlTypeIsARef(MlirType type)
Checks if this type is a ref type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnyRef(MlirContext ctx)
Creates an anyref type.
FIRRTLRUW
Read-Under-Write behaviour.
MLIR_CAPI_EXPORTED bool firrtlTypeIsASInt(MlirType type)
Checks if this type is a signed integer type.
FIRRTLConvention
Module instantiation conventions.
@ FIRRTL_CONVENTION_SCALARIZED
@ FIRRTL_CONVENTION_INTERNAL
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBoolean(MlirContext ctx)
Creates a property boolean type.
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClass(MlirContext ctx, MlirAttribute name, size_t numberOfElements, const FIRRTLClassElement *elements)
Creates a class type with the specified name and elements.
bool isConst(Type type)
Returns true if this is a 'const' type whose value is guaranteed to be unchanging at circuit executio...
Describes a field in a bundle type.
Describes an element in a class type.
FIRRTLDirection direction