Skip to content

Commit 89655ab

Browse files
committed
[FIRRTL] Copy domain info in LowerOpenAggs
Fix an oversight in the `LowerOpenAggs` pass where it was not copying domain information to lowered bundles. Signed-off-by: Schuyler Eldridge <[email protected]>
1 parent 6c8c900 commit 89655ab

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/Dialect/FIRRTL/Transforms/LowerOpenAggs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ LogicalResult Visitor::visit(FModuleLike mod) {
306306
auto orientation =
307307
(Direction)((unsigned)port.direction ^ field.isFlip);
308308
PortInfo pi(name, field.type, orientation, /*symName=*/StringAttr{},
309-
port.loc, std::nullopt);
309+
port.loc, std::nullopt, port.domains);
310310
newPorts.emplace_back(idxOfInsertPoint, pi);
311311
}
312312
return success();

test/Dialect/FIRRTL/lower-open-aggs.mlir

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,19 @@ firrtl.circuit "NonHWWiresHaveDroppableNames" {
324324
%w = firrtl.wire interesting_name : !firrtl.openbundle<a: uint<1>, b: probe<uint<1>>>
325325
}
326326
}
327+
328+
// -----
329+
330+
// CHECK-LABEL: circuit "DomainInfo"
331+
firrtl.circuit "DomainInfo" {
332+
firrtl.domain @ClockDomain
333+
// CHECK: firrtl.module @DomainInfo
334+
// CHECK-SAME: out %a: !firrtl.bundle<b: uint<1>> domains [%A]
335+
// CHECK-SAME: out %a_c: !firrtl.probe<uint<1>> domains [%A]
336+
// CHECK-SAME: in %A: !firrtl.domain of @ClockDomain
337+
firrtl.module @DomainInfo(
338+
out %a: !firrtl.openbundle<b: uint<1>, c: probe<uint<1>>> domains [%A],
339+
in %A: !firrtl.domain of @ClockDomain
340+
) {
341+
}
342+
}

0 commit comments

Comments
 (0)