summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Decoupled.scala
diff options
context:
space:
mode:
authorRichard Lin2018-02-02 23:30:56 -0800
committerGitHub2018-02-02 23:30:56 -0800
commit1bfca502c69a26edca86d716a1ca9d24e6789e59 (patch)
treea5c035ee45c3cd66e2d9b63c74aca75575f78f83 /src/main/scala/chisel3/util/Decoupled.scala
parent639617ea42c777b8dd1f4300d42784e45f294d76 (diff)
Autoclonetype will clone args that are of type data (#768)
Diffstat (limited to 'src/main/scala/chisel3/util/Decoupled.scala')
-rw-r--r--src/main/scala/chisel3/util/Decoupled.scala10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/scala/chisel3/util/Decoupled.scala b/src/main/scala/chisel3/util/Decoupled.scala
index bcd65a1b..d2419325 100644
--- a/src/main/scala/chisel3/util/Decoupled.scala
+++ b/src/main/scala/chisel3/util/Decoupled.scala
@@ -101,9 +101,6 @@ object Decoupled
irr.ready := d.ready
d
}
-// override def cloneType: this.type = {
-// DeqIO(gen).asInstanceOf[this.type]
-// }
}
/** A concrete subclass of ReadyValidIO that promises to not change
@@ -154,8 +151,9 @@ object DeqIO {
* @param gen The type of data to queue
* @param entries The max number of entries in the queue.
*/
-class QueueIO[T <: Data](gen: T, entries: Int) extends Bundle
-{
+class QueueIO[T <: Data](private val gen: T, val entries: Int) extends Bundle
+{ // See github.com/freechipsproject/chisel3/issues/765 for why gen is a private val and proposed replacement APIs.
+
/* These may look inverted, because the names (enq/deq) are from the perspective of the client,
* but internally, the queue implementation itself sits on the other side
* of the interface so uses the flipped instance.
@@ -166,8 +164,6 @@ class QueueIO[T <: Data](gen: T, entries: Int) extends Bundle
val deq = Flipped(DeqIO(gen))
/** The current amount of data in the queue */
val count = Output(UInt(log2Ceil(entries + 1).W))
-
- override def cloneType = new QueueIO(gen, entries).asInstanceOf[this.type]
}
/** A hardware module implementing a Queue