aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJack Koenig2018-12-06 15:23:08 -0800
committerGitHub2018-12-06 15:23:08 -0800
commit50ba95fe05cc348496425733554be5fc7d797de1 (patch)
tree447b6cb3d10c0d7f2d02eacd4a5628e784ec1302 /src/test
parent9787e6a877375008645481f39388728436c85829 (diff)
Fix bug in dedup where lots of annotations could prevent dedup (#958)
Iterating on a HashSet could cause identical modules (including annotations) to not dedup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/transforms/DedupTests.scala28
1 files changed, 28 insertions, 0 deletions
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 :