diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/firrtl/transforms/Dedup.scala | 2 | ||||
| -rw-r--r-- | src/test/scala/firrtlTests/transforms/DedupTests.scala | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/main/scala/firrtl/transforms/Dedup.scala b/src/main/scala/firrtl/transforms/Dedup.scala index a33eeca6..56ea7cf8 100644 --- a/src/main/scala/firrtl/transforms/Dedup.scala +++ b/src/main/scala/firrtl/transforms/Dedup.scala @@ -335,7 +335,7 @@ object DedupModules { // Build tag val builder = new mutable.ArrayBuffer[Any]() agnosticModule.ports.foreach { builder ++= _.serialize } - builder ++= agnosticAnnos + builder += agnosticAnnos agnosticModule match { case Module(i, n, ps, b) => builder ++= fastSerializedHash(b).toString()//.serialize diff --git a/src/test/scala/firrtlTests/transforms/DedupTests.scala b/src/test/scala/firrtlTests/transforms/DedupTests.scala index 5ee2b927..d4fe54a1 100644 --- a/src/test/scala/firrtlTests/transforms/DedupTests.scala +++ b/src/test/scala/firrtlTests/transforms/DedupTests.scala @@ -376,6 +376,34 @@ class DedupModuleTests extends HighTransformSpec { """.stripMargin execute(input, check, Seq(dontTouch("A.b"), dontTouch("A_.b"))) } + "The module A and A_" should "be deduped with same annotation targets when there are a lot" in { + val input = + """circuit Top : + | module Top : + | inst a1 of A + | inst a2 of A_ + | module A : + | output x: UInt<1>[100] + | wire b: UInt<1>[100] + | x <= b + | module A_ : + | output x: UInt<1>[100] + | wire b: UInt<1>[100] + | x <= b + """.stripMargin + val check = + """circuit Top : + | module Top : + | inst a1 of A + | inst a2 of A + | module A : + | output x: UInt<1>[100] + | wire b: UInt<1>[100] + | x <= b + """.stripMargin + val annos = (0 until 100).flatMap(i => Seq(dontTouch(s"A.b[$i]"), dontTouch(s"A_.b[$i]"))) + execute(input, check, annos) + } "The module A and A_" should "not be deduped with same annotations with same multi-targets, but which have different root modules" in { val input = """circuit Top : |
