CIRCT 20.0.0git
|
#include "circt-c/Dialect/HW.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWInstanceGraph.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWPasses.h"
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Support/LLVM.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Registration.h"
#include "mlir/CAPI/Support.h"
#include "llvm/ADT/PostOrderIterator.h"
Go to the source code of this file.
Functions | |
void | registerHWPasses () |
int64_t | hwGetBitWidth (MlirType type) |
Return the hardware bit width of a type. | |
bool | hwTypeIsAValueType (MlirType type) |
Return true if the specified type can be used as an HW value type, that is the set of types that can be composed together to represent synthesized, hardware but not marker types like InOutType or unknown types from other dialects. | |
bool | hwTypeIsAArrayType (MlirType type) |
If the type is an HW array. | |
MlirType | hwArrayTypeGet (MlirType element, size_t size) |
Creates a fixed-size HW array type in the context associated with element. | |
MlirType | hwArrayTypeGetElementType (MlirType type) |
returns the element type of an array type | |
intptr_t | hwArrayTypeGetSize (MlirType type) |
returns the size of an array type | |
bool | hwTypeIsAIntType (MlirType type) |
If the type is an HW int. | |
MlirType | hwParamIntTypeGet (MlirAttribute parameter) |
MlirAttribute | hwParamIntTypeGetWidthAttr (MlirType type) |
MlirType | hwInOutTypeGet (MlirType element) |
Creates an HW inout type in the context associated with element. | |
MlirType | hwInOutTypeGetElementType (MlirType type) |
Returns the element type of an inout type. | |
bool | hwTypeIsAInOut (MlirType type) |
If the type is an HW inout. | |
bool | hwTypeIsAModuleType (MlirType type) |
If the type is an HW module type. | |
MlirType | hwModuleTypeGet (MlirContext ctx, intptr_t numPorts, HWModulePort const *ports) |
Creates an HW module type. | |
intptr_t | hwModuleTypeGetNumInputs (MlirType type) |
Get an HW module type's number of inputs. | |
MlirType | hwModuleTypeGetInputType (MlirType type, intptr_t index) |
Get an HW module type's input type at a specific index. | |
MlirStringRef | hwModuleTypeGetInputName (MlirType type, intptr_t index) |
Get an HW module type's input name at a specific index. | |
intptr_t | hwModuleTypeGetNumOutputs (MlirType type) |
Get an HW module type's number of outputs. | |
MlirType | hwModuleTypeGetOutputType (MlirType type, intptr_t index) |
Get an HW module type's output type at a specific index. | |
MlirStringRef | hwModuleTypeGetOutputName (MlirType type, intptr_t index) |
Get an HW module type's output name at a specific index. | |
bool | hwTypeIsAStructType (MlirType type) |
If the type is an HW struct. | |
MlirType | hwStructTypeGet (MlirContext ctx, intptr_t numElements, HWStructFieldInfo const *elements) |
Creates an HW struct type in the context associated with the elements. | |
MlirType | hwStructTypeGetField (MlirType structType, MlirStringRef fieldName) |
MlirAttribute | hwStructTypeGetFieldIndex (MlirType structType, MlirStringRef fieldName) |
intptr_t | hwStructTypeGetNumFields (MlirType structType) |
HWStructFieldInfo | hwStructTypeGetFieldNum (MlirType structType, unsigned idx) |
bool | hwTypeIsATypeAliasType (MlirType type) |
If the type is an HW type alias. | |
MlirType | hwTypeAliasTypeGet (MlirStringRef cScope, MlirStringRef cName, MlirType cInnerType) |
MlirType | hwTypeAliasTypeGetCanonicalType (MlirType typeAlias) |
MlirType | hwTypeAliasTypeGetInnerType (MlirType typeAlias) |
MlirStringRef | hwTypeAliasTypeGetName (MlirType typeAlias) |
MlirStringRef | hwTypeAliasTypeGetScope (MlirType typeAlias) |
bool | hwAttrIsAInnerSymAttr (MlirAttribute attr) |
MlirAttribute | hwInnerSymAttrGet (MlirAttribute symName) |
MlirAttribute | hwInnerSymAttrGetEmpty (MlirContext ctx) |
MlirAttribute | hwInnerSymAttrGetSymName (MlirAttribute innerSymAttr) |
bool | hwAttrIsAInnerRefAttr (MlirAttribute attr) |
MlirAttribute | hwInnerRefAttrGet (MlirAttribute moduleName, MlirAttribute innerSym) |
MlirAttribute | hwInnerRefAttrGetName (MlirAttribute innerRefAttr) |
MlirAttribute | hwInnerRefAttrGetModule (MlirAttribute innerRefAttr) |
MLIR_CAPI_EXPORTED bool | hwAttrIsAParamDeclAttr (MlirAttribute attr) |
MLIR_CAPI_EXPORTED MlirAttribute | hwParamDeclAttrGet (MlirStringRef cName, MlirType cType, MlirAttribute cValue) |
MLIR_CAPI_EXPORTED MlirStringRef | hwParamDeclAttrGetName (MlirAttribute decl) |
MLIR_CAPI_EXPORTED MlirType | hwParamDeclAttrGetType (MlirAttribute decl) |
MLIR_CAPI_EXPORTED MlirAttribute | hwParamDeclAttrGetValue (MlirAttribute decl) |
MLIR_CAPI_EXPORTED bool | hwAttrIsAParamDeclRefAttr (MlirAttribute attr) |
MLIR_CAPI_EXPORTED MlirAttribute | hwParamDeclRefAttrGet (MlirContext ctx, MlirStringRef cName) |
MLIR_CAPI_EXPORTED MlirStringRef | hwParamDeclRefAttrGetName (MlirAttribute decl) |
MLIR_CAPI_EXPORTED MlirType | hwParamDeclRefAttrGetType (MlirAttribute decl) |
MLIR_CAPI_EXPORTED bool | hwAttrIsAParamVerbatimAttr (MlirAttribute attr) |
MLIR_CAPI_EXPORTED MlirAttribute | hwParamVerbatimAttrGet (MlirAttribute text) |
MLIR_CAPI_EXPORTED bool | hwAttrIsAOutputFileAttr (MlirAttribute attr) |
MLIR_CAPI_EXPORTED MlirAttribute | hwOutputFileGetFromFileName (MlirAttribute fileName, bool excludeFromFileList, bool includeReplicatedOp) |
MLIR_CAPI_EXPORTED HWInstanceGraph | hwInstanceGraphGet (MlirOperation operation) |
MLIR_CAPI_EXPORTED void | hwInstanceGraphDestroy (HWInstanceGraph instanceGraph) |
MLIR_CAPI_EXPORTED HWInstanceGraphNode | hwInstanceGraphGetTopLevelNode (HWInstanceGraph instanceGraph) |
MLIR_CAPI_EXPORTED void | hwInstanceGraphForEachNode (HWInstanceGraph instanceGraph, HWInstanceGraphNodeCallback callback, void *userData) |
MLIR_CAPI_EXPORTED bool | hwInstanceGraphNodeEqual (HWInstanceGraphNode lhs, HWInstanceGraphNode rhs) |
MLIR_CAPI_EXPORTED MlirModule | hwInstanceGraphNodeGetModule (HWInstanceGraphNode node) |
MLIR_CAPI_EXPORTED MlirOperation | hwInstanceGraphNodeGetModuleOp (HWInstanceGraphNode node) |
MlirType hwArrayTypeGet | ( | MlirType | element, |
size_t | size | ||
) |
MlirType hwArrayTypeGetElementType | ( | MlirType | type | ) |
intptr_t hwArrayTypeGetSize | ( | MlirType | type | ) |
bool hwAttrIsAInnerRefAttr | ( | MlirAttribute | attr | ) |
bool hwAttrIsAInnerSymAttr | ( | MlirAttribute | attr | ) |
MLIR_CAPI_EXPORTED bool hwAttrIsAOutputFileAttr | ( | MlirAttribute | attr | ) |
MLIR_CAPI_EXPORTED bool hwAttrIsAParamDeclAttr | ( | MlirAttribute | attr | ) |
MLIR_CAPI_EXPORTED bool hwAttrIsAParamDeclRefAttr | ( | MlirAttribute | attr | ) |
MLIR_CAPI_EXPORTED bool hwAttrIsAParamVerbatimAttr | ( | MlirAttribute | attr | ) |
int64_t hwGetBitWidth | ( | MlirType | type | ) |
Return the hardware bit width of a type.
Does not reflect any encoding, padding, or storage scheme, just the bit (and wire width) of a statically-size type. Reflects the number of wires needed to transmit a value of this type. Returns -1 if the type is not known or cannot be statically computed.
Definition at line 38 of file HW.cpp.
References circt::hw::getBitWidth(), and unwrap().
MlirAttribute hwInnerRefAttrGet | ( | MlirAttribute | moduleName, |
MlirAttribute | innerSym | ||
) |
MlirAttribute hwInnerRefAttrGetModule | ( | MlirAttribute | innerRefAttr | ) |
MlirAttribute hwInnerRefAttrGetName | ( | MlirAttribute | innerRefAttr | ) |
MlirAttribute hwInnerSymAttrGet | ( | MlirAttribute | symName | ) |
MlirAttribute hwInnerSymAttrGetEmpty | ( | MlirContext | ctx | ) |
MlirAttribute hwInnerSymAttrGetSymName | ( | MlirAttribute | innerSymAttr | ) |
MlirType hwInOutTypeGet | ( | MlirType | element | ) |
MlirType hwInOutTypeGetElementType | ( | MlirType | type | ) |
MLIR_CAPI_EXPORTED void hwInstanceGraphDestroy | ( | HWInstanceGraph | instanceGraph | ) |
MLIR_CAPI_EXPORTED void hwInstanceGraphForEachNode | ( | HWInstanceGraph | instanceGraph, |
HWInstanceGraphNodeCallback | callback, | ||
void * | userData | ||
) |
MLIR_CAPI_EXPORTED HWInstanceGraph hwInstanceGraphGet | ( | MlirOperation | operation | ) |
MLIR_CAPI_EXPORTED HWInstanceGraphNode hwInstanceGraphGetTopLevelNode | ( | HWInstanceGraph | instanceGraph | ) |
MLIR_CAPI_EXPORTED bool hwInstanceGraphNodeEqual | ( | HWInstanceGraphNode | lhs, |
HWInstanceGraphNode | rhs | ||
) |
MLIR_CAPI_EXPORTED MlirModule hwInstanceGraphNodeGetModule | ( | HWInstanceGraphNode | node | ) |
MLIR_CAPI_EXPORTED MlirOperation hwInstanceGraphNodeGetModuleOp | ( | HWInstanceGraphNode | node | ) |
MlirType hwModuleTypeGet | ( | MlirContext | ctx, |
intptr_t | numPorts, | ||
HWModulePort const * | ports | ||
) |
Creates an HW module type.
Definition at line 80 of file HW.cpp.
References HWModulePort::dir, HWModulePort::name, HWModulePort::type, unwrap(), and wrap().
MlirStringRef hwModuleTypeGetInputName | ( | MlirType | type, |
intptr_t | index | ||
) |
MlirType hwModuleTypeGetInputType | ( | MlirType | type, |
intptr_t | index | ||
) |
intptr_t hwModuleTypeGetNumInputs | ( | MlirType | type | ) |
intptr_t hwModuleTypeGetNumOutputs | ( | MlirType | type | ) |
MlirStringRef hwModuleTypeGetOutputName | ( | MlirType | type, |
intptr_t | index | ||
) |
MlirType hwModuleTypeGetOutputType | ( | MlirType | type, |
intptr_t | index | ||
) |
MLIR_CAPI_EXPORTED MlirAttribute hwOutputFileGetFromFileName | ( | MlirAttribute | fileName, |
bool | excludeFromFileList, | ||
bool | includeReplicatedOp | ||
) |
MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclAttrGet | ( | MlirStringRef | cName, |
MlirType | cType, | ||
MlirAttribute | cValue | ||
) |
MLIR_CAPI_EXPORTED MlirStringRef hwParamDeclAttrGetName | ( | MlirAttribute | decl | ) |
MLIR_CAPI_EXPORTED MlirType hwParamDeclAttrGetType | ( | MlirAttribute | decl | ) |
MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclAttrGetValue | ( | MlirAttribute | decl | ) |
MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclRefAttrGet | ( | MlirContext | ctx, |
MlirStringRef | cName | ||
) |
MLIR_CAPI_EXPORTED MlirStringRef hwParamDeclRefAttrGetName | ( | MlirAttribute | decl | ) |
MLIR_CAPI_EXPORTED MlirType hwParamDeclRefAttrGetType | ( | MlirAttribute | decl | ) |
MlirType hwParamIntTypeGet | ( | MlirAttribute | parameter | ) |
MlirAttribute hwParamIntTypeGetWidthAttr | ( | MlirType | type | ) |
MLIR_CAPI_EXPORTED MlirAttribute hwParamVerbatimAttrGet | ( | MlirAttribute | text | ) |
MlirType hwStructTypeGet | ( | MlirContext | ctx, |
intptr_t | numElements, | ||
HWStructFieldInfo const * | elements | ||
) |
Creates an HW struct type in the context associated with the elements.
Definition at line 136 of file HW.cpp.
References numElements, unwrap(), and wrap().
MlirType hwStructTypeGetField | ( | MlirType | structType, |
MlirStringRef | fieldName | ||
) |
MlirAttribute hwStructTypeGetFieldIndex | ( | MlirType | structType, |
MlirStringRef | fieldName | ||
) |
HWStructFieldInfo hwStructTypeGetFieldNum | ( | MlirType | structType, |
unsigned | idx | ||
) |
Definition at line 165 of file HW.cpp.
References HWStructFieldInfo::name, HWStructFieldInfo::type, unwrap(), and wrap().
intptr_t hwStructTypeGetNumFields | ( | MlirType | structType | ) |
MlirType hwTypeAliasTypeGet | ( | MlirStringRef | cScope, |
MlirStringRef | cName, | ||
MlirType | cInnerType | ||
) |
MlirType hwTypeAliasTypeGetCanonicalType | ( | MlirType | typeAlias | ) |
MlirType hwTypeAliasTypeGetInnerType | ( | MlirType | typeAlias | ) |
MlirStringRef hwTypeAliasTypeGetName | ( | MlirType | typeAlias | ) |
MlirStringRef hwTypeAliasTypeGetScope | ( | MlirType | typeAlias | ) |
bool hwTypeIsAArrayType | ( | MlirType | type | ) |
bool hwTypeIsAInOut | ( | MlirType | type | ) |
bool hwTypeIsAIntType | ( | MlirType | type | ) |
bool hwTypeIsAModuleType | ( | MlirType | type | ) |
bool hwTypeIsAStructType | ( | MlirType | type | ) |
bool hwTypeIsATypeAliasType | ( | MlirType | type | ) |
bool hwTypeIsAValueType | ( | MlirType | type | ) |
Return true if the specified type can be used as an HW value type, that is the set of types that can be composed together to represent synthesized, hardware but not marker types like InOutType or unknown types from other dialects.
Definition at line 40 of file HW.cpp.
References circt::hw::isHWValueType(), and unwrap().
void registerHWPasses | ( | void | ) |