CIRCT 20.0.0git
Loading...
Searching...
No Matches
FIRRTL.h
Go to the documentation of this file.
1//===- FIRRTL.h - C interface for the FIRRTL dialect --------------*- C -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the C-API for FIRRTL dialect.
10//
11// A complete example of using these C-APIs is Chisel, see
12// https://github.com/chipsalliance/chisel/blob/4f392323e9160440961b9f06e383d3f2742d2f3e/panamaconverter/src/PanamaCIRCTConverter.scala
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef CIRCT_C_DIALECT_FIRRTL_H
17#define CIRCT_C_DIALECT_FIRRTL_H
18
19#include "mlir-c/IR.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/// Module instantiation conventions.
26// NOLINTNEXTLINE(modernize-use-using)
31
32/// Layer lowering conventions.
33// NOLINTNEXTLINE(modernize-use-using)
38
39/// Port direction.
40// NOLINTNEXTLINE(modernize-use-using)
45
46/// Name preservation.
47///
48/// Names tagged with `FIRRTL_NAME_KIND_INTERESTING_NAME` will be preserved.
49// NOLINTNEXTLINE(modernize-use-using)
54
55/// Read-Under-Write behaviour.
56// NOLINTNEXTLINE(modernize-use-using)
62
63/// Memory port direction.
64// NOLINTNEXTLINE(modernize-use-using)
71
72/// Edge control trigger.
73// NOLINTNEXTLINE(modernize-use-using)
79
80/// Flow of value.
81// NOLINTNEXTLINE(modernize-use-using)
88
89/// Describes a field in a bundle type.
90// NOLINTNEXTLINE(modernize-use-using)
91typedef struct FIRRTLBundleField {
92 MlirIdentifier name;
93 bool isFlip;
94 MlirType type;
96
97/// Describes an element in a class type.
98// NOLINTNEXTLINE(modernize-use-using)
104
105//===----------------------------------------------------------------------===//
106// Dialect API.
107//===----------------------------------------------------------------------===//
108
110
111//===----------------------------------------------------------------------===//
112// Type API.
113//===----------------------------------------------------------------------===//
114
115/// Returns `true` if this is a const type whose value is guaranteed to be
116/// unchanging at circuit execution time.
117MLIR_CAPI_EXPORTED bool firrtlTypeIsConst(MlirType type);
118
119/// Returns a const or non-const version of this type.
120MLIR_CAPI_EXPORTED MlirType firrtlTypeGetConstType(MlirType type, bool isConst);
121
122/// Gets the bit width for this type, returns -1 if unknown.
123///
124/// It recursively computes the bit width of aggregate types. For bundle and
125/// vectors, recursively get the width of each field element and return the
126/// total bit width of the aggregate type. This returns -1, if any of the bundle
127/// fields is a flip type, or ground type with unknown bit width.
128MLIR_CAPI_EXPORTED int64_t firrtlTypeGetBitWidth(MlirType type,
129 bool ignoreFlip);
130
131/// Checks if this type is a unsigned integer type.
132MLIR_CAPI_EXPORTED bool firrtlTypeIsAUInt(MlirType type);
133
134/// Creates a unsigned integer type with the specified width.
135MLIR_CAPI_EXPORTED MlirType firrtlTypeGetUInt(MlirContext ctx, int32_t width);
136
137/// Checks if this type is a signed integer type.
138MLIR_CAPI_EXPORTED bool firrtlTypeIsASInt(MlirType type);
139
140/// Creates a signed integer type with the specified width.
141MLIR_CAPI_EXPORTED MlirType firrtlTypeGetSInt(MlirContext ctx, int32_t width);
142
143/// Checks if this type is a clock type.
144MLIR_CAPI_EXPORTED bool firrtlTypeIsAClock(MlirType type);
145
146/// Creates a clock type.
147MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClock(MlirContext ctx);
148
149/// Checks if this type is a reset type.
150MLIR_CAPI_EXPORTED bool firrtlTypeIsAReset(MlirType type);
151
152/// Creates a reset type.
153MLIR_CAPI_EXPORTED MlirType firrtlTypeGetReset(MlirContext ctx);
154
155/// Checks if this type is an async reset type.
156MLIR_CAPI_EXPORTED bool firrtlTypeIsAAsyncReset(MlirType type);
157
158/// Creates an async reset type.
159MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAsyncReset(MlirContext ctx);
160
161/// Checks if this type is an analog type.
162MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnalog(MlirType type);
163
164/// Creates an analog type with the specified width.
165MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnalog(MlirContext ctx, int32_t width);
166
167/// Checks if this type is a vector type.
168MLIR_CAPI_EXPORTED bool firrtlTypeIsAVector(MlirType type);
169
170/// Creates a vector type with the specified element type and count.
171MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVector(MlirContext ctx,
172 MlirType element, size_t count);
173
174/// Returns the element type of a vector type.
175MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVectorElement(MlirType vec);
176
177/// Returns the number of elements in a vector type.
178MLIR_CAPI_EXPORTED size_t firrtlTypeGetVectorNumElements(MlirType vec);
179
180/// Returns true if the specified type is a bundle type.
181MLIR_CAPI_EXPORTED bool firrtlTypeIsABundle(MlirType type);
182
183/// Returns true if the specified type is an open bundle type.
184///
185/// An open bundle type means that it contains non FIRRTL base types.
186MLIR_CAPI_EXPORTED bool firrtlTypeIsAOpenBundle(MlirType type);
187
188/// Creates a bundle type with the specified fields.
189///
190/// If any field has a non-FIRRTL base type, an open bundle type is returned,
191/// otherwise a normal bundle type is returned.
192MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBundle(
193 MlirContext ctx, size_t count, const FIRRTLBundleField *fields);
194
195/// Returns the number of fields in the bundle type.
196MLIR_CAPI_EXPORTED size_t firrtlTypeGetBundleNumFields(MlirType bundle);
197
198/// Returns the field at the specified index in the bundle type.
199MLIR_CAPI_EXPORTED bool
200firrtlTypeGetBundleFieldByIndex(MlirType type, size_t index,
201 FIRRTLBundleField *field);
202
203/// Returns the index of the field with the specified name in the bundle type.
204MLIR_CAPI_EXPORTED unsigned
205firrtlTypeGetBundleFieldIndex(MlirType type, MlirStringRef fieldName);
206
207/// Checks if this type is a ref type.
208MLIR_CAPI_EXPORTED bool firrtlTypeIsARef(MlirType type);
209
210/// Creates a ref type.
211MLIR_CAPI_EXPORTED MlirType firrtlTypeGetRef(MlirType target, bool forceable);
212
213/// Checks if this type is an anyref type.
214MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef(MlirType type);
215
216/// Creates an anyref type.
217MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnyRef(MlirContext ctx);
218
219/// Checks if this type is a property integer type.
220MLIR_CAPI_EXPORTED bool firrtlTypeIsAInteger(MlirType type);
221
222/// Creates a property integer type.
223MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger(MlirContext ctx);
224
225/// Checks if this type is a property double type.
226MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble(MlirType type);
227
228/// Creates a property double type.
229MLIR_CAPI_EXPORTED MlirType firrtlTypeGetDouble(MlirContext ctx);
230
231/// Checks if this type is a property string type.
232MLIR_CAPI_EXPORTED bool firrtlTypeIsAString(MlirType type);
233
234/// Creates a property string type.
235MLIR_CAPI_EXPORTED MlirType firrtlTypeGetString(MlirContext ctx);
236
237/// Checks if this type is a property boolean type.
238MLIR_CAPI_EXPORTED bool firrtlTypeIsABoolean(MlirType type);
239
240/// Creates a property boolean type.
241MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBoolean(MlirContext ctx);
242
243/// Checks if this type is a property path type.
244MLIR_CAPI_EXPORTED bool firrtlTypeIsAPath(MlirType type);
245
246/// Creates a property path type.
247MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath(MlirContext ctx);
248
249/// Checks if this type is a property list type.
250MLIR_CAPI_EXPORTED bool firrtlTypeIsAList(MlirType type);
251
252/// Creates a property list type with the specified element type.
253MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList(MlirContext ctx,
254 MlirType elementType);
255
256/// Checks if this type is a class type.
257MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass(MlirType type);
258
259/// Creates a class type with the specified name and elements.
260MLIR_CAPI_EXPORTED MlirType
261firrtlTypeGetClass(MlirContext ctx, MlirAttribute name, size_t numberOfElements,
262 const FIRRTLClassElement *elements);
263
264/// Returns this type with all ground types replaced with UInt<1>. This is
265/// used for `mem` operations.
266MLIR_CAPI_EXPORTED MlirType firrtlTypeGetMaskType(MlirType type);
267
268//===----------------------------------------------------------------------===//
269// Attribute API.
270//===----------------------------------------------------------------------===//
271
272/// Creates an ConventionAttr with the specified value.
273MLIR_CAPI_EXPORTED MlirAttribute
274firrtlAttrGetConvention(MlirContext ctx, FIRRTLConvention convention);
275
276/// Creates a LayerConventionAttr with the specified value.
277MLIR_CAPI_EXPORTED MlirAttribute
278firrtlAttrGetLayerConvention(MlirContext ctx, FIRRTLLayerConvention convention);
279
280/// Creates a DenseBoolArrayAttr with the specified port directions.
281MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs(
282 MlirContext ctx, size_t count, const FIRRTLDirection *dirs);
283
284/// Creates a ParamDeclAttr with the specified name, type, and value. This is
285/// used for module or instance parameter definition.
286MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetParamDecl(MlirContext ctx,
287 MlirIdentifier name,
288 MlirType type,
289 MlirAttribute value);
290
291/// Creates a NameKindEnumAttr with the specified name preservation semantic.
292MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetNameKind(MlirContext ctx,
293 FIRRTLNameKind nameKind);
294
295/// Creates a RUWAttr with the specified Read-Under-Write Behaviour.
296MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetRUW(MlirContext ctx,
297 FIRRTLRUW ruw);
298
299/// Creates a MemoryInitAttr with the specified memory initialization
300/// information.
301MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemInit(MlirContext ctx,
302 MlirIdentifier filename,
303 bool isBinary,
304 bool isInline);
305
306/// Creates a MemDirAttr with the specified memory port direction.
307MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemDir(MlirContext ctx,
308 FIRRTLMemDir dir);
309
310/// Creates a EventControlAttr with the specified value.
311MLIR_CAPI_EXPORTED MlirAttribute
312firrtlAttrGetEventControl(MlirContext ctx, FIRRTLEventControl eventControl);
313
314/// Creates an IntegerAttr from a string representation of integer.
315///
316/// This is a workaround for supporting large integers. See
317/// https://github.com/llvm/llvm-project/issues/84190#issuecomment-2035552035
318MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetIntegerFromString(
319 MlirType type, unsigned numBits, MlirStringRef str, uint8_t radix);
320
321//===----------------------------------------------------------------------===//
322// Utility API.
323//===----------------------------------------------------------------------===//
324
325/// Computes the flow for a Value, \p value, as determined by the FIRRTL
326/// specification. This recursively walks backwards from \p value to the
327/// declaration. The resulting flow is a combination of the declaration flow
328/// (output ports and instance inputs are sinks, registers and wires are
329/// duplex, anything else is a source) and the number of intermediary flips.
330/// An even number of flips will result in the same flow as the declaration.
331/// An odd number of flips will result in reversed flow being returned. The
332/// reverse of source is sink. The reverse of sink is source. The reverse of
333/// duplex is duplex. The \p flow parameter sets the initial flow.
334/// A user should normally \a not have to change this from its default of \p
335/// Flow::Source.
336MLIR_CAPI_EXPORTED FIRRTLValueFlow firrtlValueFoldFlow(MlirValue value,
337 FIRRTLValueFlow flow);
338
339/// Deserializes a JSON value into FIRRTL Annotations. Annotations are
340/// represented as a Target-keyed arrays of attributes. The input JSON value is
341/// checked, at runtime, to be an array of objects. Returns true if successful,
342/// false if unsuccessful.
343MLIR_CAPI_EXPORTED bool
345 MlirStringRef annotationsStr,
346 MlirAttribute *importedAnnotationsArray);
347
348#ifdef __cplusplus
349}
350#endif
351
352#endif // CIRCT_C_DIALECT_FIRRTL_H
MlirType elementType
Definition CHIRRTL.cpp:29
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetSInt(MlirContext ctx, int32_t width)
Creates a signed integer type with the specified width.
Definition FIRRTL.cpp:59
MLIR_CAPI_EXPORTED bool firrtlTypeIsAUInt(MlirType type)
Checks if this type is a unsigned integer type.
Definition FIRRTL.cpp:51
MLIR_CAPI_EXPORTED bool firrtlTypeIsABoolean(MlirType type)
Checks if this type is a property boolean type.
Definition FIRRTL.cpp:227
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetLayerConvention(MlirContext ctx, FIRRTLLayerConvention convention)
Creates a LayerConventionAttr with the specified value.
Definition FIRRTL.cpp:294
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger(MlirContext ctx)
Creates a property integer type.
Definition FIRRTL.cpp:207
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs(MlirContext ctx, size_t count, const FIRRTLDirection *dirs)
Creates a DenseBoolArrayAttr with the specified port directions.
Definition FIRRTL.cpp:310
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 ...
MLIR_CAPI_EXPORTED bool firrtlTypeIsAInteger(MlirType type)
Checks if this type is a property integer type.
Definition FIRRTL.cpp:203
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetEventControl(MlirContext ctx, FIRRTLEventControl eventControl)
Creates a EventControlAttr with the specified value.
Definition FIRRTL.cpp:389
MLIR_CAPI_EXPORTED bool firrtlTypeIsABundle(MlirType type)
Returns true if the specified type is a bundle type.
Definition FIRRTL.cpp:110
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnalog(MlirContext ctx, int32_t width)
Creates an analog type with the specified width.
Definition FIRRTL.cpp:87
FIRRTLLayerConvention
Layer lowering conventions.
Definition FIRRTL.h:34
@ FIRRTL_LAYER_CONVENTION_INLINE
Definition FIRRTL.h:36
@ FIRRTL_LAYER_CONVENTION_BIND
Definition FIRRTL.h:35
MLIR_CAPI_EXPORTED bool firrtlTypeIsAString(MlirType type)
Checks if this type is a property string type.
Definition FIRRTL.cpp:219
MLIR_CAPI_EXPORTED bool firrtlTypeIsAList(MlirType type)
Checks if this type is a property list type.
Definition FIRRTL.cpp:239
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetReset(MlirContext ctx)
Creates a reset type.
Definition FIRRTL.cpp:71
FIRRTLValueFlow
Flow of value.
Definition FIRRTL.h:82
@ FIRRTL_VALUE_FLOW_SOURCE
Definition FIRRTL.h:84
@ FIRRTL_VALUE_FLOW_NONE
Definition FIRRTL.h:83
@ FIRRTL_VALUE_FLOW_SINK
Definition FIRRTL.h:85
@ FIRRTL_VALUE_FLOW_DUPLEX
Definition FIRRTL.h:86
MLIR_CAPI_EXPORTED bool firrtlTypeIsAPath(MlirType type)
Checks if this type is a property path type.
Definition FIRRTL.cpp:233
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(FIRRTL, firrtl)
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath(MlirContext ctx)
Creates a property path type.
Definition FIRRTL.cpp:235
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef(MlirType type)
Checks if this type is an anyref type.
Definition FIRRTL.cpp:195
FIRRTLNameKind
Name preservation.
Definition FIRRTL.h:50
@ FIRRTL_NAME_KIND_DROPPABLE_NAME
Definition FIRRTL.h:51
@ FIRRTL_NAME_KIND_INTERESTING_NAME
Definition FIRRTL.h:52
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAsyncReset(MlirType type)
Checks if this type is an async reset type.
Definition FIRRTL.cpp:75
MLIR_CAPI_EXPORTED bool firrtlTypeIsAVector(MlirType type)
Checks if this type is a vector type.
Definition FIRRTL.cpp:91
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetConstType(MlirType type, bool isConst)
Returns a const or non-const version of this type.
Definition FIRRTL.cpp:42
FIRRTLMemDir
Memory port direction.
Definition FIRRTL.h:65
@ FIRRTL_MEM_DIR_INFER
Definition FIRRTL.h:66
@ FIRRTL_MEM_DIR_READ
Definition FIRRTL.h:67
@ FIRRTL_MEM_DIR_READ_WRITE
Definition FIRRTL.h:69
@ FIRRTL_MEM_DIR_WRITE
Definition FIRRTL.h:68
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetConvention(MlirContext ctx, FIRRTLConvention convention)
Creates an ConventionAttr with the specified value.
Definition FIRRTL.cpp:278
MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble(MlirType type)
Checks if this type is a property double type.
Definition FIRRTL.cpp:211
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetRef(MlirType target, bool forceable)
Creates a ref type.
Definition FIRRTL.cpp:188
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetNameKind(MlirContext ctx, FIRRTLNameKind nameKind)
Creates a NameKindEnumAttr with the specified name preservation semantic.
Definition FIRRTL.cpp:329
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetUInt(MlirContext ctx, int32_t width)
Creates a unsigned integer type with the specified width.
Definition FIRRTL.cpp:53
MLIR_CAPI_EXPORTED bool firrtlTypeIsAOpenBundle(MlirType type)
Returns true if the specified type is an open bundle type.
Definition FIRRTL.cpp:114
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetRUW(MlirContext ctx, FIRRTLRUW ruw)
Creates a RUWAttr with the specified Read-Under-Write Behaviour.
Definition FIRRTL.cpp:344
MLIR_CAPI_EXPORTED size_t firrtlTypeGetVectorNumElements(MlirType vec)
Returns the number of elements in a vector type.
Definition FIRRTL.cpp:106
MLIR_CAPI_EXPORTED unsigned firrtlTypeGetBundleFieldIndex(MlirType type, MlirStringRef fieldName)
Returns the index of the field with the specified name in the bundle type.
Definition FIRRTL.cpp:173
MLIR_CAPI_EXPORTED size_t firrtlTypeGetBundleNumFields(MlirType bundle)
Returns the number of fields in the bundle type.
Definition FIRRTL.cpp:144
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetString(MlirContext ctx)
Creates a property string type.
Definition FIRRTL.cpp:223
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemInit(MlirContext ctx, MlirIdentifier filename, bool isBinary, bool isInline)
Creates a MemoryInitAttr with the specified memory initialization information.
Definition FIRRTL.cpp:362
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnalog(MlirType type)
Checks if this type is an analog type.
Definition FIRRTL.cpp:83
FIRRTLEventControl
Edge control trigger.
Definition FIRRTL.h:74
@ FIRRTL_EVENT_CONTROL_AT_POS_EDGE
Definition FIRRTL.h:75
@ FIRRTL_EVENT_CONTROL_AT_NEG_EDGE
Definition FIRRTL.h:76
@ FIRRTL_EVENT_CONTROL_AT_EDGE
Definition FIRRTL.h:77
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemDir(MlirContext ctx, FIRRTLMemDir dir)
Creates a MemDirAttr with the specified memory port direction.
Definition FIRRTL.cpp:368
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetParamDecl(MlirContext ctx, MlirIdentifier name, MlirType type, MlirAttribute value)
Creates a ParamDeclAttr with the specified name, type, and value.
Definition FIRRTL.cpp:323
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList(MlirContext ctx, MlirType elementType)
Creates a property list type with the specified element type.
Definition FIRRTL.cpp:241
MLIR_CAPI_EXPORTED bool firrtlTypeIsAReset(MlirType type)
Checks if this type is a reset type.
Definition FIRRTL.cpp:69
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVectorElement(MlirType vec)
Returns the element type of a vector type.
Definition FIRRTL.cpp:102
MLIR_CAPI_EXPORTED int64_t firrtlTypeGetBitWidth(MlirType type, bool ignoreFlip)
Gets the bit width for this type, returns -1 if unknown.
Definition FIRRTL.cpp:46
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetVector(MlirContext ctx, MlirType element, size_t count)
Creates a vector type with the specified element type and count.
Definition FIRRTL.cpp:95
MLIR_CAPI_EXPORTED bool firrtlTypeGetBundleFieldByIndex(MlirType type, size_t index, FIRRTLBundleField *field)
Returns the field at the specified index in the bundle type.
Definition FIRRTL.cpp:154
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBundle(MlirContext ctx, size_t count, const FIRRTLBundleField *fields)
Creates a bundle type with the specified fields.
Definition FIRRTL.cpp:118
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAsyncReset(MlirContext ctx)
Creates an async reset type.
Definition FIRRTL.cpp:79
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetDouble(MlirContext ctx)
Creates a property double type.
Definition FIRRTL.cpp:215
FIRRTLDirection
Port direction.
Definition FIRRTL.h:41
@ FIRRTL_DIRECTION_OUT
Definition FIRRTL.h:43
@ FIRRTL_DIRECTION_IN
Definition FIRRTL.h:42
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetMaskType(MlirType type)
Returns this type with all ground types replaced with UInt<1>.
Definition FIRRTL.cpp:268
MLIR_CAPI_EXPORTED bool firrtlImportAnnotationsFromJSONRaw(MlirContext ctx, MlirStringRef annotationsStr, MlirAttribute *importedAnnotationsArray)
Deserializes a JSON value into FIRRTL Annotations.
Definition FIRRTL.cpp:447
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass(MlirType type)
Checks if this type is a class type.
Definition FIRRTL.cpp:248
MLIR_CAPI_EXPORTED FIRRTLValueFlow firrtlValueFoldFlow(MlirValue value, FIRRTLValueFlow flow)
Computes the flow for a Value, value, as determined by the FIRRTL specification.
Definition FIRRTL.cpp:414
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClock(MlirType type)
Checks if this type is a clock type.
Definition FIRRTL.cpp:63
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetClock(MlirContext ctx)
Creates a clock type.
Definition FIRRTL.cpp:65
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetIntegerFromString(MlirType type, unsigned numBits, MlirStringRef str, uint8_t radix)
Creates an IntegerAttr from a string representation of integer.
Definition FIRRTL.cpp:408
MLIR_CAPI_EXPORTED bool firrtlTypeIsARef(MlirType type)
Checks if this type is a ref type.
Definition FIRRTL.cpp:186
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnyRef(MlirContext ctx)
Creates an anyref type.
Definition FIRRTL.cpp:199
FIRRTLRUW
Read-Under-Write behaviour.
Definition FIRRTL.h:57
@ FIRRTL_RUW_OLD
Definition FIRRTL.h:59
@ FIRRTL_RUW_UNDEFINED
Definition FIRRTL.h:58
@ FIRRTL_RUW_NEW
Definition FIRRTL.h:60
MLIR_CAPI_EXPORTED bool firrtlTypeIsASInt(MlirType type)
Checks if this type is a signed integer type.
Definition FIRRTL.cpp:57
FIRRTLConvention
Module instantiation conventions.
Definition FIRRTL.h:27
@ FIRRTL_CONVENTION_SCALARIZED
Definition FIRRTL.h:29
@ FIRRTL_CONVENTION_INTERNAL
Definition FIRRTL.h:28
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBoolean(MlirContext ctx)
Creates a property boolean type.
Definition FIRRTL.cpp:229
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 FIRRTL.cpp:250
Describes a field in a bundle type.
Definition FIRRTL.h:91
MlirType type
Definition FIRRTL.h:94
MlirIdentifier name
Definition FIRRTL.h:92
Describes an element in a class type.
Definition FIRRTL.h:99
MlirIdentifier name
Definition FIRRTL.h:100
MlirType type
Definition FIRRTL.h:101
FIRRTLDirection direction
Definition FIRRTL.h:102