CIRCT  20.0.0git
Classes | Typedefs | Enumerations | Functions
FIRRTL.h File Reference
#include "mlir-c/IR.h"
Include dependency graph for FIRRTL.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FIRRTLBundleField
 Describes a field in a bundle type. More...
 
struct  FIRRTLClassElement
 Describes an element in a class type. More...
 

Typedefs

typedef enum FIRRTLConvention FIRRTLConvention
 Module instantiation conventions. More...
 
typedef enum FIRRTLDirection FIRRTLDirection
 Port direction. More...
 
typedef enum FIRRTLNameKind FIRRTLNameKind
 Name preservation. More...
 
typedef enum FIRRTLRUW FIRRTLRUW
 Read-Under-Write behaviour. More...
 
typedef enum FIRRTLMemDir FIRRTLMemDir
 Memory port direction. More...
 
typedef enum FIRRTLEventControl FIRRTLEventControl
 Edge control trigger. More...
 
typedef enum FIRRTLValueFlow FIRRTLValueFlow
 Flow of value. More...
 
typedef struct FIRRTLBundleField FIRRTLBundleField
 Describes a field in a bundle type. More...
 
typedef struct FIRRTLClassElement FIRRTLClassElement
 Describes an element in a class type. More...
 

Enumerations

enum  FIRRTLConvention { FIRRTL_CONVENTION_INTERNAL , FIRRTL_CONVENTION_SCALARIZED }
 Module instantiation conventions. More...
 
enum  FIRRTLDirection { FIRRTL_DIRECTION_IN , FIRRTL_DIRECTION_OUT }
 Port direction. More...
 
enum  FIRRTLNameKind { FIRRTL_NAME_KIND_DROPPABLE_NAME , FIRRTL_NAME_KIND_INTERESTING_NAME }
 Name preservation. More...
 
enum  FIRRTLRUW { FIRRTL_RUW_UNDEFINED , FIRRTL_RUW_OLD , FIRRTL_RUW_NEW }
 Read-Under-Write behaviour. More...
 
enum  FIRRTLMemDir { FIRRTL_MEM_DIR_INFER , FIRRTL_MEM_DIR_READ , FIRRTL_MEM_DIR_WRITE , FIRRTL_MEM_DIR_READ_WRITE }
 Memory port direction. More...
 
enum  FIRRTLEventControl { FIRRTL_EVENT_CONTROL_AT_POS_EDGE , FIRRTL_EVENT_CONTROL_AT_NEG_EDGE , FIRRTL_EVENT_CONTROL_AT_EDGE }
 Edge control trigger. More...
 
enum  FIRRTLValueFlow { FIRRTL_VALUE_FLOW_NONE , FIRRTL_VALUE_FLOW_SOURCE , FIRRTL_VALUE_FLOW_SINK , FIRRTL_VALUE_FLOW_DUPLEX }
 Flow of value. More...
 

Functions

 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (FIRRTL, firrtl)
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsConst (MlirType type)
 Returns true if this is a const type whose value is guaranteed to be unchanging at circuit execution time. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetConstType (MlirType type, bool isConst)
 Returns a const or non-const version of this type. More...
 
MLIR_CAPI_EXPORTED int64_t firrtlTypeGetBitWidth (MlirType type, bool ignoreFlip)
 Gets the bit width for this type, returns -1 if unknown. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAUInt (MlirType type)
 Checks if this type is a unsigned integer type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetUInt (MlirContext ctx, int32_t width)
 Creates a unsigned integer type with the specified width. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsASInt (MlirType type)
 Checks if this type is a signed integer type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetSInt (MlirContext ctx, int32_t width)
 Creates a signed integer type with the specified width. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClock (MlirType type)
 Checks if this type is a clock type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClock (MlirContext ctx)
 Creates a clock type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAReset (MlirType type)
 Checks if this type is a reset type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetReset (MlirContext ctx)
 Creates a reset type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAsyncReset (MlirType type)
 Checks if this type is an async reset type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAsyncReset (MlirContext ctx)
 Creates an async reset type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnalog (MlirType type)
 Checks if this type is an analog type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnalog (MlirContext ctx, int32_t width)
 Creates an analog type with the specified width. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAVector (MlirType type)
 Checks if this type is a vector type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVector (MlirContext ctx, MlirType element, size_t count)
 Creates a vector type with the specified element type and count. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVectorElement (MlirType vec)
 Returns the element type of a vector type. More...
 
