[FIRRTL] use emitConnect more places

This commit is contained in:
Andrew Lenharth 2024-05-29 16:40:53 -05:00
parent ce012c04a1
commit 11fc8ab2b7
3 changed files with 9 additions and 8 deletions

View File

@ -5850,6 +5850,7 @@ void SubaccessOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
void SubfieldOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
genericAsmResultNames(*this, setNameFn);
}
void OpenSubfieldOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
genericAsmResultNames(*this, setNameFn);
}

View File

@ -126,7 +126,7 @@ static Value createZeroValue(ImplicitLocOpBuilder &builder, FIRRTLBaseType type,
auto zero = createZeroValue(builder, fieldType, cache);
auto acc =
builder.create<SubfieldOp>(fieldType, wireOp.getResult(), i);
builder.create<StrictConnectOp>(acc, zero);
emitConnect(builder, acc, zero);
}
return wireOp.getResult();
})
@ -137,7 +137,7 @@ static Value createZeroValue(ImplicitLocOpBuilder &builder, FIRRTLBaseType type,
for (unsigned i = 0, e = type.getNumElements(); i < e; ++i) {
auto acc = builder.create<SubindexOp>(zero.getType(),
wireOp.getResult(), i);
builder.create<StrictConnectOp>(acc, zero);
emitConnect(builder, acc, zero);
}
return wireOp.getResult();
})
@ -1703,7 +1703,7 @@ LogicalResult InferResetsPass::implementAsyncReset(FModuleOp module,
nodeOp.getResult().getType(), nodeOp.getNameAttr(),
nodeOp.getNameKindAttr(), nodeOp.getAnnotationsAttr(),
nodeOp.getInnerSymAttr(), nodeOp.getForceableAttr());
builder.create<StrictConnectOp>(wireOp.getResult(), nodeOp.getInput());
emitConnect(builder, wireOp.getResult(), nodeOp.getInput());
nodeOp->replaceAllUsesWith(wireOp);
nodeOp.erase();
resetOp = wireOp;
@ -1807,7 +1807,7 @@ void InferResetsPass::implementAsyncReset(Operation *op, FModuleOp module,
// Connect the instance's reset to the actual reset.
assert(instReset && actualReset);
builder.setInsertionPointAfter(instOp);
builder.create<StrictConnectOp>(instReset, actualReset);
emitConnect(builder, instReset, actualReset);
return;
}

View File

@ -469,15 +469,15 @@ void LowerCHIRRTLPass::replaceMem(Operation *cmem, StringRef name,
// At each location where we drive a value to the index, set the enable.
for (auto *driver : drivers) {
OpBuilder(driver).create<StrictConnectOp>(driver->getLoc(), enable,
getConst(1));
ImplicitLocOpBuilder builder(driver->getLoc(), driver);
emitConnect(builder, enable, getConst(1));
success = true;
}
} else if (isa<NodeOp>(indexOp)) {
// If using a Node for the address, then the we place the enable at the
// Node op's
OpBuilder(indexOp).create<StrictConnectOp>(indexOp->getLoc(), enable,
getConst(1));
ImplicitLocOpBuilder builder(indexOp->getLoc(), indexOp);
emitConnect(builder, enable, getConst(1));
success = true;
}