10 #include "mlir/IR/BuiltinOps.h"
12 using namespace circt;
13 using namespace firrtl;
16 if (
auto mod = dyn_cast<mlir::ModuleOp>(operation))
17 for (
auto &op : *mod.getBody())
18 if (
auto circuit = dyn_cast<CircuitOp>(&op))
20 return cast<CircuitOp>(operation);
static CircuitOp findCircuitOp(Operation *operation)
This graph tracks modules and where they are instantiated.
InstanceGraphNode * topLevelNode
InstanceGraph(Operation *operation)
Create a new module graph of a circuit.
InstanceGraphNode * lookup(ModuleOpInterface op)
Look up an InstanceGraphNode for a module.
Operation * getParent()
Return the parent under which all nodes are nested.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.