diff --git a/lib/Dialect/FIRRTL/Export/FIREmitter.cpp b/lib/Dialect/FIRRTL/Export/FIREmitter.cpp index 82b00f6f9f18..6fb7dbed770d 100644 --- a/lib/Dialect/FIRRTL/Export/FIREmitter.cpp +++ b/lib/Dialect/FIRRTL/Export/FIREmitter.cpp @@ -1378,6 +1378,14 @@ void Emitter::emitType(Type type, bool includeConst) { ps << "RW"; ps << "Probe<"; emitType(type.getType()); + if (auto layer = type.getLayer()) { + ps << "," << PP::nbsp; + ps.addAsString(layer.getRootReference().getValue()); + for (auto nested : layer.getNestedReferences()) { + ps << "."; + ps.addAsString(nested.getValue()); + } + } ps << ">"; }) .Case([&](AnyRefType type) { ps << "AnyRef"; }) diff --git a/test/Dialect/FIRRTL/emit-basic.mlir b/test/Dialect/FIRRTL/emit-basic.mlir index 5989c26fdc9e..52311f4dc451 100644 --- a/test/Dialect/FIRRTL/emit-basic.mlir +++ b/test/Dialect/FIRRTL/emit-basic.mlir @@ -704,13 +704,18 @@ firrtl.circuit "Foo" { } } // CHECK: module ModuleWithGroups : - // CHECK-NEXT: layerblock GroupA : + // CHECK-NEXT: output a : Probe, GroupA> + // CHECK-NEXT: output b : RWProbe, GroupA.GroupB> + // CHECK: layerblock GroupA : // CHECK-NEXT: layerblock GroupB : // CHECK-NEXT: layerblock GroupC : // CHECK-NEXT: layerblock GroupD : // CHECK-NEXT: layerblock GroupE : // CHECK-NEXT: layerblock GroupF : - firrtl.module @ModuleWithGroups() { + firrtl.module @ModuleWithGroups( + out %a: !firrtl.probe, @GroupA>, + out %b: !firrtl.rwprobe, @GroupA::@GroupB> + ) { firrtl.layerblock @GroupA { firrtl.layerblock @GroupA::@GroupB { firrtl.layerblock @GroupA::@GroupB::@GroupC {