1
0

fix up cloneType calls in clock crossers

This commit is contained in:
Howard Mao 2016-07-13 14:31:19 -07:00
parent eeae74e3fc
commit 66b9c5ad05

View File

@ -2,8 +2,8 @@ package junctions
import Chisel._ import Chisel._
class Crossing[T <: Data](gen: T, enq_sync: Boolean, deq_sync: Boolean) extends Bundle { class Crossing[T <: Data](gen: T, enq_sync: Boolean, deq_sync: Boolean) extends Bundle {
val enq = Decoupled(gen.cloneType).flip() val enq = Decoupled(gen).flip()
val deq = Decoupled(gen.cloneType) val deq = Decoupled(gen)
val enq_clock = if (enq_sync) Some(Clock(INPUT)) else None val enq_clock = if (enq_sync) Some(Clock(INPUT)) else None
val deq_clock = if (deq_sync) Some(Clock(INPUT)) else None val deq_clock = if (deq_sync) Some(Clock(INPUT)) else None
val enq_reset = if (enq_sync) Some(Bool(INPUT)) else None val enq_reset = if (enq_sync) Some(Bool(INPUT)) else None
@ -24,15 +24,15 @@ class AsyncHandshakeSource[T <: Data](gen: T, sync: Int, clock: Clock, reset: Bo
extends Module(_clock = clock, _reset = reset) { extends Module(_clock = clock, _reset = reset) {
val io = new Bundle { val io = new Bundle {
// These come from the source clock domain // These come from the source clock domain
val enq = Decoupled(gen.cloneType).flip() val enq = Decoupled(gen).flip()
// These cross to the sink clock domain // These cross to the sink clock domain
val bits = gen.cloneType val bits = gen.cloneType.asOutput
val push = Bool(OUTPUT) val push = Bool(OUTPUT)
val pop = Bool(INPUT) val pop = Bool(INPUT)
} }
val ready = RegInit(Bool(true)) val ready = RegInit(Bool(true))
val bits = Reg(gen.cloneType) val bits = Reg(gen)
val push = RegInit(Bool(false)) val push = RegInit(Bool(false))
io.enq.ready := ready io.enq.ready := ready
@ -57,15 +57,15 @@ class AsyncHandshakeSink[T <: Data](gen: T, sync: Int, clock: Clock, reset: Bool
extends Module(_clock = clock, _reset = reset) { extends Module(_clock = clock, _reset = reset) {
val io = new Bundle { val io = new Bundle {
// These cross to the source clock domain // These cross to the source clock domain
val bits = gen.cloneType.flip() val bits = gen.cloneType.asInput
val push = Bool(INPUT) val push = Bool(INPUT)
val pop = Bool(OUTPUT) val pop = Bool(OUTPUT)
// These go to the sink clock domain // These go to the sink clock domain
val deq = Decoupled(gen.cloneType) val deq = Decoupled(gen)
} }
val valid = RegInit(Bool(false)) val valid = RegInit(Bool(false))
val bits = Reg(gen.cloneType) val bits = Reg(gen)
val pop = RegInit(Bool(false)) val pop = RegInit(Bool(false))
io.deq.valid := valid io.deq.valid := valid