15 #include "mlir/Pass/Pass.h"
16 #include "llvm/Support/GraphWriter.h"
17 #include "llvm/Support/raw_ostream.h"
21 #define GEN_PASS_DEF_PRINTINSTANCEGRAPH
22 #include "circt/Dialect/HW/Passes.h.inc"
26 using namespace circt;
30 struct PrintInstanceGraphPass
31 :
public circt::hw::impl::PrintInstanceGraphBase<PrintInstanceGraphPass> {
32 PrintInstanceGraphPass(raw_ostream &os) : os(os) {}
33 void runOnOperation()
override {
35 llvm::WriteGraph(os, &instanceGraph,
false);
36 markAllAnalysesPreserved();
43 return std::make_unique<PrintInstanceGraphPass>(llvm::errs());
HW-specific instance graph with a virtual entry node linking to all publicly visible modules.
std::unique_ptr< mlir::Pass > createPrintInstanceGraphPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.