summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util
diff options
context:
space:
mode:
authorJim Lawson2016-07-19 15:08:22 -0700
committerJim Lawson2016-07-19 15:08:22 -0700
commit3120eefc8a73b5ab3d8f909445a3e004b5e60cc6 (patch)
treee1a2aa9591ccc882a941d1ddbc9ded3218b5bc85 /src/main/scala/chisel3/util
parentb27f29902d9f1d886e8edf1fc5e960cf9a634184 (diff)
Incorporate connection logic.
Compiles but fails tests.
Diffstat (limited to 'src/main/scala/chisel3/util')
-rw-r--r--src/main/scala/chisel3/util/Decoupled.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/scala/chisel3/util/Decoupled.scala b/src/main/scala/chisel3/util/Decoupled.scala
index 73f58ed4..4a6b72e9 100644
--- a/src/main/scala/chisel3/util/Decoupled.scala
+++ b/src/main/scala/chisel3/util/Decoupled.scala
@@ -12,8 +12,8 @@ class DecoupledIO[+T <: Data](gen: T) extends Bundle
{
val ready = Input(Bool())
val valid = Output(Bool())
- val bits = Output(gen.newType)
- override protected def cloneType: this.type = DecoupledIO(gen).asInstanceOf[this.type]
+ val bits = Output(gen.cloneType)
+ override def cloneType: this.type = DecoupledIO(gen).asInstanceOf[this.type]
}
object DecoupledIO {
@@ -30,7 +30,7 @@ object DecoupledIO {
* @return dat.
*/
def enq(dat: T): T = {
- target.valid := true.asBool
+ target.valid := Bool(true)
target.bits := dat
dat
}
@@ -38,7 +38,7 @@ object DecoupledIO {
/** Indicate no enqueue occurs. Valid is set to false, and all bits are set to zero.
*/
def noenq(): Unit = {
- target.valid := false.asBool
+ target.valid := Bool(false)
target.bits := target.bits.fromBits(0.asUInt)
}
@@ -48,17 +48,17 @@ object DecoupledIO {
* @return the data for this device,
*/
def deq(): T = {
- target.ready := true.asBool
+ target.ready := Bool(true)
target.bits
}
/** Indicate no dequeue occurs. Ready is set to false
*/
def nodeq(): Unit = {
- target.ready := false.asBool
+ target.ready := Bool(false)
}
}
- override def cloneType: this.type = { new DeqIO(gen).asInstanceOf[this.type]; }
+// override def cloneType: this.type = { DeqIO(gen).asInstanceOf[this.type]; }
}
object EnqIO {