MLIR_CAPI_EXPORTED size_t firrtlTypeGetVectorNumElements (MlirType vec)
 Returns the number of elements in a vector type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsABundle (MlirType type)
 Returns true if the specified type is a bundle type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAOpenBundle (MlirType type)
 Returns true if the specified type is an open bundle type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBundle (MlirContext ctx, size_t count, const FIRRTLBundleField *fields)
 Creates a bundle type with the specified fields. More...
 
MLIR_CAPI_EXPORTED size_t firrtlTypeGetBundleNumFields (MlirType bundle)
 Returns the number of fields in the bundle type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeGetBundleFieldByIndex (MlirType type, size_t index, FIRRTLBundleField *field)
 Returns the field at the specified index in the bundle type. More...
 
MLIR_CAPI_EXPORTED unsigned firrtlTypeGetBundleFieldIndex (MlirType type, MlirStringRef fieldName)
 Returns the index of the field with the specified name in the bundle type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsARef (MlirType type)
 Checks if this type is a ref type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetRef (MlirType target, bool forceable)
 Creates a ref type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef (MlirType type)
 Checks if this type is an anyref type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnyRef (MlirContext ctx)
 Creates an anyref type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAInteger (MlirType type)
 Checks if this type is a property integer type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger (MlirContext ctx)
 Creates a property integer type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble (MlirType type)
 Checks if this type is a property double type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetDouble (MlirContext ctx)
 Creates a property double type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAString (MlirType type)
 Checks if this type is a property string type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetString (MlirContext ctx)
 Creates a property string type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsABoolean (MlirType type)
 Checks if this type is a property boolean type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBoolean (MlirContext ctx)
 Creates a property boolean type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAPath (MlirType type)
 Checks if this type is a property path type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath (MlirContext ctx)
 Creates a property path type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAList (MlirType type)
 Checks if this type is a property list type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList (MlirContext ctx, MlirType elementType)
 Creates a property list type with the specified element type. More...
 
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass (MlirType type)
 Checks if this type is a class type. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClass (MlirContext ctx, MlirAttribute name, size_t numberOfElements, const FIRRTLClassElement *elements)
 Creates a class type with the specified name and elements. More...
 
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetMaskType (MlirType type)
 Returns this type with all ground types replaced with UInt<1>. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetConvention (MlirContext ctx, FIRRTLConvention convention)
 Creates an ConventionAttr with the specified value. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs (MlirContext ctx, size_t count, const FIRRTLDirection *dirs)
 Creates a DenseBoolArrayAttr with the specified port directions. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetParamDecl (MlirContext ctx, MlirIdentifier name, MlirType type, MlirAttribute value)
 Creates a ParamDeclAttr with the specified name, type, and value. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetNameKind (MlirContext ctx, FIRRTLNameKind nameKind)
 Creates a NameKindEnumAttr with the specified name preservation semantic. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetRUW (MlirContext ctx, FIRRTLRUW ruw)
 Creates a RUWAttr with the specified Read-Under-Write Behaviour. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemInit (MlirContext ctx, MlirIdentifier filename, bool isBinary, bool isInline)
 Creates a MemoryInitAttr with the specified memory initialization information. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemDir (MlirContext ctx, FIRRTLMemDir dir)
 Creates a MemDirAttr with the specified memory port direction. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetEventControl (MlirContext ctx, FIRRTLEventControl eventControl)
 Creates a EventControlAttr with the specified value. More...
 
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetIntegerFromString (MlirType type, unsigned numBits, MlirStringRef str, uint8_t radix)
 Creates an IntegerAttr from a string representation of integer. More...
 
MLIR_CAPI_EXPORTED FIRRTLValueFlow firrtlValueFoldFlow (MlirValue value, FIRRTLValueFlow flow)
 Computes the flow for a Value, value, as determined by the FIRRTL specification. More...
 
