summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Lawson2016-08-30 13:28:42 -0700
committerJim Lawson2016-08-30 13:28:42 -0700
commit000bba093609b74d0dbbc73490edac9ed756aa65 (patch)
tree5cae755822ebe1fc96d2d17a6453f5b6d0f471c4
parent1379a192ca1f6c05aeba454b81e19fb8356e6cf3 (diff)
Explicitly clone the target type in noenq() to avoid "already bound" errors for io ports.
-rw-r--r--src/main/scala/chisel3/util/Decoupled.scala3
1 files changed, 2 insertions, 1 deletions
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.