diff --git a/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp b/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp index ee3790679bba..5f12fd419bec 100644 --- a/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp +++ b/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp @@ -819,8 +819,11 @@ LogicalResult circt::handshaketodc::runHandshakeToDC( // same type as the newly inserted operations). To do this, we mark all // operations which have been converted as legal, and all other operations // as illegal. - target.markUnknownOpDynamicallyLegal( - [&](Operation *op) { return convertedOps.contains(op); }); + target.markUnknownOpDynamicallyLegal([&](Operation *op) { + return convertedOps.contains(op) || + // Allow any ops which weren't in a `handshake.func` to pass through. + !convertedOps.contains(op->getParentOfType()); + }); DCTypeConverter typeConverter; RewritePatternSet patterns(ctx); diff --git a/test/Conversion/HandshakeToDC/basic.mlir b/test/Conversion/HandshakeToDC/basic.mlir index 081b87686c6d..e8c0d569b43c 100644 --- a/test/Conversion/HandshakeToDC/basic.mlir +++ b/test/Conversion/HandshakeToDC/basic.mlir @@ -261,3 +261,6 @@ hw.module @esi_outer(in %clk: !seq.clock, in %rst: i1, in %arg0: !esi.channel, !esi.channel) -> (!esi.channel, !esi.channel) hw.output %ret0 : !esi.channel } + +// CHECK: sv.verbatim "// Blah" +sv.verbatim "// Blah"