diff options
| author | Adam Izraelevitz | 2017-03-01 11:57:04 -0800 |
|---|---|---|
| committer | Adam Izraelevitz | 2017-03-03 17:08:26 -0800 |
| commit | c89f74f19dd5162ee533a0a20825819bc52bc73e (patch) | |
| tree | e45b72489fbc73a76e0572391d5680b1156827a7 /src/test | |
| parent | 7f280a5b0821c61284e9bf9ed7780cc825f7f3e8 (diff) | |
Bugfix: InlineInstances must prefix instances
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/InlineInstancesTests.scala | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/InlineInstancesTests.scala b/src/test/scala/firrtlTests/InlineInstancesTests.scala index a3e2b38d..89862145 100644 --- a/src/test/scala/firrtlTests/InlineInstancesTests.scala +++ b/src/test/scala/firrtlTests/InlineInstancesTests.scala @@ -170,6 +170,46 @@ class InlineInstancesTests extends LowTransformSpec { execute(writer, aMap, input, check) } + "Non-inlined instances" should "still prepend prefix" in { + val input = + """circuit Top : + | module Top : + | input a : UInt<32> + | output b : UInt<32> + | inst i of A + | i.a <= a + | b <= i.b + | module A : + | input a : UInt<32> + | output b : UInt<32> + | inst i of B + | i.a <= a + | b <= i.b + | module B : + | input a : UInt<32> + | output b : UInt<32> + | b <= a""".stripMargin + val check = + """circuit Top : + | module Top : + | input a : UInt<32> + | output b : UInt<32> + | wire i$a : UInt<32> + | wire i$b : UInt<32> + | inst i$i of B + | i$b <= i$i.b + | i$i.a <= i$a + | b <= i$b + | i$a <= a + | module B : + | input a : UInt<32> + | output b : UInt<32> + | b <= a""".stripMargin + val writer = new StringWriter() + val aMap = new AnnotationMap(Seq(InlineAnnotation(ModuleName("A", CircuitName("Top"))))) + execute(writer, aMap, input, check) + } + // ---- Errors ---- // 1) ext module "External module" should "not be inlined" in { |
