diff options
| author | David Biancolin | 2021-09-29 13:55:32 -0700 |
|---|---|---|
| committer | GitHub | 2021-09-29 20:55:32 +0000 |
| commit | b81de69928b765949be0c79dea1d0cc714a31aa1 (patch) | |
| tree | 242abff1b43ea9a56b1f4351751cf7d01c906347 /src/main/scala/firrtl/transforms/Flatten.scala | |
| parent | e70ee5367c864e55ff16637430b712666b7dbd2b (diff) | |
Have Flatten & InlineInstances remove their annotations (#2374)
* Have Flatten & InlineInstances remove their annotations
* Format
Diffstat (limited to 'src/main/scala/firrtl/transforms/Flatten.scala')
| -rw-r--r-- | src/main/scala/firrtl/transforms/Flatten.scala | 9 |
1 files changed, 8 insertions, 1 deletions
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) } } } |
