CIRCT
18.0.0git
|
Typedefs | |
using | EmitErrorFn = std::function< void(std::function< bool(InFlightDiagnostic &)>)> |
Whenever the nested function returns true, a note referring to the referenced module is attached to the error. More... | |
Functions | |
Operation * | getReferencedModule (const HWSymbolCache *cache, Operation *instanceOp, mlir::FlatSymbolRefAttr moduleName) |
Return a pointer to the referenced module operation. More... | |
LogicalResult | verifyReferencedModule (Operation *instanceOp, SymbolTableCollection &symbolTable, mlir::FlatSymbolRefAttr moduleName, Operation *&module) |
Verify that the instance refers to a valid HW module. More... | |
LogicalResult | resolveParametricTypes (Location loc, ArrayAttr parameters, ArrayRef< Type > types, SmallVectorImpl< Type > &resolvedTypes, const EmitErrorFn &emitError) |
Stores a resolved version of each type in. More... | |
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, names, and types. More... | |
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, names, and types. More... | |
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, names, and types. More... | |
LogicalResult | verifyInstanceOfHWModule (Operation *instance, FlatSymbolRefAttr moduleRef, OperandRange inputs, TypeRange results, ArrayAttr argNames, ArrayAttr resultNames, ArrayAttr parameters, SymbolTableCollection &symbolTable) |
Combines verifyReferencedModule, verifyInputs, verifyOutputs, and verifyParameters. More... | |
LogicalResult | verifyParameterStructure (ArrayAttr parameters, ArrayAttr moduleParameters, const EmitErrorFn &emitError) |
Check that all the parameter values specified to the instance are structurally valid. More... | |
StringAttr | getName (ArrayAttr names, size_t idx) |
Return the name at the specified index of the ArrayAttr or null if it cannot be determined. More... | |
ArrayAttr | updateName (ArrayAttr oldNames, size_t i, StringAttr name) |
Change the name at the specified index of the. More... | |
void | getAsmResultNames (OpAsmSetValueNameFn setNameFn, StringRef instanceName, ArrayAttr resultNames, ValueRange results) |
Suggest a name for each result value based on the saved result names attribute. More... | |
using circt::hw::instance_like_impl::EmitErrorFn = typedef std::function<void(std::function<bool(InFlightDiagnostic &)>)> |
Whenever the nested function returns true, a note referring to the referenced module is attached to the error.
Definition at line 30 of file InstanceImplementation.h.
void circt::hw::instance_like_impl::getAsmResultNames | ( | OpAsmSetValueNameFn | setNameFn, |
StringRef | instanceName, | ||
ArrayAttr | resultNames, | ||
ValueRange | results | ||
) |
Suggest a name for each result value based on the saved result names attribute.
Definition at line 336 of file InstanceImplementation.cpp.
References getName().
StringAttr circt::hw::instance_like_impl::getName | ( | ArrayAttr | names, |
size_t | idx | ||
) |
Return the name at the specified index of the ArrayAttr or null if it cannot be determined.
Definition at line 320 of file InstanceImplementation.cpp.
Referenced by circtESIAppIDAttrGetName(), VariableEmitter::emitInlined(), getAsmResultNames(), hwInnerRefAttrGetName(), hwParamDeclAttrGetName(), hwParamDeclRefAttrGetName(), namedPort(), circt::firrtl::operator<<(), DiscoverLoops::reportLoopFound(), ModuleNameSanitizer::rewrite(), SFCCompatPass::runOnOperation(), and svSVAttributeAttrGetName().
Operation * circt::hw::instance_like_impl::getReferencedModule | ( | const HWSymbolCache * | cache, |
Operation * | instanceOp, | ||
mlir::FlatSymbolRefAttr | moduleName | ||
) |
Return a pointer to the referenced module operation.
Definition at line 17 of file InstanceImplementation.cpp.
References circt::hw::HWSymbolCache::getDefinition().
Referenced by verifyReferencedModule().
LogicalResult circt::hw::instance_like_impl::resolveParametricTypes | ( | Location | loc, |
ArrayAttr | parameters, | ||
ArrayRef< Type > | types, | ||
SmallVectorImpl< Type > & | resolvedTypes, | ||
const EmitErrorFn & | emitError | ||
) |
Stores a resolved version of each type in.
types | wherein any parameter reference has been evaluated based on the set of provided |
parameters | in |
resolvedTypes |
Definition at line 44 of file InstanceImplementation.cpp.
References circt::hw::evaluateParametricType().
Referenced by verifyInstanceOfHWModule().
ArrayAttr circt::hw::instance_like_impl::updateName | ( | ArrayAttr | oldNames, |
size_t | i, | ||
StringAttr | name | ||
) |
Change the name at the specified index of the.
oldNames | ArrayAttr to |
name |
Definition at line 327 of file InstanceImplementation.cpp.
References circt::calyx::direction::get().
LogicalResult circt::hw::instance_like_impl::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, names, and types.
Definition at line 63 of file InstanceImplementation.cpp.
Referenced by verifyInstanceOfHWModule().
LogicalResult circt::hw::instance_like_impl::verifyInstanceOfHWModule | ( | Operation * | instance, |
FlatSymbolRefAttr | moduleRef, | ||
OperandRange | inputs, | ||
TypeRange | results, | ||
ArrayAttr | argNames, | ||
ArrayAttr | resultNames, | ||
ArrayAttr | parameters, | ||
SymbolTableCollection & | symbolTable | ||
) |
Combines verifyReferencedModule, verifyInputs, verifyOutputs, and verifyParameters.
It is only allowed to call this function when the instance refers to a HW module. The
parameters | attribute may be null in which case not parameters are verified. |
Definition at line 213 of file InstanceImplementation.cpp.
References circt::calyx::direction::get(), circt::hw::getModuleType(), inputs, resolveParametricTypes(), verifyInputs(), verifyOutputs(), verifyParameters(), and verifyReferencedModule().
LogicalResult circt::hw::instance_like_impl::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, names, and types.
Definition at line 113 of file InstanceImplementation.cpp.
Referenced by verifyInstanceOfHWModule().
LogicalResult circt::hw::instance_like_impl::verifyParameters | ( | ArrayAttr | parameters, |
ArrayAttr | moduleParameters, | ||
const EmitErrorFn & | emitError | ||
) |
Verify that the parameter lists of the instance and the module match in terms of length, names, and types.
Definition at line 162 of file InstanceImplementation.cpp.
Referenced by verifyInstanceOfHWModule().
LogicalResult circt::hw::instance_like_impl::verifyParameterStructure | ( | ArrayAttr | parameters, |
ArrayAttr | moduleParameters, | ||
const EmitErrorFn & | emitError | ||
) |
Check that all the parameter values specified to the instance are structurally valid.
Definition at line 282 of file InstanceImplementation.cpp.
References circt::hw::checkParameterInContext().
LogicalResult circt::hw::instance_like_impl::verifyReferencedModule | ( | Operation * | instanceOp, |
SymbolTableCollection & | symbolTable, | ||
mlir::FlatSymbolRefAttr | moduleName, | ||
Operation *& | module | ||
) |
Verify that the instance refers to a valid HW module.
Definition at line 28 of file InstanceImplementation.cpp.
References getReferencedModule().
Referenced by verifyInstanceOfHWModule().