MLIR_CAPI_EXPORTED bool firrtlImportAnnotationsFromJSONRaw (MlirContext ctx, MlirStringRef annotationsStr, MlirAttribute *importedAnnotationsArray)
 Deserializes a JSON value into FIRRTL Annotations. More...
 

Typedef Documentation

◆ FIRRTLBundleField

Describes a field in a bundle type.

◆ FIRRTLClassElement

Describes an element in a class type.

◆ FIRRTLConvention

Module instantiation conventions.

◆ FIRRTLDirection

Port direction.

◆ FIRRTLEventControl

Edge control trigger.

◆ FIRRTLMemDir

typedef enum FIRRTLMemDir FIRRTLMemDir

Memory port direction.

◆ FIRRTLNameKind

Name preservation.

Names tagged with FIRRTL_NAME_KIND_INTERESTING_NAME will be preserved.

◆ FIRRTLRUW

typedef enum FIRRTLRUW FIRRTLRUW

Read-Under-Write behaviour.

◆ FIRRTLValueFlow

Flow of value.

Enumeration Type Documentation

◆ FIRRTLConvention

Module instantiation conventions.

Enumerator
FIRRTL_CONVENTION_INTERNAL 
FIRRTL_CONVENTION_SCALARIZED 

Definition at line 27 of file FIRRTL.h.

◆ FIRRTLDirection

Port direction.

Enumerator
FIRRTL_DIRECTION_IN 
FIRRTL_DIRECTION_OUT 

Definition at line 34 of file FIRRTL.h.

◆ FIRRTLEventControl

Edge control trigger.

Enumerator
FIRRTL_EVENT_CONTROL_AT_POS_EDGE 
FIRRTL_EVENT_CONTROL_AT_NEG_EDGE 
FIRRTL_EVENT_CONTROL_AT_EDGE 

Definition at line 67 of file FIRRTL.h.

◆ FIRRTLMemDir

Memory port direction.

Enumerator
FIRRTL_MEM_DIR_INFER 
FIRRTL_MEM_DIR_READ 
FIRRTL_MEM_DIR_WRITE 
FIRRTL_MEM_DIR_READ_WRITE 

Definition at line 58 of file FIRRTL.h.

◆ FIRRTLNameKind

Name preservation.

Names tagged with FIRRTL_NAME_KIND_INTERESTING_NAME will be preserved.

Enumerator
FIRRTL_NAME_KIND_DROPPABLE_NAME 
FIRRTL_NAME_KIND_INTERESTING_NAME 

Definition at line 43 of file FIRRTL.h.

◆ FIRRTLRUW

enum FIRRTLRUW

Read-Under-Write behaviour.

Enumerator
FIRRTL_RUW_UNDEFINED 
FIRRTL_RUW_OLD 
FIRRTL_RUW_NEW 

Definition at line 50 of file FIRRTL.h.

◆ FIRRTLValueFlow

Flow of value.

Enumerator
FIRRTL_VALUE_FLOW_NONE 
FIRRTL_VALUE_FLOW_SOURCE 
FIRRTL_VALUE_FLOW_SINK 
FIRRTL_VALUE_FLOW_DUPLEX 

Definition at line 75 of file FIRRTL.h.

Function Documentation

◆ firrtlAttrGetConvention()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetConvention ( MlirContext  ctx,
FIRRTLConvention  convention 
)

Creates an ConventionAttr with the specified value.

Definition at line 278 of file FIRRTL.cpp.

References FIRRTL_CONVENTION_INTERNAL, FIRRTL_CONVENTION_SCALARIZED, circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetEventControl()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetEventControl ( MlirContext  ctx,
FIRRTLEventControl  eventControl 
)

Creates a EventControlAttr with the specified value.

Definition at line 373 of file FIRRTL.cpp.

References FIRRTL_EVENT_CONTROL_AT_EDGE, FIRRTL_EVENT_CONTROL_AT_NEG_EDGE, FIRRTL_EVENT_CONTROL_AT_POS_EDGE, circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetIntegerFromString()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetIntegerFromString ( MlirType  type,
unsigned  numBits,
MlirStringRef  str,
uint8_t  radix 
)

