From b81de69928b765949be0c79dea1d0cc714a31aa1 Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Wed, 29 Sep 2021 13:55:32 -0700 Subject: Have Flatten & InlineInstances remove their annotations (#2374) * Have Flatten & InlineInstances remove their annotations * Format--- src/main/scala/firrtl/transforms/Flatten.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/scala/firrtl/transforms') diff --git a/src/main/scala/firrtl/transforms/Flatten.scala b/src/main/scala/firrtl/transforms/Flatten.scala index 1d9f8083..0aa155bd 100644 --- a/src/main/scala/firrtl/transforms/Flatten.scala +++ b/src/main/scala/firrtl/transforms/Flatten.scala @@ -132,7 +132,14 @@ class Flatten extends Transform with DependencyAPIMigration { val (modNames, instNames) = collectAnns(state.circuit, myAnnotations) // take incoming annotation and produce annotations for InlineInstances, i.e. traverse circuit down to find all instances to inline val (newc, modsToInline) = duplicateSubCircuitsFromAnno(state.circuit, modNames, instNames) - inlineTransform.run(newc, modsToInline.toSet, Set.empty[ComponentName], state.annotations) + val flattenedState = inlineTransform.run(newc, modsToInline.toSet, Set.empty[ComponentName], state.annotations) + + val cleanedAnnos = flattenedState.annotations.filterNot { + case FlattenAnnotation(_) => true + case _ => false + } + + flattenedState.copy(annotations = cleanedAnnos) } } } -- cgit v1.2.3