15 #ifndef CIRCT_DIALECT_HW_INSTANCEIMPLEMENTATION_H
16 #define CIRCT_DIALECT_HW_INSTANCEIMPLEMENTATION_H
26 namespace instance_like_impl {
31 std::function<void(std::function<
bool(InFlightDiagnostic &)>)>;
35 Operation *instanceOp,
36 mlir::FlatSymbolRefAttr moduleName);
40 SymbolTableCollection &symbolTable,
41 mlir::FlatSymbolRefAttr moduleName,
49 SmallVectorImpl<Type> &resolvedTypes,
54 LogicalResult
verifyInputs(ArrayAttr argNames, ArrayAttr moduleArgNames,
56 ArrayRef<Type> moduleInputTypes,
61 LogicalResult
verifyOutputs(ArrayAttr resultNames, ArrayAttr moduleResultNames,
62 TypeRange resultTypes,
63 ArrayRef<Type> moduleResultTypes,
68 LogicalResult
verifyParameters(ArrayAttr parameters, ArrayAttr moduleParameters,
76 Operation *instance, FlatSymbolRefAttr moduleRef, OperandRange
inputs,
77 TypeRange results, ArrayAttr argNames, ArrayAttr resultNames,
78 ArrayAttr parameters, SymbolTableCollection &symbolTable);
83 ArrayAttr moduleParameters,
88 StringAttr
getName(ArrayAttr names,
size_t idx);
92 ArrayAttr
updateName(ArrayAttr oldNames,
size_t i, StringAttr name);
97 ArrayAttr resultNames, ValueRange results);
llvm::SmallVector< StringAttr > inputs
This stores lookup tables to make manipulating and working with the IR more efficient.
LogicalResult verifyParameterStructure(ArrayAttr parameters, ArrayAttr moduleParameters, const EmitErrorFn &emitError)
Check that all the parameter values specified to the instance are structurally valid.
Operation * getReferencedModule(const HWSymbolCache *cache, Operation *instanceOp, mlir::FlatSymbolRefAttr moduleName)
Return a pointer to the referenced module operation.
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.
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,...
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
function_ref< void(Value, StringRef)> OpAsmSetValueNameFn