From a9c58e9d9f95203040f72c1aa01654b492bb0314 Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Tue, 18 Jul 2017 14:20:26 -0700 Subject: [PATCH] diplomacy: support creating ShiftQueues as well --- src/main/scala/diplomacy/Parameters.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/scala/diplomacy/Parameters.scala b/src/main/scala/diplomacy/Parameters.scala index 3521f300..e0c5cef9 100644 --- a/src/main/scala/diplomacy/Parameters.scala +++ b/src/main/scala/diplomacy/Parameters.scala @@ -3,6 +3,7 @@ package freechips.rocketchip.diplomacy import Chisel._ +import freechips.rocketchip.util.ShiftQueue /** Options for memory regions */ object RegionType { @@ -267,6 +268,13 @@ case class BufferParams(depth: Int, flow: Boolean, pipe: Boolean) def apply[T <: Data](x: DecoupledIO[T]) = if (isDefined) Queue(x, depth, flow=flow, pipe=pipe) else x + + def sq[T <: Data](x: DecoupledIO[T]) = + if (!isDefined) x else { + val sq = Module(new ShiftQueue(x.bits, depth, flow=flow, pipe=pipe)) + sq.io.enq <> x + sq.io.deq + } } object BufferParams