summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJack Koenig2018-07-10 18:34:59 -0700
committerGitHub2018-07-10 18:34:59 -0700
commit61810bc68020e087f9464c9eceb574ed2127e44b (patch)
treed8a4389793925558ac7c5efd146ae08316b0f35c /src
parent9591d690f5a3d71fd5de7a0fb2d67a63e8079f48 (diff)
Fix use of read-only refs on rhs of connect in compatibility mode (#854)
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/CompatibilitySpec.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala
index d24c3b4d..eb38cab1 100644
--- a/src/test/scala/chiselTests/CompatibilitySpec.scala
+++ b/src/test/scala/chiselTests/CompatibilitySpec.scala
@@ -304,4 +304,22 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks
}
}
+ "Mux return value" should "be able to be used on the RHS" in {
+ import Chisel._
+ elaborate(new Module {
+ val gen = new Bundle { val foo = UInt(width = 8) }
+ val io = new Bundle {
+ val a = Vec(2, UInt(width = 8)).asInput
+ val b = Vec(2, UInt(width = 8)).asInput
+ val c = gen.asInput
+ val d = gen.asInput
+ val en = Bool(INPUT)
+ val y = Vec(2, UInt(width = 8)).asOutput
+ val z = gen.asOutput
+ }
+ io.y := Mux(io.en, io.a, io.b)
+ io.z := Mux(io.en, io.c, io.d)
+ })
+ }
+
}