diff options
| author | Jim Lawson | 2016-08-30 13:28:42 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-08-30 13:28:42 -0700 |
| commit | 000bba093609b74d0dbbc73490edac9ed756aa65 (patch) | |
| tree | 5cae755822ebe1fc96d2d17a6453f5b6d0f471c4 | |
| parent | 1379a192ca1f6c05aeba454b81e19fb8356e6cf3 (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.scala | 3 |
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. |
