15 #ifndef CIRCT_DIALECT_HW_HWINSTANCEIMPLEMENTATION_H
16 #define CIRCT_DIALECT_HW_HWINSTANCEIMPLEMENTATION_H
27 namespace instance_like_impl {
32 std::function<void(std::function<
bool(InFlightDiagnostic &)>)>;
36 SymbolTableCollection &symbolTable,
37 mlir::FlatSymbolRefAttr moduleName,
45 SmallVectorImpl<Type> &resolvedTypes,
50 LogicalResult
verifyInputs(ArrayAttr argNames, ArrayAttr moduleArgNames,
52 ArrayRef<Type> moduleInputTypes,
57 LogicalResult
verifyOutputs(ArrayAttr resultNames, ArrayAttr moduleResultNames,
58 TypeRange resultTypes,
59 ArrayRef<Type> moduleResultTypes,
64 LogicalResult
verifyParameters(ArrayAttr parameters, ArrayAttr moduleParameters,
72 Operation *instance, FlatSymbolRefAttr moduleRef, OperandRange inputs,
73 TypeRange results, ArrayAttr argNames, ArrayAttr resultNames,
74 ArrayAttr parameters, SymbolTableCollection &symbolTable);
79 ArrayAttr moduleParameters,
84 StringAttr
getName(ArrayAttr names,
size_t idx);
88 ArrayAttr
updateName(ArrayAttr oldNames,
size_t i, StringAttr name);
93 ArrayAttr resultNames, ValueRange results);
97 SmallVector<PortInfo>
getPortList(Operation *instanceOp);
LogicalResult verifyParameterStructure(ArrayAttr parameters, ArrayAttr moduleParameters, const EmitErrorFn &emitError)
Check that all the parameter values specified to the instance are structurally valid.
std::function< void(std::function< bool(InFlightDiagnostic &)>)> EmitErrorFn
Whenever the nested function returns true, a note referring to the referenced module is attached to t...
LogicalResult verifyOutputs(ArrayAttr resultNames, ArrayAttr moduleResultNames, TypeRange resultTypes, ArrayRef< Type > moduleResultTypes, const EmitErrorFn &emitError)
Verify that the list of outputs of the instance and the module match in terms of length,...
LogicalResult verifyInstanceOfHWModule(Operation *instance, FlatSymbolRefAttr moduleRef, OperandRange inputs, TypeRange results, ArrayAttr argNames, ArrayAttr resultNames, ArrayAttr parameters, SymbolTableCollection &symbolTable)
Combines verifyReferencedModule, verifyInputs, verifyOutputs, and verifyParameters.
SmallVector< PortInfo > getPortList(Operation *instanceOp)
Return the port list of an instance, based on the name, type and location attributes present on the i...
StringAttr getName(ArrayAttr names, size_t idx)
Return the name at the specified index of the ArrayAttr or null if it cannot be determined.
LogicalResult resolveParametricTypes(Location loc, ArrayAttr parameters, ArrayRef< Type > types, SmallVectorImpl< Type > &resolvedTypes, const EmitErrorFn &emitError)
Stores a resolved version of each type in.
LogicalResult verifyInputs(ArrayAttr argNames, ArrayAttr moduleArgNames, TypeRange inputTypes, ArrayRef< Type > moduleInputTypes, const EmitErrorFn &emitError)
Verify that the list of inputs of the instance and the module match in terms of length,...
ArrayAttr updateName(ArrayAttr oldNames, size_t i, StringAttr name)
Change the name at the specified index of the.
LogicalResult verifyReferencedModule(Operation *instanceOp, SymbolTableCollection &symbolTable, mlir::FlatSymbolRefAttr moduleName, Operation *&module)
Verify that the instance refers to a valid HW module.
void getAsmResultNames(OpAsmSetValueNameFn setNameFn, StringRef instanceName, ArrayAttr resultNames, ValueRange results)
Suggest a name for each result value based on the saved result names attribute.
LogicalResult verifyParameters(ArrayAttr parameters, ArrayAttr moduleParameters, const EmitErrorFn &emitError)
Verify that the parameter lists of the instance and the module match in terms of length,...
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
function_ref< void(Value, StringRef)> OpAsmSetValueNameFn