summaryrefslogtreecommitdiff
path: root/src/main/scala/Chisel/utils.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/Chisel/utils.scala')
-rw-r--r--src/main/scala/Chisel/utils.scala20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main/scala/Chisel/utils.scala b/src/main/scala/Chisel/utils.scala
index 3bbea34a..7f9811fd 100644
--- a/src/main/scala/Chisel/utils.scala
+++ b/src/main/scala/Chisel/utils.scala
@@ -280,7 +280,7 @@ class ValidIO[+T <: Data](gen2: T) extends Bundle
val valid = Bool(OUTPUT)
val bits = gen2.cloneType.asOutput
def fire(dummy: Int = 0): Bool = valid
- override def doCloneType: this.type = new ValidIO(gen2).asInstanceOf[this.type]
+ override def cloneType: this.type = new ValidIO(gen2).asInstanceOf[this.type]
}
/** Adds a valid protocol to any interface. The standard used is
@@ -296,7 +296,7 @@ class DecoupledIO[+T <: Data](gen: T) extends Bundle
val valid = Bool(OUTPUT)
val bits = gen.cloneType.asOutput
def fire(dummy: Int = 0): Bool = ready && valid
- override def doCloneType: this.type = new DecoupledIO(gen).asInstanceOf[this.type]
+ override def cloneType: this.type = new DecoupledIO(gen).asInstanceOf[this.type]
}
/** Adds a ready-valid handshaking protocol to any interface.
@@ -310,22 +310,18 @@ object Decoupled {
class EnqIO[T <: Data](gen: T) extends DecoupledIO(gen)
{
def enq(dat: T): T = { valid := Bool(true); bits := dat; dat }
- override def init(dummy: Int = 0) = {
- valid := Bool(false);
- for (io <- bits.flatten)
- io := UInt(0)
- }
- override def doCloneType: this.type = { new EnqIO(gen).asInstanceOf[this.type]; }
+ valid := Bool(false)
+ for (io <- bits.flatten)
+ io := UInt(0)
+ override def cloneType: this.type = { new EnqIO(gen).asInstanceOf[this.type]; }
}
class DeqIO[T <: Data](gen: T) extends DecoupledIO(gen)
{
flip()
- override def init(dummy: Int = 0) = {
- ready := Bool(false)
- }
+ ready := Bool(false)
def deq(b: Boolean = false): T = { ready := Bool(true); bits }
- override def doCloneType: this.type = { new DeqIO(gen).asInstanceOf[this.type]; }
+ override def cloneType: this.type = { new DeqIO(gen).asInstanceOf[this.type]; }
}