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

[FIRRTL] Add inline convention to layers #6980

Merged
merged 2 commits into from
May 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
4 changes: 3 additions & 1 deletion include/circt/Dialect/FIRRTL/FIRRTLEnums.td
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def ConventionAttr : EnumAttr<FIRRTLDialect, Convention, "convention">;
//===----------------------------------------------------------------------===//

def LayerConvention : I32EnumAttr<"LayerConvention", "layer convention", [
I32EnumAttrCase<"Bind", 0, "bind">]> {
I32EnumAttrCase<"Bind", 0, "bind">,
I32EnumAttrCase<"Inline", 1, "inline">
]> {

let genSpecializedAttr = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions test/Dialect/FIRRTL/emit-basic.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,14 @@ firrtl.circuit "Foo" {
// CHECK-NEXT: layer GroupB, bind :
// CHECK-NEXT: layer GroupC, bind :
// CHECK-NEXT: layer GroupD, bind :
// CHECK-NEXT: layer GroupE, bind :
// CHECK-NEXT: layer GroupE, inline :
// CHECK-NEXT: layer GroupF, bind :
firrtl.layer @GroupA bind {
firrtl.layer @GroupB bind {
firrtl.layer @GroupC bind {
}
firrtl.layer @GroupD bind {
firrtl.layer @GroupE bind {
firrtl.layer @GroupE inline {
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/Dialect/FIRRTL/parse-basic.fir
Original file line number Diff line number Diff line change
Expand Up @@ -1470,14 +1470,14 @@ circuit Layers:
layer B, bind:
layer C, bind:
layer D, bind:
layer E, bind:
layer E, inline:
layer F, bind:
; CHECK-NEXT: firrtl.layer @A bind {
; CHECK-NEXT: firrtl.layer @B bind {
; CHECK-NEXT: firrtl.layer @C bind {
; CHECK-NEXT: }
; CHECK-NEXT: firrtl.layer @D bind {
; CHECK-NEXT: firrtl.layer @E bind {
; CHECK-NEXT: firrtl.layer @E inline {
; CHECK-NEXT: }
; CHECK-NEXT: }
; CHECK-NEXT: }
Expand Down
4 changes: 3 additions & 1 deletion test/Dialect/FIRRTL/round-trip.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ firrtl.module @Foo(in %clock: !firrtl.clock) {
firrtl.strictconnect %inst_clock, %clock : !firrtl.clock
}

// CHECK-LABEL: firrtl.layer @LayerA bind
// CHECK-NEXT: firrtl.layer @LayerB inline
firrtl.layer @LayerA bind {
firrtl.layer @LayerB bind {}
firrtl.layer @LayerB inline {}
}

// CHECK-LABEL: firrtl.module @Layers
Expand Down
Loading