aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJim Lawson2016-12-14 17:09:51 -0800
committerGitHub2016-12-14 17:09:51 -0800
commit44146d59e19fb3697a6da3c834af34a1d45160e3 (patch)
treef1c77c9ac2bc2abe039609c5a47dc9078f7effed /src/test
parent73529eda60a3e411f3270c2bf7097234a4901ab0 (diff)
parent454d4637a45b5d70772e2831d2dc5af7864d806c (diff)
Merge branch 'master' into addmiddlefirrtlcompiler
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/transforms/DedupTests.scala32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/test/scala/firrtlTests/transforms/DedupTests.scala b/src/test/scala/firrtlTests/transforms/DedupTests.scala
index a17e6ae1..b23e9127 100644
--- a/src/test/scala/firrtlTests/transforms/DedupTests.scala
+++ b/src/test/scala/firrtlTests/transforms/DedupTests.scala
@@ -15,9 +15,10 @@ import firrtl.passes.PassExceptions
import firrtl.annotations.{
Named,
CircuitName,
+ ModuleName,
Annotation
}
-import firrtl.transforms.DedupModules
+import firrtl.transforms.{DedupModules, NoDedupAnnotation}
/**
@@ -127,6 +128,35 @@ class DedupModuleTests extends HighTransformSpec {
val aMap = new AnnotationMap(Nil)
execute(writer, aMap, input, check)
}
+ "The module B, but not A, with comments" should "be deduped if not annotated" in {
+ val input =
+ """circuit Top :
+ | module Top :
+ | inst a1 of A
+ | inst a2 of A_
+ | module A : @[yy 2:2]
+ | output x: UInt<1> @[yy 2:2]
+ | x <= UInt(1)
+ | module A_ : @[xx 1:1]
+ | output x: UInt<1> @[xx 1:1]
+ | x <= UInt(1)
+ """.stripMargin
+ val check =
+ """circuit Top :
+ | module Top :
+ | inst a1 of A
+ | inst a2 of A_
+ | module A : @[yy 2:2]
+ | output x: UInt<1> @[yy 2:2]
+ | x <= UInt(1)
+ | module A_ : @[xx 1:1]
+ | output x: UInt<1> @[xx 1:1]
+ | x <= UInt(1)
+ """.stripMargin
+ val writer = new StringWriter()
+ val aMap = new AnnotationMap(Seq(NoDedupAnnotation(ModuleName("A", CircuitName("Top")))))
+ execute(writer, aMap, input, check)
+ }
}
// Execution driven tests for inlining modules