Creates an IntegerAttr from a string representation of integer.

This is a workaround for supporting large integers. See https://github.com/llvm/llvm-project/issues/84190#issuecomment-2035552035

Definition at line 392 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetMemDir()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemDir ( MlirContext  ctx,
FIRRTLMemDir  dir 
)

Creates a MemDirAttr with the specified memory port direction.

Definition at line 352 of file FIRRTL.cpp.

References FIRRTL_MEM_DIR_INFER, FIRRTL_MEM_DIR_READ, FIRRTL_MEM_DIR_READ_WRITE, FIRRTL_MEM_DIR_WRITE, circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetMemInit()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemInit ( MlirContext  ctx,
MlirIdentifier  filename,
bool  isBinary,
bool  isInline 
)

Creates a MemoryInitAttr with the specified memory initialization information.

Definition at line 346 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetNameKind()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetNameKind ( MlirContext  ctx,
FIRRTLNameKind  nameKind 
)

Creates a NameKindEnumAttr with the specified name preservation semantic.

Definition at line 313 of file FIRRTL.cpp.

References FIRRTL_NAME_KIND_DROPPABLE_NAME, FIRRTL_NAME_KIND_INTERESTING_NAME, circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetParamDecl()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetParamDecl ( MlirContext  ctx,
MlirIdentifier  name,
MlirType  type,
MlirAttribute  value 
)

Creates a ParamDeclAttr with the specified name, type, and value.

This is used for module or instance parameter definition.

Definition at line 307 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlAttrGetPortDirs()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs ( MlirContext  ctx,
size_t  count,
const FIRRTLDirection dirs 
)

Creates a DenseBoolArrayAttr with the specified port directions.

Definition at line 294 of file FIRRTL.cpp.

References FIRRTL_DIRECTION_IN, FIRRTL_DIRECTION_OUT, circt::firrtl::In, circt::firrtl::Out, circt::firrtl::direction::packAttribute(), unwrap(), and wrap().

◆ firrtlAttrGetRUW()

MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetRUW ( MlirContext  ctx,
FIRRTLRUW  ruw 
)

Creates a RUWAttr with the specified Read-Under-Write Behaviour.

Definition at line 328 of file FIRRTL.cpp.

References FIRRTL_RUW_NEW, FIRRTL_RUW_OLD, FIRRTL_RUW_UNDEFINED, circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlImportAnnotationsFromJSONRaw()

MLIR_CAPI_EXPORTED bool firrtlImportAnnotationsFromJSONRaw ( MlirContext  ctx,
MlirStringRef  annotationsStr,
MlirAttribute *  importedAnnotationsArray 
)

Deserializes a JSON value into FIRRTL Annotations.

Annotations are represented as a Target-keyed arrays of attributes. The input JSON value is checked, at runtime, to be an array of objects. Returns true if successful, false if unsuccessful.

Definition at line 431 of file FIRRTL.cpp.

References circt::calyx::direction::get(), circt::firrtl::importAnnotationsFromJSONRaw(), unwrap(), and wrap().

◆ firrtlTypeGetAnalog()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnalog ( MlirContext  ctx,
int32_t  width 
)

Creates an analog type with the specified width.

Definition at line 87 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetAnyRef()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnyRef ( MlirContext  ctx)

Creates an anyref type.

Definition at line 199 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetAsyncReset()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAsyncReset ( MlirContext  ctx)

Creates an async reset type.

Definition at line 79 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetBitWidth()

MLIR_CAPI_EXPORTED int64_t firrtlTypeGetBitWidth ( MlirType  type,
bool  ignoreFlip 
)

Gets the bit width for this type, returns -1 if unknown.

It recursively computes the bit width of aggregate types. For bundle and vectors, recursively get the width of each field element and return the total bit width of the aggregate type. This returns -1, if any of the bundle fields is a flip type, or ground type with unknown bit width.

Definition at line 46 of file FIRRTL.cpp.

References circt::firrtl::getBitWidth(), and unwrap().

◆ firrtlTypeGetBoolean()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBoolean ( MlirContext  ctx)

