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::cast<StateType>(
unwrap(type)).getBitWidth();
44 return llvm::cast<StateType>(
unwrap(type)).getByteWidth();
48 return llvm::isa<MemoryType>(
unwrap(type));
52 MlirType addressType) {
54 MemoryType::get(
unwrap(wordType).getContext(), numWords,
55 llvm::cast<mlir::IntegerType>(
unwrap(wordType)),
56 llvm::cast<mlir::IntegerType>(
unwrap(addressType))));
60 return llvm::cast<MemoryType>(
unwrap(type)).getNumWords();
64 return wrap(llvm::cast<MemoryType>(
unwrap(type)).getWordType());
68 return wrap(llvm::cast<MemoryType>(
unwrap(type)).getAddressType());
72 return llvm::cast<MemoryType>(
unwrap(type)).getStride();
76 return llvm::isa<StorageType>(
unwrap(type));
84 return wrap(StorageType::get(
unwrap(ctx), size));
88 return llvm::cast<StorageType>(
unwrap(type)).getSize();
92 return llvm::isa<SimModelInstanceType>(
unwrap(type));
96 auto attr = llvm::cast<mlir::FlatSymbolRefAttr>(
unwrap(model));
97 return wrap(SimModelInstanceType::get(attr.getContext(), attr));
101 return wrap(llvm::cast<SimModelInstanceType>(
unwrap(type)).getModel());
MlirAttribute arcSimModelInstanceTypeGetModel(MlirType type)
unsigned arcStateTypeGetByteWidth(MlirType type)
MlirType arcStateTypeGetType(MlirType type)
unsigned arcStorageTypeGetSize(MlirType type)
MlirType arcMemoryTypeGetAddressType(MlirType type)
unsigned arcMemoryTypeGetNumWords(MlirType type)
MlirType arcMemoryTypeGetWordType(MlirType type)
MlirType arcStorageTypeGetWithSize(MlirContext ctx, unsigned size)
MlirType arcStorageTypeGet(MlirContext ctx)
unsigned arcStateTypeGetBitWidth(MlirType type)
bool arcTypeIsAMemory(MlirType type)
bool arcTypeIsASimModelInstance(MlirType type)
unsigned arcMemoryTypeGetStride(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)