Commit 2685786a authored by Jens Korinth's avatar Jens Korinth
Browse files

SlowQueue: remove direct reset references

parent 57bf9a77
......@@ -13,24 +13,19 @@ class SlowQueue(width: Int, val delay: Int = 10) extends Module {
val waiting :: ready :: Nil = Enum(2)
val state = RegInit(ready)
val wr = Reg(UInt(log2Ceil(delay).W))
val wr = RegInit(UInt(log2Ceil(delay).W), io.dly)
io.deq.bits := io.enq.bits
io.enq.ready := io.deq.ready && state === ready
io.deq.valid := io.enq.valid && state === ready
when (reset) {
state := ready
when (state === ready && io.enq.ready && io.deq.valid) {
state := waiting
wr := io.dly
}
.otherwise {
when (state === ready && io.enq.ready && io.deq.valid) {
state := waiting
wr := io.dly
}
when (state === waiting) {
wr := wr - 1.U
when (wr === 0.U) { state := ready }
}
when (state === waiting) {
wr := wr - 1.U
when (wr === 0.U) { state := ready }
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment