From 000bba093609b74d0dbbc73490edac9ed756aa65 Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Tue, 30 Aug 2016 13:28:42 -0700 Subject: Explicitly clone the target type in noenq() to avoid "already bound" errors for io ports. --- src/main/scala/chisel3/util/Decoupled.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/scala/chisel3/util/Decoupled.scala b/src/main/scala/chisel3/util/Decoupled.scala index 63831d2f..5ce2583c 100644 --- a/src/main/scala/chisel3/util/Decoupled.scala +++ b/src/main/scala/chisel3/util/Decoupled.scala @@ -40,7 +40,8 @@ object DecoupledIO { */ def noenq(): Unit = { target.valid := Bool(false) - target.bits := target.bits.fromBits(0.asUInt) + // We want the type from the following, not any existing binding. + target.bits := target.bits.cloneType.fromBits(0.asUInt) } /** Assert ready on this port and return the associated data bits. -- cgit v1.2.3