From 61810bc68020e087f9464c9eceb574ed2127e44b Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 10 Jul 2018 18:34:59 -0700 Subject: Fix use of read-only refs on rhs of connect in compatibility mode (#854) --- src/test/scala/chiselTests/CompatibilitySpec.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') 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) + }) + } + } -- cgit v1.2.3