diff --git a/tools/hlstool/CMakeLists.txt b/tools/hlstool/CMakeLists.txt index 7821c15c7439..0a11c8fb0b9e 100644 --- a/tools/hlstool/CMakeLists.txt +++ b/tools/hlstool/CMakeLists.txt @@ -9,10 +9,14 @@ llvm_update_compile_flags(hlstool) target_link_libraries(hlstool PRIVATE + CIRCTDC + CIRCTDCTransforms + CIRCTDCToHW CIRCTESI CIRCTExportChiselInterface CIRCTExportVerilog CIRCTHandshake + CIRCTHandshakeToDC CIRCTHandshakeToHW CIRCTHandshakeTransforms CIRCTHW diff --git a/tools/hlstool/hlstool.cpp b/tools/hlstool/hlstool.cpp index 9d7f0a14e1c6..1605d2686c4c 100644 --- a/tools/hlstool/hlstool.cpp +++ b/tools/hlstool/hlstool.cpp @@ -46,6 +46,7 @@ #include "circt/Conversion/SCFToCalyx.h" #include "circt/Dialect/Calyx/CalyxDialect.h" #include "circt/Dialect/Calyx/CalyxPasses.h" +#include "circt/Dialect/DC/DCPasses.h" #include "circt/Dialect/ESI/ESIDialect.h" #include "circt/Dialect/ESI/ESIPasses.h" #include "circt/Dialect/SV/SVDialect.h" @@ -218,6 +219,9 @@ static cl::opt withESI("with-esi", cl::desc("Create ESI compatible modules"), cl::init(false), cl::cat(mainCategory)); +static cl::opt withDC("dc", cl::desc("Use the DC flow"), cl::init(false), + cl::cat(mainCategory)); + static LoweringOptionsOption loweringOptions(mainCategory); // -------------------------------------------------------------------------- @@ -332,7 +336,14 @@ static LogicalResult doHLSFlowDynamic( addIRLevel(IRLevel::RTL, [&]() { pm.nest().addPass(createSimpleCanonicalizerPass()); - pm.addPass(circt::createHandshakeToHWPass()); + if (withDC) { + pm.addPass(circt::createHandshakeToDCPass()); + pm.addPass(circt::dc::createDCMaterializeForksSinksPass()); + pm.addPass(createSimpleCanonicalizerPass()); + pm.addPass(circt::createDCToHWPass()); + } else { + pm.addPass(circt::createHandshakeToHWPass()); + } pm.addPass(createSimpleCanonicalizerPass()); loadESILoweringPipeline(pm); });