diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/InlineInstancesTests.scala | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/test/scala/firrtlTests/InlineInstancesTests.scala b/src/test/scala/firrtlTests/InlineInstancesTests.scala index 3e606667..320b187c 100644 --- a/src/test/scala/firrtlTests/InlineInstancesTests.scala +++ b/src/test/scala/firrtlTests/InlineInstancesTests.scala @@ -2,9 +2,14 @@ package firrtlTests +import firrtl._ import firrtl.annotations._ -import firrtl.passes.{InlineAnnotation, InlineInstances} +import firrtl.passes.{InlineAnnotation, InlineInstances, ResolveKinds} import firrtl.transforms.NoCircuitDedupAnnotation +import firrtl.stage.TransformManager +import firrtl.options.Dependency + +import FirrtlCheckers._ /** * Tests inline instances transformation @@ -537,6 +542,28 @@ class InlineInstancesTests extends LowTransformSpec { ) ) } + + "InlineInstances" should "properly invalidate ResolveKinds" in { + val input = + """circuit Top : + | module Top : + | input a : UInt<32> + | output b : UInt<32> + | inst i of Inline + | i.a <= a + | b <= i.b + | module Inline : + | input a : UInt<32> + | output b : UInt<32> + | b <= a""".stripMargin + + val state = CircuitState(parse(input), ChirrtlForm, Seq(inline("Inline"))) + val manager = new TransformManager(Seq(Dependency[InlineInstances], Dependency(ResolveKinds))) + val result = manager.execute(state) + + result shouldNot containTree { case WRef("i_a", _, PortKind, _) => true } + result should containTree { case WRef("i_a", _, WireKind, _) => true } + } } // Execution driven tests for inlining modules |
