CIRCT 23.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/// Creates a ref type.
214MLIR_CAPI_EXPORTED MlirType firrtlTypeGetColoredRef(MlirType target,
215 bool forceable,
216 MlirAttribute layer);
217
218/// Checks if this type is an anyref type.
219MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef(MlirType type);
220
221/// Creates an anyref type.
222MLIR_CAPI_EXPORTED MlirType firrtlTypeGetAnyRef(MlirContext ctx);
223
224/// Checks if this type is a property integer type.
225MLIR_CAPI_EXPORTED bool firrtlTypeIsAInteger(MlirType type);
226
227/// Creates a property integer type.
228MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger(MlirContext ctx);
229
230/// Checks if this type is a property double type.
231MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble(MlirType type);
232
233/// Creates a property double type.
234MLIR_CAPI_EXPORTED MlirType firrtlTypeGetDouble(MlirContext ctx);
235
236/// Checks if this type is a property string type.
237MLIR_CAPI_EXPORTED bool firrtlTypeIsAString(MlirType type);
238
239/// Creates a property string type.
240MLIR_CAPI_EXPORTED MlirType firrtlTypeGetString(MlirContext ctx);
241
242/// Checks if this type is a property boolean type.
243MLIR_CAPI_EXPORTED bool firrtlTypeIsABoolean(MlirType type);
244
245/// Creates a property boolean type.
246MLIR_CAPI_EXPORTED MlirType firrtlTypeGetBoolean(MlirContext ctx);
247
248/// Checks if this type is a property path type.
249MLIR_CAPI_EXPORTED bool firrtlTypeIsAPath(MlirType type);
250
251/// Creates a property path type.
252MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath(MlirContext ctx);
253
254/// Checks if this type is a property list type.
255MLIR_CAPI_EXPORTED bool firrtlTypeIsAList(MlirType type);
256
257/// Creates a property list type with the specified element type.
258MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList(MlirContext ctx,
259 MlirType elementType);
260
261/// Checks if this type is a class type.
262MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass(MlirType type);
263
264/// Creates a class type with the specified name and elements.
265MLIR_CAPI_EXPORTED MlirType
266firrtlTypeGetClass(MlirContext ctx, MlirAttribute name, size_t numberOfElements,
267 const FIRRTLClassElement *elements);
268
269/// Returns this type with all ground types replaced with UInt<1>. This is
270/// used for `mem` operations.
271MLIR_CAPI_EXPORTED MlirType firrtlTypeGetMaskType(MlirType type);
272
273//===----------------------------------------------------------------------===//
274// Attribute API.
275//===----------------------------------------------------------------------===//
276
277/// Creates an ConventionAttr with the specified value.
278MLIR_CAPI_EXPORTED MlirAttribute
279firrtlAttrGetConvention(MlirContext ctx, FIRRTLConvention convention);
280
281/// Creates a LayerConventionAttr with the specified value.
282MLIR_CAPI_EXPORTED MlirAttribute
283firrtlAttrGetLayerConvention(MlirContext ctx, FIRRTLLayerConvention convention);
284
285/// Creates a DenseBoolArrayAttr with the specified port directions.
286MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs(
287 MlirContext ctx, size_t count, const FIRRTLDirection *dirs);
288
289/// Creates a ParamDeclAttr with the specified name, type, and value. This is
290/// used for module or instance parameter definition.
291MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetParamDecl(MlirContext ctx,
292 MlirIdentifier name,
293 MlirType type,
294 MlirAttribute value);
295
296/// Creates a NameKindEnumAttr with the specified name preservation semantic.
297MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetNameKind(MlirContext ctx,
298 FIRRTLNameKind nameKind);
299
300/// Creates a RUWBehaviorAttr with the specified Read-Under-Write Behavior.
301MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetRUW(MlirContext ctx,
302 FIRRTLRUW ruw);
303
304/// Creates a MemoryInitAttr with the specified memory initialization
305/// information.
306MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemInit(MlirContext ctx,
307 MlirIdentifier filename,
308 bool isBinary,
309 bool isInline);
310
311/// Creates a MemDirAttr with the specified memory port direction.
312MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetMemDir(MlirContext ctx,
313 FIRRTLMemDir dir);
314
315/// Creates a EventControlAttr with the specified value.
316MLIR_CAPI_EXPORTED MlirAttribute
317firrtlAttrGetEventControl(MlirContext ctx, FIRRTLEventControl eventControl);
318
319/// Creates an IntegerAttr from a string representation of integer.
320///
321/// This is a workaround for supporting large integers. See
322/// https://github.com/llvm/llvm-project/issues/84190#issuecomment-2035552035
323MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetIntegerFromString(
324 MlirType type, unsigned numBits, MlirStringRef str, uint8_t radix);
325
326//===----------------------------------------------------------------------===//
327// Utility API.
328//===----------------------------------------------------------------------===//
329
330/// Computes the flow for a Value, \p value, as determined by the FIRRTL
331/// specification. This recursively walks backwards from \p value to the
332/// declaration. The resulting flow is a combination of the declaration flow
333/// (output ports and instance inputs are sinks, registers and wires are
334/// duplex, anything else is a source) and the number of intermediary flips.
335/// An even number of flips will result in the same flow as the declaration.
336/// An odd number of flips will result in reversed flow being returned. The
337/// reverse of source is sink. The reverse of sink is source. The reverse of
338/// duplex is duplex. The \p flow parameter sets the initial flow.
339/// A user should normally \a not have to change this from its default of \p
340/// Flow::Source.
341MLIR_CAPI_EXPORTED FIRRTLValueFlow firrtlValueFoldFlow(MlirValue value,
342 FIRRTLValueFlow flow);
343
344/// Deserializes a JSON value into FIRRTL Annotations. Annotations are
345/// represented as a Target-keyed arrays of attributes. The input JSON value is
346/// checked, at runtime, to be an array of objects. Returns true if successful,
347/// false if unsuccessful.
348MLIR_CAPI_EXPORTED bool
350 MlirStringRef annotationsStr,
351 MlirAttribute *importedAnnotationsArray);
352
353#ifdef __cplusplus
354}
355#endif
356
357#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:237
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetLayerConvention(MlirContext ctx, FIRRTLLayerConvention convention)
Creates a LayerConventionAttr with the specified value.
Definition FIRRTL.cpp:304
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetInteger(MlirContext ctx)
Creates a property integer type.
Definition FIRRTL.cpp:217
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetPortDirs(MlirContext ctx, size_t count, const FIRRTLDirection *dirs)
Creates a DenseBoolArrayAttr with the specified port directions.
Definition FIRRTL.cpp:320
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:213
MLIR_CAPI_EXPORTED MlirAttribute firrtlAttrGetEventControl(MlirContext ctx, FIRRTLEventControl eventControl)
Creates a EventControlAttr with the specified value.
Definition FIRRTL.cpp:399
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:229
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetColoredRef(MlirType target, bool forceable, MlirAttribute layer)
Creates a ref type.
Definition FIRRTL.cpp:195
MLIR_CAPI_EXPORTED bool firrtlTypeIsAList(MlirType type)
Checks if this type is a property list type.
Definition FIRRTL.cpp:249
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:243
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(FIRRTL, firrtl)
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetPath(MlirContext ctx)
Creates a property path type.
Definition FIRRTL.cpp:245
MLIR_CAPI_EXPORTED bool firrtlTypeIsAAnyRef(MlirType type)
Checks if this type is an anyref type.
Definition FIRRTL.cpp:205
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:288
MLIR_CAPI_EXPORTED bool firrtlTypeIsADouble(MlirType type)
Checks if this type is a property double type.
Definition FIRRTL.cpp:221
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:339
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 RUWBehaviorAttr with the specified Read-Under-Write Behavior.
Definition FIRRTL.cpp:354
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:233
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:372
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:378
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:333
MLIR_CAPI_EXPORTED MlirType firrtlTypeGetList(MlirContext ctx, MlirType elementType)
Creates a property list type with the specified element type.
Definition FIRRTL.cpp:251
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:225
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:278
MLIR_CAPI_EXPORTED bool firrtlImportAnnotationsFromJSONRaw(MlirContext ctx, MlirStringRef annotationsStr, MlirAttribute *importedAnnotationsArray)
Deserializes a JSON value into FIRRTL Annotations.
Definition FIRRTL.cpp:457
MLIR_CAPI_EXPORTED bool firrtlTypeIsAClass(MlirType type)
Checks if this type is a class type.
Definition FIRRTL.cpp:258
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:424
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:418
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:209
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:239
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:260
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