summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
diff options
context:
space:
mode:
authorJack Koenig2017-12-20 15:54:25 -0800
committerGitHub2017-12-20 15:54:25 -0800
commite27657118ff5915b96f8e3a467d464245fe09769 (patch)
tree2353d94bc70fa006639bf5019bde366b15e82b29 /src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
parent0f5ba51572b22ff5c85f9dd1add82680e0620797 (diff)
Add compileOptions to Module.apply, use for invalidating submod ports (#747)
Fixes #746 Also add test for https://github.com/freechipsproject/firrtl/issues/705
Diffstat (limited to 'src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala')
-rw-r--r--src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala b/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
index c0538123..457f26de 100644
--- a/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
+++ b/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
@@ -217,5 +217,27 @@ class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
stop()
})
}
+
+ "An instance of a chisel3.Module inside a Chisel.Module" should "have its inputs invalidated" in {
+ compile {
+ import Chisel._
+ new Module {
+ val io = new Bundle {
+ val in = UInt(INPUT, width = 32)
+ val cond = Bool(INPUT)
+ val out = UInt(OUTPUT, width = 32)
+ }
+ val children = Seq(Module(new PassthroughModule),
+ Module(new PassthroughMultiIOModule),
+ Module(new PassthroughRawModule))
+ io.out := children.map(_.io.out).reduce(_ + _)
+ children.foreach { child =>
+ when (io.cond) {
+ child.io.in := io.in
+ }
+ }
+ }
+ }
+ }
}