Creates a property boolean type.

Definition at line 229 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetBundle()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBundle ( MlirContext  ctx,
size_t  count,
const FIRRTLBundleField fields 
)

Creates a bundle type with the specified fields.

If any field has a non-FIRRTL base type, an open bundle type is returned, otherwise a normal bundle type is returned.

Definition at line 118 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetBundleFieldByIndex()

MLIR_CAPI_EXPORTED bool firrtlTypeGetBundleFieldByIndex ( MlirType  type,
size_t  index,
FIRRTLBundleField field 
)

Returns the field at the specified index in the bundle type.

Definition at line 154 of file FIRRTL.cpp.

References FIRRTLBundleField::isFlip, FIRRTLBundleField::name, FIRRTLBundleField::type, unwrap(), and wrap().

◆ firrtlTypeGetBundleFieldIndex()

MLIR_CAPI_EXPORTED unsigned firrtlTypeGetBundleFieldIndex ( MlirType  type,
MlirStringRef  fieldName 
)

Returns the index of the field with the specified name in the bundle type.

Definition at line 173 of file FIRRTL.cpp.

References assert(), and unwrap().

◆ firrtlTypeGetBundleNumFields()

MLIR_CAPI_EXPORTED size_t firrtlTypeGetBundleNumFields ( MlirType  bundle)

Returns the number of fields in the bundle type.

Definition at line 144 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeGetClass()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClass ( MlirContext  ctx,
MlirAttribute  name,
size_t  numberOfElements,
const FIRRTLClassElement elements 
)

Creates a class type with the specified name and elements.

Definition at line 250 of file FIRRTL.cpp.

References assert(), FIRRTLClassElement::direction, FIRRTL_DIRECTION_IN, circt::calyx::direction::get(), circt::firrtl::In, circt::firrtl::Out, unwrap(), and wrap().

◆ firrtlTypeGetClock()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClock ( MlirContext  ctx)

Creates a clock type.

Definition at line 65 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetConstType()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetConstType ( MlirType  type,
bool  isConst 
)

Returns a const or non-const version of this type.

Definition at line 42 of file FIRRTL.cpp.

References circt::firrtl::isConst(), unwrap(), and wrap().

◆ firrtlTypeGetDouble()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetDouble ( MlirContext  ctx)

Creates a property double type.

Definition at line 215 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetInteger()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger ( MlirContext  ctx)

Creates a property integer type.

Definition at line 207 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetList()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList ( MlirContext  ctx,
MlirType  elementType 
)

Creates a property list type with the specified element type.

Definition at line 241 of file FIRRTL.cpp.

References assert(), elementType, circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetMaskType()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetMaskType ( MlirType  type)

Returns this type with all ground types replaced with UInt<1>.

This is used for mem operations.

Definition at line 268 of file FIRRTL.cpp.

References assert(), unwrap(), and wrap().

◆ firrtlTypeGetPath()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath ( MlirContext  ctx)

Creates a property path type.

Definition at line 235 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetRef()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetRef ( MlirType  target,
bool  forceable 
)

Creates a ref type.

Definition at line 188 of file FIRRTL.cpp.

References assert(), circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetReset()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetReset ( MlirContext  ctx)

Creates a reset type.

Definition at line 71 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetSInt()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetSInt ( MlirContext  ctx,
int32_t  width 
)

Creates a signed integer type with the specified width.

Definition at line 59 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetString()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetString ( MlirContext  ctx)

Creates a property string type.

Definition at line 223 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetUInt()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetUInt ( MlirContext  ctx,
int32_t  width 
)

Creates a unsigned integer type with the specified width.

Definition at line 53 of file FIRRTL.cpp.

References circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetVector()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVector ( MlirContext  ctx,
MlirType  element,
size_t  count 
)

Creates a vector type with the specified element type and count.

Definition at line 95 of file FIRRTL.cpp.

References assert(), circt::calyx::direction::get(), unwrap(), and wrap().

◆ firrtlTypeGetVectorElement()

MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVectorElement ( MlirType  vec)

Returns the element type of a vector type.

Definition at line 102 of file FIRRTL.cpp.

