12 #include "mlir/CAPI/IR.h"
13 #include "mlir/CAPI/Registration.h"
14 #include "mlir/CAPI/Support.h"
16 using namespace circt;
34 return unwrap(type).isa<SigType>();
39 return unwrap(type).isa<PtrType>();
59 return wrap(
unwrap(type).cast<SigType>().getUnderlyingType());
64 return wrap(
unwrap(type).cast<PtrType>().getUnderlyingType());
73 return unwrap(attr).isa<TimeAttr>();
78 uint64_t seconds, uint64_t delta,
86 return wrap(
unwrap(attr).cast<TimeAttr>().getTimeUnit());
91 return unwrap(attr).cast<TimeAttr>().getTime();
96 return unwrap(attr).cast<TimeAttr>().getDelta();
101 return unwrap(attr).cast<TimeAttr>().getEpsilon();
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(CHIRRTL, chirrtl, circt::chirrtl::CHIRRTLDialect) MlirType chirrtlTypeGetCMemory(MlirContext ctx
MlirType llhdPointerTypeGetElementType(MlirType type)
Get the inner type of a pointer.
MlirType llhdTimeTypeGet(MlirContext ctx)
Create a time type.
uint64_t llhdTimeAttrGetSeconds(MlirAttribute attr)
Get the seconds component of a time attribute.
uint64_t llhdTimeAttrGetDelta(MlirAttribute attr)
Get the delta component of a time attribute.
MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute attr)
Get the time unit of a time attribute.
bool llhdTypeIsASignalType(MlirType type)
Check if a type is a signal type.
bool llhdAttrIsATimeAttr(MlirAttribute attr)
Check if an attribute is a time attribute.
bool llhdTypeIsATimeType(MlirType type)
Check if a type is a time type.
bool llhdTypeIsAPointerType(MlirType type)
Check if a type is a pointer type.
MlirType llhdSignalTypeGet(MlirType element)
Create a signal type.
MlirAttribute llhdTimeAttrGet(MlirContext ctx, MlirStringRef timeUnit, uint64_t seconds, uint64_t delta, uint64_t epsilon)
Create a time attribute.
uint64_t llhdTimeAttrGetEpsilon(MlirAttribute attr)
Get the epsilon component of a time attribute.
MlirType llhdSignalTypeGetElementType(MlirType type)
Get the inner type of a signal.
MlirType llhdPointerTypeGet(MlirType element)
Create a pointer type.
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
This file defines an intermediate representation for circuits acting as an abstraction for constraint...