[ESI] Fix build and test broken by 5d759dd

Build break since inline {} doesn't work when multiple builders are present.
Test break since new convenience builders don't work for external parameterized
modules.
This commit is contained in:
John Demme 2021-09-12 17:01:17 -07:00
parent f7ff083296
commit 8a41c3f326
2 changed files with 15 additions and 8 deletions

View File

@ -851,9 +851,11 @@ LogicalResult PipelineStageLowering::matchAndRewrite(
circt::Backedge stageReady = back.get(rewriter.getI1Type());
Value operands[] = {stage.clk(), stage.rstn(), unwrap.rawOutput(),
unwrap.valid(), stageReady};
Type resultTypes[] = {rewriter.getI1Type(), unwrap.rawOutput().getType(),
rewriter.getI1Type()};
auto stageInst = rewriter.create<InstanceOp>(
loc, stageModule, pipeStageName, operands,
stageParams.getDictionary(rewriter.getContext()));
loc, resultTypes, pipeStageName, stageModule.getName(), operands,
stageParams.getDictionary(rewriter.getContext()), StringAttr());
auto stageInstResults = stageInst.getResults();
// Set a_ready (from the unwrap) back edge correctly to its output from stage.
@ -1078,7 +1080,7 @@ CosimLowering::matchAndRewrite(CosimEndpoint ep, ArrayRef<Value> operands,
Value send = operands[2];
circt::BackedgeBuilder bb(rewriter, loc);
auto endpointModule = builder.declareCosimEndpoint();
builder.declareCosimEndpoint();
Type ui64Type =
IntegerType::get(ctxt, 64, IntegerType::SignednessSemantics::Unsigned);
capnp::TypeSchema sendTypeSchema(send.getType());
@ -1120,8 +1122,11 @@ CosimLowering::matchAndRewrite(CosimEndpoint ep, ArrayRef<Value> operands,
Value epInstInputs[] = {
clk, rstn, recvReady, unwrapSend.valid(), encodeData.capnpBits(),
};
Type epInstOutputs[] = {rewriter.getI1Type(), ingestBitArrayType,
rewriter.getI1Type()};
auto cosimEpModule = rewriter.create<InstanceOp>(
loc, endpointModule, name, epInstInputs, params.getDictionary(ctxt));
loc, epInstOutputs, name, "Cosim_Endpoint", epInstInputs,
params.getDictionary(ctxt), StringAttr());
sendReady.setValue(cosimEpModule.getResult(2));
// Set up the injest path.

View File

@ -1267,8 +1267,9 @@ Value circt::esi::capnp::TypeSchema::buildEncoder(OpBuilder &builder, Value clk,
instName.append("encode");
instName.append(name());
instName.append("Inst");
auto encodeInst = builder.create<hw::InstanceOp>(
operand.getLoc(), encImplMod, instName, ValueRange{clk, valid, operand});
auto encodeInst =
builder.create<hw::InstanceOp>(operand.getLoc(), encImplMod, instName,
ArrayRef<Value>{clk, valid, operand});
return encodeInst.getResult(0);
}
@ -1288,7 +1289,8 @@ Value circt::esi::capnp::TypeSchema::buildDecoder(OpBuilder &builder, Value clk,
instName.append("decode");
instName.append(name());
instName.append("Inst");
auto decodeInst = builder.create<hw::InstanceOp>(
operand.getLoc(), decImplMod, instName, ValueRange{clk, valid, operand});
auto decodeInst =
builder.create<hw::InstanceOp>(operand.getLoc(), decImplMod, instName,
ArrayRef<Value>{clk, valid, operand});
return decodeInst.getResult(0);
}