Loading [MathJax]/jax/output/HTML-CSS/config.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HW.cpp
Go to the documentation of this file.
1//===- HW.cpp - C interface for the HW dialect ----------------------------===//
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
15#include "circt/Support/LLVM.h"
16#include "mlir/CAPI/IR.h"
17#include "mlir/CAPI/Registration.h"
18#include "mlir/CAPI/Support.h"
19#include "llvm/ADT/PostOrderIterator.h"
20
21using namespace circt;
22using namespace circt::hw;
23
26
27//===----------------------------------------------------------------------===//
28// Dialect API.
29//===----------------------------------------------------------------------===//
30
33
34//===----------------------------------------------------------------------===//
35// Type API.
36//===----------------------------------------------------------------------===//
37
38int64_t hwGetBitWidth(MlirType type) { return getBitWidth(unwrap(type)); }
39
40bool hwTypeIsAValueType(MlirType type) { return isHWValueType(unwrap(type)); }
41
42bool hwTypeIsAArrayType(MlirType type) { return isa<ArrayType>(unwrap(type)); }
43
44MlirType hwArrayTypeGet(MlirType element, size_t size) {
45 return wrap(ArrayType::get(unwrap(element), size));
46}
47
48MlirType hwArrayTypeGetElementType(MlirType type) {
49 return wrap(cast<ArrayType>(unwrap(type)).getElementType());
50}
51
52intptr_t hwArrayTypeGetSize(MlirType type) {
53 return cast<ArrayType>(unwrap(type)).getNumElements();
54}
55
56bool hwTypeIsAIntType(MlirType type) { return isa<IntType>(unwrap(type)); }
57
58MlirType hwParamIntTypeGet(MlirAttribute parameter) {
59 return wrap(IntType::get(cast<TypedAttr>(unwrap(parameter))));
60}
61
62MlirAttribute hwParamIntTypeGetWidthAttr(MlirType type) {
63 return wrap(cast<IntType>(unwrap(type)).getWidth());
64}
65
66MlirType hwInOutTypeGet(MlirType element) {
67 return wrap(InOutType::get(unwrap(element)));
68}
69
70MlirType hwInOutTypeGetElementType(MlirType type) {
71 return wrap(cast<InOutType>(unwrap(type)).getElementType());
72}
73
74bool hwTypeIsAInOut(MlirType type) { return isa<InOutType>(unwrap(type)); }
75
76bool hwTypeIsAModuleType(MlirType type) {
77 return isa<ModuleType>(unwrap(type));
78}
79
80MlirType hwModuleTypeGet(MlirContext ctx, intptr_t numPorts,
81 HWModulePort const *ports) {
82 SmallVector<ModulePort> modulePorts;
83 for (intptr_t i = 0; i < numPorts; ++i) {
84 HWModulePort port = ports[i];
85
87 switch (port.dir) {
88 case HWModulePortDirection::Input:
89 dir = ModulePort::Direction::Input;
90 break;
91 case HWModulePortDirection::Output:
92 dir = ModulePort::Direction::Output;
93 break;
94 case HWModulePortDirection::InOut:
95 dir = ModulePort::Direction::InOut;
96 break;
97 }
98
99 StringAttr name = cast<StringAttr>(unwrap(port.name));
100 Type type = unwrap(port.type);
101
102 modulePorts.push_back(ModulePort{name, type, dir});
103 }
104
105 return wrap(ModuleType::get(unwrap(ctx), modulePorts));
106}
107
108intptr_t hwModuleTypeGetNumInputs(MlirType type) {
109 return cast<ModuleType>(unwrap(type)).getNumInputs();
110}
111
112MlirType hwModuleTypeGetInputType(MlirType type, intptr_t index) {
113 return wrap(cast<ModuleType>(unwrap(type)).getInputType(index));
114}
115
116MlirStringRef hwModuleTypeGetInputName(MlirType type, intptr_t index) {
117 return wrap(cast<ModuleType>(unwrap(type)).getInputName(index));
118}
119
120intptr_t hwModuleTypeGetNumOutputs(MlirType type) {
121 return cast<ModuleType>(unwrap(type)).getNumOutputs();
122}
123
124MlirType hwModuleTypeGetOutputType(MlirType type, intptr_t index) {
125 return wrap(cast<ModuleType>(unwrap(type)).getOutputType(index));
126}
127
128MlirStringRef hwModuleTypeGetOutputName(MlirType type, intptr_t index) {
129 return wrap(cast<ModuleType>(unwrap(type)).getOutputName(index));
130}
131
132void hwModuleTypeGetPort(MlirType type, intptr_t index, HWModulePort *ret) {
133 auto port = cast<ModuleType>(unwrap(type)).getPorts()[index];
134
136 switch (port.dir) {
137 case ModulePort::Direction::Input:
138 dir = HWModulePortDirection::Input;
139 break;
140 case ModulePort::Direction::Output:
141 dir = HWModulePortDirection::Output;
142 break;
143 case ModulePort::Direction::InOut:
144 dir = HWModulePortDirection::InOut;
145 break;
146 default:
147 llvm_unreachable("unknown ModulePort::Direction");
148 }
149
150 ret->name = wrap(static_cast<Attribute>(port.name));
151 ret->type = wrap(port.type);
152 ret->dir = dir;
153}
154
155bool hwTypeIsAStructType(MlirType type) {
156 return isa<StructType>(unwrap(type));
157}
158
159MlirType hwStructTypeGet(MlirContext ctx, intptr_t numElements,
160 HWStructFieldInfo const *elements) {
161 SmallVector<StructType::FieldInfo> fieldInfos;
162 fieldInfos.reserve(numElements);
163 for (intptr_t i = 0; i < numElements; ++i) {
164 fieldInfos.push_back(StructType::FieldInfo{
165 cast<StringAttr>(unwrap(elements[i].name)), unwrap(elements[i].type)});
166 }
167 return wrap(StructType::get(unwrap(ctx), fieldInfos));
168}
169
170MlirType hwStructTypeGetField(MlirType structType, MlirStringRef fieldName) {
171 StructType st = cast<StructType>(unwrap(structType));
172 return wrap(st.getFieldType(unwrap(fieldName)));
173}
174
175MlirAttribute hwStructTypeGetFieldIndex(MlirType structType,
176 MlirStringRef fieldName) {
177 StructType st = cast<StructType>(unwrap(structType));
178 if (auto idx = st.getFieldIndex(unwrap(fieldName)))
179 return wrap(IntegerAttr::get(IntegerType::get(st.getContext(), 32), *idx));
180 return wrap(UnitAttr::get(st.getContext()));
181}
182
183intptr_t hwStructTypeGetNumFields(MlirType structType) {
184 StructType st = cast<StructType>(unwrap(structType));
185 return st.getElements().size();
186}
187
188HWStructFieldInfo hwStructTypeGetFieldNum(MlirType structType, unsigned idx) {
189 StructType st = cast<StructType>(unwrap(structType));
190 auto cppField = st.getElements()[idx];
192 ret.name = wrap(cppField.name);
193 ret.type = wrap(cppField.type);
194 return ret;
195}
196
197bool hwTypeIsATypeAliasType(MlirType type) {
198 return isa<TypeAliasType>(unwrap(type));
199}
200
201MlirType hwTypeAliasTypeGet(MlirStringRef cScope, MlirStringRef cName,
202 MlirType cInnerType) {
203 StringRef scope = unwrap(cScope);
204 StringRef name = unwrap(cName);
205 Type innerType = unwrap(cInnerType);
206 FlatSymbolRefAttr nameRef =
207 FlatSymbolRefAttr::get(innerType.getContext(), name);
208 SymbolRefAttr ref =
209 SymbolRefAttr::get(innerType.getContext(), scope, {nameRef});
210 return wrap(TypeAliasType::get(ref, innerType));
211}
212
213MlirType hwTypeAliasTypeGetCanonicalType(MlirType typeAlias) {
214 TypeAliasType type = cast<TypeAliasType>(unwrap(typeAlias));
215 return wrap(type.getCanonicalType());
216}
217
218MlirType hwTypeAliasTypeGetInnerType(MlirType typeAlias) {
219 TypeAliasType type = cast<TypeAliasType>(unwrap(typeAlias));
220 return wrap(type.getInnerType());
221}
222
223MlirStringRef hwTypeAliasTypeGetName(MlirType typeAlias) {
224 TypeAliasType type = cast<TypeAliasType>(unwrap(typeAlias));
225 return wrap(type.getRef().getLeafReference().getValue());
226}
227
228MlirStringRef hwTypeAliasTypeGetScope(MlirType typeAlias) {
229 TypeAliasType type = cast<TypeAliasType>(unwrap(typeAlias));
230 return wrap(type.getRef().getRootReference().getValue());
231}
232
233//===----------------------------------------------------------------------===//
234// Attribute API.
235//===----------------------------------------------------------------------===//
236
237bool hwAttrIsAInnerSymAttr(MlirAttribute attr) {
238 return isa<InnerSymAttr>(unwrap(attr));
239}
240
241MlirAttribute hwInnerSymAttrGet(MlirAttribute symName) {
242 return wrap(InnerSymAttr::get(cast<StringAttr>(unwrap(symName))));
243}
244
245MlirAttribute hwInnerSymAttrGetEmpty(MlirContext ctx) {
246 return wrap(InnerSymAttr::get(unwrap(ctx)));
247}
248
249MlirAttribute hwInnerSymAttrGetSymName(MlirAttribute innerSymAttr) {
250 return wrap((Attribute)cast<InnerSymAttr>(unwrap(innerSymAttr)).getSymName());
251}
252
253bool hwAttrIsAInnerRefAttr(MlirAttribute attr) {
254 return isa<InnerRefAttr>(unwrap(attr));
255}
256
257MlirAttribute hwInnerRefAttrGet(MlirAttribute moduleName,
258 MlirAttribute innerSym) {
259 auto moduleNameAttr = cast<StringAttr>(unwrap(moduleName));
260 auto innerSymAttr = cast<StringAttr>(unwrap(innerSym));
261 return wrap(InnerRefAttr::get(moduleNameAttr, innerSymAttr));
262}
263
264MlirAttribute hwInnerRefAttrGetName(MlirAttribute innerRefAttr) {
265 return wrap((Attribute)cast<InnerRefAttr>(unwrap(innerRefAttr)).getName());
266}
267
268MlirAttribute hwInnerRefAttrGetModule(MlirAttribute innerRefAttr) {
269 return wrap((Attribute)cast<InnerRefAttr>(unwrap(innerRefAttr)).getModule());
270}
271
272MLIR_CAPI_EXPORTED bool hwAttrIsAParamDeclAttr(MlirAttribute attr) {
273 return isa<ParamDeclAttr>(unwrap(attr));
274}
275MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclAttrGet(MlirStringRef cName,
276 MlirType cType,
277 MlirAttribute cValue) {
278 auto type = unwrap(cType);
279 auto name = StringAttr::get(type.getContext(), unwrap(cName));
280 return wrap(
281 ParamDeclAttr::get(type.getContext(), name, type, unwrap(cValue)));
282}
283MLIR_CAPI_EXPORTED MlirStringRef hwParamDeclAttrGetName(MlirAttribute decl) {
284 return wrap(cast<ParamDeclAttr>(unwrap(decl)).getName().getValue());
285}
286MLIR_CAPI_EXPORTED MlirType hwParamDeclAttrGetType(MlirAttribute decl) {
287 return wrap(cast<ParamDeclAttr>(unwrap(decl)).getType());
288}
289MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclAttrGetValue(MlirAttribute decl) {
290 return wrap(cast<ParamDeclAttr>(unwrap(decl)).getValue());
291}
292
293MLIR_CAPI_EXPORTED bool hwAttrIsAParamDeclRefAttr(MlirAttribute attr) {
294 return isa<ParamDeclRefAttr>(unwrap(attr));
295}
296
297MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclRefAttrGet(MlirContext ctx,
298 MlirStringRef cName) {
299 auto name = StringAttr::get(unwrap(ctx), unwrap(cName));
300 return wrap(ParamDeclRefAttr::get(unwrap(ctx), name,
301 IntegerType::get(unwrap(ctx), 32)));
302}
303
304MLIR_CAPI_EXPORTED MlirStringRef hwParamDeclRefAttrGetName(MlirAttribute decl) {
305 return wrap(cast<ParamDeclRefAttr>(unwrap(decl)).getName().getValue());
306}
307MLIR_CAPI_EXPORTED MlirType hwParamDeclRefAttrGetType(MlirAttribute decl) {
308 return wrap(cast<ParamDeclRefAttr>(unwrap(decl)).getType());
309}
310
311MLIR_CAPI_EXPORTED bool hwAttrIsAParamVerbatimAttr(MlirAttribute attr) {
312 return isa<ParamVerbatimAttr>(unwrap(attr));
313}
314MLIR_CAPI_EXPORTED MlirAttribute hwParamVerbatimAttrGet(MlirAttribute text) {
315 auto textAttr = cast<StringAttr>(unwrap(text));
316 MLIRContext *ctx = textAttr.getContext();
317 auto type = NoneType::get(ctx);
318 return wrap(ParamVerbatimAttr::get(ctx, textAttr, type));
319}
320
321MLIR_CAPI_EXPORTED bool hwAttrIsAOutputFileAttr(MlirAttribute attr) {
322 return isa<OutputFileAttr>(unwrap(attr));
323}
324MLIR_CAPI_EXPORTED MlirAttribute
325hwOutputFileGetFromFileName(MlirAttribute fileName, bool excludeFromFileList,
326 bool includeReplicatedOp) {
327 auto fileNameStrAttr = cast<StringAttr>(unwrap(fileName));
328 return wrap(OutputFileAttr::getFromFilename(
329 fileNameStrAttr.getContext(), fileNameStrAttr.getValue(),
330 excludeFromFileList, includeReplicatedOp));
331}
332
333MlirStringRef hwOutputFileGetFileName(MlirAttribute outputFile) {
334 auto outputFileAttr = cast<OutputFileAttr>(unwrap(outputFile));
335 return wrap(outputFileAttr.getFilename().getValue());
336}
337
338MLIR_CAPI_EXPORTED HWInstanceGraph hwInstanceGraphGet(MlirOperation operation) {
339 return wrap(new InstanceGraph{unwrap(operation)});
340}
341
342MLIR_CAPI_EXPORTED void hwInstanceGraphDestroy(HWInstanceGraph instanceGraph) {
343 delete unwrap(instanceGraph);
344}
345
346MLIR_CAPI_EXPORTED HWInstanceGraphNode
347hwInstanceGraphGetTopLevelNode(HWInstanceGraph instanceGraph) {
348 return wrap(unwrap(instanceGraph)->getTopLevelNode());
349}
350
351MLIR_CAPI_EXPORTED void
352hwInstanceGraphForEachNode(HWInstanceGraph instanceGraph,
354 void *userData) {
355 InstanceGraph *graph = unwrap(instanceGraph);
356 for (const auto &inst : llvm::post_order(graph)) {
357 callback(wrap(inst), userData);
358 }
359}
360
361MLIR_CAPI_EXPORTED bool hwInstanceGraphNodeEqual(HWInstanceGraphNode lhs,
362 HWInstanceGraphNode rhs) {
363 return unwrap(lhs) == unwrap(rhs);
364}
365
366MLIR_CAPI_EXPORTED MlirModule
367hwInstanceGraphNodeGetModule(HWInstanceGraphNode node) {
368 return wrap(dyn_cast<ModuleOp>(unwrap(node)->getModule().getOperation()));
369}
370
371MLIR_CAPI_EXPORTED MlirOperation
372hwInstanceGraphNodeGetModuleOp(HWInstanceGraphNode node) {
373 return wrap(unwrap(node)->getModule());
374}
DEFINE_C_API_PTR_METHODS(CirctFirtoolFirtoolOptions, circt::firtool::FirtoolOptions) CirctFirtoolFirtoolOptions circtFirtoolOptionsCreateDefault()
Definition Firtool.cpp:18
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
MlirType uint64_t numElements
Definition CHIRRTL.cpp:30
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(CHIRRTL, chirrtl, circt::chirrtl::CHIRRTLDialect) MlirType chirrtlTypeGetCMemory(MlirContext ctx
static void registerPasses()
MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclAttrGet(MlirStringRef cName, MlirType cType, MlirAttribute cValue)
Definition HW.cpp:275
MlirAttribute hwInnerRefAttrGetModule(MlirAttribute innerRefAttr)
Definition HW.cpp:268
MLIR_CAPI_EXPORTED MlirType hwParamDeclAttrGetType(MlirAttribute decl)
Definition HW.cpp:286
MlirType hwInOutTypeGet(MlirType element)
Creates an HW inout type in the context associated with element.
Definition HW.cpp:66
MlirType hwArrayTypeGet(MlirType element, size_t size)
Creates a fixed-size HW array type in the context associated with element.
Definition HW.cpp:44
intptr_t hwArrayTypeGetSize(MlirType type)
returns the size of an array type
Definition HW.cpp:52
MlirType hwStructTypeGet(MlirContext ctx, intptr_t numElements, HWStructFieldInfo const *elements)
Creates an HW struct type in the context associated with the elements.
Definition HW.cpp:159
MlirType hwArrayTypeGetElementType(MlirType type)
returns the element type of an array type
Definition HW.cpp:48
MLIR_CAPI_EXPORTED HWInstanceGraphNode hwInstanceGraphGetTopLevelNode(HWInstanceGraph instanceGraph)
Definition HW.cpp:347
intptr_t hwModuleTypeGetNumInputs(MlirType type)
Get an HW module type's number of inputs.
Definition HW.cpp:108
MLIR_CAPI_EXPORTED MlirOperation hwInstanceGraphNodeGetModuleOp(HWInstanceGraphNode node)
Definition HW.cpp:372
intptr_t hwStructTypeGetNumFields(MlirType structType)
Definition HW.cpp:183
bool hwTypeIsAArrayType(MlirType type)
If the type is an HW array.
Definition HW.cpp:42
bool hwTypeIsATypeAliasType(MlirType type)
If the type is an HW type alias.
Definition HW.cpp:197
MlirType hwTypeAliasTypeGetInnerType(MlirType typeAlias)
Definition HW.cpp:218
MlirStringRef hwOutputFileGetFileName(MlirAttribute outputFile)
Definition HW.cpp:333
MlirType hwTypeAliasTypeGetCanonicalType(MlirType typeAlias)
Definition HW.cpp:213
MlirType hwStructTypeGetField(MlirType structType, MlirStringRef fieldName)
Definition HW.cpp:170
MlirAttribute hwInnerRefAttrGet(MlirAttribute moduleName, MlirAttribute innerSym)
Definition HW.cpp:257
MLIR_CAPI_EXPORTED bool hwInstanceGraphNodeEqual(HWInstanceGraphNode lhs, HWInstanceGraphNode rhs)
Definition HW.cpp:361
MLIR_CAPI_EXPORTED MlirModule hwInstanceGraphNodeGetModule(HWInstanceGraphNode node)
Definition HW.cpp:367
MLIR_CAPI_EXPORTED HWInstanceGraph hwInstanceGraphGet(MlirOperation operation)
Definition HW.cpp:338
bool hwTypeIsAIntType(MlirType type)
If the type is an HW int.
Definition HW.cpp:56
void hwModuleTypeGetPort(MlirType type, intptr_t index, HWModulePort *ret)
Get an HW module type's port info at a specific index.
Definition HW.cpp:132
MlirType hwModuleTypeGetInputType(MlirType type, intptr_t index)
Get an HW module type's input type at a specific index.
Definition HW.cpp:112
bool hwTypeIsAInOut(MlirType type)
If the type is an HW inout.
Definition HW.cpp:74
MlirStringRef hwModuleTypeGetInputName(MlirType type, intptr_t index)
Get an HW module type's input name at a specific index.
Definition HW.cpp:116
MlirType hwModuleTypeGet(MlirContext ctx, intptr_t numPorts, HWModulePort const *ports)
Creates an HW module type.
Definition HW.cpp:80
MlirAttribute hwStructTypeGetFieldIndex(MlirType structType, MlirStringRef fieldName)
Definition HW.cpp:175
MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclAttrGetValue(MlirAttribute decl)
Definition HW.cpp:289
MlirAttribute hwInnerSymAttrGetSymName(MlirAttribute innerSymAttr)
Definition HW.cpp:249
MlirAttribute hwInnerSymAttrGet(MlirAttribute symName)
Definition HW.cpp:241
MLIR_CAPI_EXPORTED void hwInstanceGraphDestroy(HWInstanceGraph instanceGraph)
Definition HW.cpp:342
MLIR_CAPI_EXPORTED void hwInstanceGraphForEachNode(HWInstanceGraph instanceGraph, HWInstanceGraphNodeCallback callback, void *userData)
Definition HW.cpp:352
MlirStringRef hwTypeAliasTypeGetScope(MlirType typeAlias)
Definition HW.cpp:228
MlirType hwInOutTypeGetElementType(MlirType type)
Returns the element type of an inout type.
Definition HW.cpp:70
MlirType hwTypeAliasTypeGet(MlirStringRef cScope, MlirStringRef cName, MlirType cInnerType)
Definition HW.cpp:201
bool hwTypeIsAValueType(MlirType type)
Return true if the specified type can be used as an HW value type, that is the set of types that can ...
Definition HW.cpp:40
bool hwAttrIsAInnerSymAttr(MlirAttribute attr)
Definition HW.cpp:237
MLIR_CAPI_EXPORTED bool hwAttrIsAParamVerbatimAttr(MlirAttribute attr)
Definition HW.cpp:311
bool hwTypeIsAStructType(MlirType type)
If the type is an HW struct.
Definition HW.cpp:155
MLIR_CAPI_EXPORTED bool hwAttrIsAOutputFileAttr(MlirAttribute attr)
Definition HW.cpp:321
MlirType hwParamIntTypeGet(MlirAttribute parameter)
Definition HW.cpp:58
MlirStringRef hwModuleTypeGetOutputName(MlirType type, intptr_t index)
Get an HW module type's output name at a specific index.
Definition HW.cpp:128
MLIR_CAPI_EXPORTED MlirAttribute hwOutputFileGetFromFileName(MlirAttribute fileName, bool excludeFromFileList, bool includeReplicatedOp)
Definition HW.cpp:325
MlirAttribute hwInnerRefAttrGetName(MlirAttribute innerRefAttr)
Definition HW.cpp:264
MlirAttribute hwInnerSymAttrGetEmpty(MlirContext ctx)
Definition HW.cpp:245
HWStructFieldInfo hwStructTypeGetFieldNum(MlirType structType, unsigned idx)
Definition HW.cpp:188
bool hwTypeIsAModuleType(MlirType type)
If the type is an HW module type.
Definition HW.cpp:76
MLIR_CAPI_EXPORTED bool hwAttrIsAParamDeclRefAttr(MlirAttribute attr)
Definition HW.cpp:293
int64_t hwGetBitWidth(MlirType type)
Return the hardware bit width of a type.
Definition HW.cpp:38
MLIR_CAPI_EXPORTED MlirStringRef hwParamDeclRefAttrGetName(MlirAttribute decl)
Definition HW.cpp:304
MlirStringRef hwTypeAliasTypeGetName(MlirType typeAlias)
Definition HW.cpp:223
void registerHWPasses()
Definition HW.cpp:32
bool hwAttrIsAInnerRefAttr(MlirAttribute attr)
Definition HW.cpp:253
MLIR_CAPI_EXPORTED MlirAttribute hwParamDeclRefAttrGet(MlirContext ctx, MlirStringRef cName)
Definition HW.cpp:297
MLIR_CAPI_EXPORTED bool hwAttrIsAParamDeclAttr(MlirAttribute attr)
Definition HW.cpp:272
MlirType hwModuleTypeGetOutputType(MlirType type, intptr_t index)
Get an HW module type's output type at a specific index.
Definition HW.cpp:124
MlirAttribute hwParamIntTypeGetWidthAttr(MlirType type)
Definition HW.cpp:62
intptr_t hwModuleTypeGetNumOutputs(MlirType type)
Get an HW module type's number of outputs.
Definition HW.cpp:120
MLIR_CAPI_EXPORTED MlirStringRef hwParamDeclAttrGetName(MlirAttribute decl)
Definition HW.cpp:283
MLIR_CAPI_EXPORTED MlirAttribute hwParamVerbatimAttrGet(MlirAttribute text)
Definition HW.cpp:314
MLIR_CAPI_EXPORTED MlirType hwParamDeclRefAttrGetType(MlirAttribute decl)
Definition HW.cpp:307
HWModulePortDirection
Definition HW.h:35
void(* HWInstanceGraphNodeCallback)(HWInstanceGraphNode, void *)
Definition HW.h:214
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
Definition OM.cpp:116
HW-specific instance graph with a virtual entry node linking to all publicly visible modules.
This is a Node in the InstanceGraph.
bool isHWValueType(mlir::Type type)
Return true if the specified type can be used as an HW value type, that is the set of types that can ...
int64_t getBitWidth(mlir::Type type)
Return the hardware bit width of a type.
Definition HWTypes.cpp:110
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition hw.py:1
HWModulePortDirection dir
Definition HW.h:41
MlirAttribute name
Definition HW.h:39
MlirType type
Definition HW.h:40
MlirIdentifier name
Definition HW.h:30
MlirType type
Definition HW.h:31