13#include "mlir/CAPI/IR.h"
14#include "mlir/CAPI/Registration.h"
15#include "mlir/CAPI/Support.h"
28 return llvm::isa<StateType>(
unwrap(type));
32 return wrap(StateType::get(
unwrap(innerType)));
36 return wrap(llvm::cast<StateType>(
unwrap(type)).getType());
40 return llvm::isa<MemoryType>(
unwrap(type));
44 MlirType addressType) {
46 MemoryType::get(
unwrap(wordType).getContext(), numWords,
47 llvm::cast<mlir::IntegerType>(
unwrap(wordType)),
48 llvm::cast<mlir::IntegerType>(
unwrap(addressType))));
52 return llvm::isa<StorageType>(
unwrap(type));
60 return wrap(StorageType::get(
unwrap(ctx), size));
64 return llvm::isa<SimModelInstanceType>(
unwrap(type));
68 auto attr = llvm::cast<mlir::FlatSymbolRefAttr>(
unwrap(model));
69 return wrap(SimModelInstanceType::get(attr.getContext(), attr));
MlirType arcStateTypeGetType(MlirType type)
MlirType arcStorageTypeGetWithSize(MlirContext ctx, unsigned size)
MlirType arcStorageTypeGet(MlirContext ctx)
bool arcTypeIsAMemory(MlirType type)
bool arcTypeIsASimModelInstance(MlirType type)
bool arcTypeIsAState(MlirType type)
bool arcTypeIsAStorage(MlirType type)
MlirType arcStateTypeGet(MlirType innerType)
MlirType arcMemoryTypeGet(unsigned numWords, MlirType wordType, MlirType addressType)
MlirType arcSimModelInstanceTypeGet(MlirAttribute model)
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(CHIRRTL, chirrtl, circt::chirrtl::CHIRRTLDialect) MlirType chirrtlTypeGetCMemory(MlirContext ctx
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)