17 #include "mlir/IR/BuiltinTypes.h"
18 #include "mlir/IR/OperationSupport.h"
22 #define GEN_PASS_DEF_GOINSERTION
23 #include "circt/Dialect/Calyx/CalyxPasses.h.inc"
27 using namespace circt;
28 using namespace calyx;
33 struct GoInsertionPass
34 :
public circt::calyx::impl::GoInsertionBase<GoInsertionPass> {
35 void runOnOperation()
override;
40 void GoInsertionPass::runOnOperation() {
41 ComponentOp component = getOperation();
42 auto wiresOp = component.getWiresOp();
44 OpBuilder builder(wiresOp->getRegion(0));
46 builder.create<UndefinedOp>(wiresOp->getLoc(), builder.getI1Type());
48 wiresOp.walk([&](GroupOp group) {
49 OpBuilder builder(group->getRegion(0));
52 auto goOp = builder.create<GroupGoOp>(group->getLoc(), undefinedOp);
59 return std::make_unique<GoInsertionPass>();
static void updateGroupAssignmentGuards(OpBuilder &builder, GroupOp &group, Op &op)
Updates the guard of each assignment within a group with op.
std::unique_ptr< mlir::Pass > createGoInsertionPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.