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