From d824c60c9643973e0ae9cddc5007b3d9592f8a52 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Wed, 17 May 2017 20:13:26 -0700 Subject: Make sure not to DCE input-only extmodules unless specified (#590) Fixes #589--- src/test/scala/firrtlTests/DCETests.scala | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/DCETests.scala b/src/test/scala/firrtlTests/DCETests.scala index deb73b3b..129460e1 100644 --- a/src/test/scala/firrtlTests/DCETests.scala +++ b/src/test/scala/firrtlTests/DCETests.scala @@ -254,6 +254,29 @@ class DCETests extends FirrtlFlatSpec { | z <= x""".stripMargin exec(input, check) } + "Extmodule with only inputs" should "NOT be deleted by default" in { + val input = + """circuit Top : + | extmodule InputsOnly : + | input x : UInt<1> + | module Top : + | input x : UInt<1> + | output z : UInt<1> + | inst ext of InputsOnly + | ext.x <= x + | z <= x""".stripMargin + val check = + """circuit Top : + | extmodule InputsOnly : + | input x : UInt<1> + | module Top : + | input x : UInt<1> + | output z : UInt<1> + | inst ext of InputsOnly + | ext.x <= x + | z <= x""".stripMargin + exec(input, check) + } "Globally dead extmodule marked optimizable" should "be deleted" in { val input = """circuit Top : -- cgit v1.2.3