15 #include "mlir/Pass/Pass.h"
16 #include "llvm/Support/GraphWriter.h"
17 #include "llvm/Support/raw_ostream.h"
21 #define GEN_PASS_DEF_PRINTHWMODULEGRAPH
22 #include "circt/Dialect/HW/Passes.h.inc"
26 using namespace circt;
30 struct PrintHWModuleGraphPass
31 :
public circt::hw::impl::PrintHWModuleGraphBase<PrintHWModuleGraphPass> {
32 PrintHWModuleGraphPass(raw_ostream &os) : os(os) {}
33 void runOnOperation()
override {
38 module->setAttr(
"dot_verboseEdges",
41 llvm::WriteGraph(os, module,
false);
49 return std::make_unique<PrintHWModuleGraphPass>(llvm::errs());
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
std::unique_ptr< mlir::Pass > createPrintHWModuleGraphPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.