aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ExpandWhensSpec.scala
diff options
context:
space:
mode:
authorJack Koenig2017-12-20 13:18:33 -0800
committerGitHub2017-12-20 13:18:33 -0800
commit4801d9cbc3cd957496daa00b099ead15f9f4e17d (patch)
treeec92d7648107c8c79c4c3035aa9b684db461d30c /src/test/scala/firrtlTests/ExpandWhensSpec.scala
parente3ea1000d4e4cce40fb7f583a55f4bd30115eb5d (diff)
Make submodule inputs void in ExpandWhens (#706)
Diffstat (limited to 'src/test/scala/firrtlTests/ExpandWhensSpec.scala')
-rw-r--r--src/test/scala/firrtlTests/ExpandWhensSpec.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ExpandWhensSpec.scala b/src/test/scala/firrtlTests/ExpandWhensSpec.scala
index 66f39a3d..3532ce00 100644
--- a/src/test/scala/firrtlTests/ExpandWhensSpec.scala
+++ b/src/test/scala/firrtlTests/ExpandWhensSpec.scala
@@ -122,6 +122,22 @@ class ExpandWhensSpec extends FirrtlFlatSpec {
val check = "w is invalid"
executeTest(input, check, false)
}
+ it should "correctly handle submodule inputs" in {
+ val input =
+ """circuit Test :
+ | module Child :
+ | input in : UInt<32>
+ | module Test :
+ | input in : UInt<32>[2]
+ | input p : UInt<1>
+ | inst c of Child
+ | when p :
+ | c.in <= in[0]
+ | else :
+ | c.in <= in[1]""".stripMargin
+ val check = "mux(p, in[0], in[1])"
+ executeTest(input, check, true)
+ }
}
class ExpandWhensExecutionTest extends ExecutionTest("ExpandWhens", "/passes/ExpandWhens")