References unwrap(), and wrap().

◆ firrtlTypeGetVectorNumElements()

MLIR_CAPI_EXPORTED size_t firrtlTypeGetVectorNumElements ( MlirType  vec)

Returns the number of elements in a vector type.

Definition at line 106 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAAnalog()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnalog ( MlirType  type)

Checks if this type is an analog type.

Definition at line 83 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAAnyRef()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef ( MlirType  type)

Checks if this type is an anyref type.

Definition at line 195 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAAsyncReset()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAAsyncReset ( MlirType  type)

Checks if this type is an async reset type.

Definition at line 75 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsABoolean()

MLIR_CAPI_EXPORTED bool firrtlTypeIsABoolean ( MlirType  type)

Checks if this type is a property boolean type.

Definition at line 227 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsABundle()

MLIR_CAPI_EXPORTED bool firrtlTypeIsABundle ( MlirType  type)

Returns true if the specified type is a bundle type.

Definition at line 110 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAClass()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass ( MlirType  type)

Checks if this type is a class type.

Definition at line 248 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAClock()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAClock ( MlirType  type)

Checks if this type is a clock type.

Definition at line 63 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsADouble()

MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble ( MlirType  type)

Checks if this type is a property double type.

Definition at line 211 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAInteger()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAInteger ( MlirType  type)

Checks if this type is a property integer type.

Definition at line 203 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAList()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAList ( MlirType  type)

Checks if this type is a property list type.

Definition at line 239 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAOpenBundle()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAOpenBundle ( MlirType  type)

Returns true if the specified type is an open bundle type.

An open bundle type means that it contains non FIRRTL base types.

Definition at line 114 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAPath()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAPath ( MlirType  type)

Checks if this type is a property path type.

Definition at line 233 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsARef()

MLIR_CAPI_EXPORTED bool firrtlTypeIsARef ( MlirType  type)

Checks if this type is a ref type.

Definition at line 186 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAReset()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAReset ( MlirType  type)

Checks if this type is a reset type.

Definition at line 69 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsASInt()

MLIR_CAPI_EXPORTED bool firrtlTypeIsASInt ( MlirType  type)

Checks if this type is a signed integer type.

Definition at line 57 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAString()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAString ( MlirType  type)

Checks if this type is a property string type.

Definition at line 219 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAUInt()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAUInt ( MlirType  type)

Checks if this type is a unsigned integer type.

Definition at line 51 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsAVector()

MLIR_CAPI_EXPORTED bool firrtlTypeIsAVector ( MlirType  type)

Checks if this type is a vector type.

Definition at line 91 of file FIRRTL.cpp.

References unwrap().

◆ firrtlTypeIsConst()

MLIR_CAPI_EXPORTED bool firrtlTypeIsConst ( MlirType  type)

Returns true if this is a const type whose value is guaranteed to be unchanging at circuit execution time.

◆ firrtlValueFoldFlow()

MLIR_CAPI_EXPORTED FIRRTLValueFlow firrtlValueFoldFlow ( MlirValue  value,
FIRRTLValueFlow  flow 
)

Computes the flow for a Value, value, as determined by the FIRRTL specification.

This recursively walks backwards from value to the declaration. The resulting flow is a combination of the declaration flow (output ports and instance inputs are sinks, registers and wires are duplex, anything else is a source) and the number of intermediary flips. An even number of flips will result in the same flow as the declaration. An odd number of flips will result in reversed flow being returned. The reverse of source is sink. The reverse of sink is source. The reverse of duplex is duplex. The flow parameter sets the initial flow. A user should normally not have to change this from its default of Flow::Source.

Definition at line 398 of file FIRRTL.cpp.

References circt::firrtl::Duplex, FIRRTL_VALUE_FLOW_DUPLEX, FIRRTL_VALUE_FLOW_NONE, FIRRTL_VALUE_FLOW_SINK, FIRRTL_VALUE_FLOW_SOURCE, circt::firrtl::foldFlow(), circt::firrtl::None, circt::firrtl::Sink, circt::firrtl::Source, and unwrap().

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( FIRRTL  ,
firrtl   
)