14#include "mlir/CAPI/IR.h"
15#include "mlir/CAPI/Registration.h"
16#include "mlir/CAPI/Support.h"
24 return llvm::isa<SVAttributeAttr>(
unwrap(cAttr));
28 MlirStringRef cExpression,
30 mlir::MLIRContext *ctxt =
unwrap(cCtxt);
31 mlir::StringAttr expr;
32 if (cExpression.data !=
nullptr)
33 expr = mlir::StringAttr::get(ctxt,
unwrap(cExpression));
35 SVAttributeAttr::get(ctxt, mlir::StringAttr::get(ctxt,
unwrap(cName)),
36 expr, mlir::BoolAttr::get(ctxt, emitAsComment)));
40 return wrap(llvm::cast<SVAttributeAttr>(
unwrap(cAttr)).getName().getValue());
44 auto expr = llvm::cast<SVAttributeAttr>(
unwrap(cAttr)).getExpression();
46 return wrap(expr.getValue());
51 return llvm::cast<SVAttributeAttr>(
unwrap(attribute))
63 return wrap(llvm::cast<NetType>(
unwrap(type)).getElementType());
73 return wrap(llvm::cast<VarType>(
unwrap(type)).getElementType());
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(CHIRRTL, chirrtl, circt::chirrtl::CHIRRTLDialect) MlirType chirrtlTypeGetCMemory(MlirContext ctx
static void registerPasses()
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
MlirStringRef svSVAttributeAttrGetName(MlirAttribute cAttr)
MlirType svVarTypeGetElementType(MlirType type)
MlirType svVarTypeGet(MlirType element)
bool svSVAttributeAttrGetEmitAsComment(MlirAttribute attribute)
MlirStringRef svSVAttributeAttrGetExpression(MlirAttribute cAttr)
MlirType svNetTypeGet(MlirType element)
bool svTypeIsAVar(MlirType type)
MlirAttribute svSVAttributeAttrGet(MlirContext cCtxt, MlirStringRef cName, MlirStringRef cExpression, bool emitAsComment)
bool svTypeIsANet(MlirType type)
MlirType svNetTypeGetElementType(MlirType type)
MLIR_CAPI_EXPORTED bool svAttrIsASVAttributeAttr(MlirAttribute)