Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MooreToCore] Fix parse error for parameter #7253

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Conversion/MooreToCore/MooreToCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct NamedConstantOpConv : public OpConversionPattern<NamedConstantOp> {
break;
}
auto symAttr =
rewriter.getStringAttr(symStr + Twine(":") + adaptor.getName());
rewriter.getStringAttr(symStr + Twine("_") + adaptor.getName());
rewriter.replaceOpWithNewOp<hw::WireOp>(op, resultType, adaptor.getValue(),
op.getNameAttr(),
hw::InnerSymAttr::get(symAttr));
Expand Down
6 changes: 3 additions & 3 deletions test/Conversion/MooreToCore/basic.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,17 @@ moore.module @SubModule_0(in %a : !moore.l1, in %b : !moore.l1, out c : !moore.l
moore.module @ParamTest(){

// CHECK-NEXT: [[Pa:%.+]] = hw.constant 1 : i32
// CHECK-NEXT: %p1 = hw.wire [[Pa]] sym @parameter:p1 : i32
// CHECK-NEXT: %p1 = hw.wire [[Pa]] sym @parameter_p1 : i32
%0 = moore.constant 1 : l32
%p1 = moore.named_constant parameter %0 : l32

// CHECK-NEXT: [[LPa:%.+]] = hw.constant 2 : i32
// CHECK-NEXT: %lp1 = hw.wire [[LPa]] sym @localparameter:lp1 : i32
// CHECK-NEXT: %lp1 = hw.wire [[LPa]] sym @localparameter_lp1 : i32
%1 = moore.constant 2 : l32
%lp1 = moore.named_constant localparam %1 : l32

// CHECK-NEXT: [[SPa:%.+]] = hw.constant 3 : i32
// CHECK-NEXT: %sp1 = hw.wire [[SPa]] sym @specparameter:sp1 : i32
// CHECK-NEXT: %sp1 = hw.wire [[SPa]] sym @specparameter_sp1 : i32
%2 = moore.constant 3 : l32
%sp1 = moore.named_constant specparam %2 : l32
}
Loading