12 using namespace circt;
16 auto inst = dyn_cast<DynamicInstanceOp>(op->getParentOp());
17 FlatSymbolRefAttr pathRef =
18 cast<UnaryDynInstDataOpInterface>(op).getPathSym();
21 return op->emitOpError(
"cannot both have a global ref symbol and be a "
22 "child of a dynamic instance op");
23 if (!inst && !pathRef)
24 return op->emitOpError(
"must have either a global ref symbol of belong to "
25 "a dynamic instance op");
31 FlatSymbolRefAttr pathSym) {
32 assert(pathSym &&
"pathSym must be non-null");
33 auto ref = dyn_cast_or_null<hw::HierPathOp>(symCache.
getDefinition(pathSym));
35 emitError(loc) <<
"could not find hw.hierpath " << pathSym;
38 if (ref.getNamepath().empty())
41 cast<hw::InnerRefAttr>(ref.getNamepath()[0]).getModule());
47 #include "circt/Dialect/MSFT/MSFTOpInterfaces.cpp.inc"
assert(baseType &&"element must be base type")
This stores lookup tables to make manipulating and working with the IR more efficient.
mlir::Operation * getDefinition(mlir::Attribute attr) const override
Lookup a definition for 'symbol' in the cache.
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
LogicalResult verifyUnaryDynInstDataOp(Operation *)
Operation * getHierPathTopModule(Location loc, circt::hw::HWSymbolCache &symCache, FlatSymbolRefAttr pathSym)
Returns the top-level module which the given HierPathOp that defines pathSym, refers to.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.